Skip to content

Commit

Permalink
Merge pull request #821 from nkowaokwu/fix/translation
Browse files Browse the repository at this point in the history
Correct Translation endpoint response key
  • Loading branch information
ebubae authored Nov 7, 2024
2 parents a02879d + 3c27ebe commit 7f302a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/controllers/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TranslationRequestBody = z
})
.strict();

interface Translation {
export interface Translation {
translation: string;
}

Expand Down Expand Up @@ -73,7 +73,7 @@ export const getTranslation: MiddleWare = async (req, res, next) => {
data: payload,
});

return res.send({ transcription: response.translation });
return res.send({ translation: response.translation });
} catch (err) {
return next(err);
}
Expand Down
5 changes: 1 addition & 4 deletions src/pages/APIs/PredictionAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import { useCallable } from '../../pages/hooks/useCallable';
import DemoOption from '../../shared/constants/DemoOption';
import LanguageEnum from '../../shared/constants/LanguageEnum';
import { OutgoingWord } from '../../types';
import { Translation } from '../../controllers/translation';

export interface Prediction {
transcription: string;
}

export interface Translation {
translation: string;
}

export interface Dictionary {
words: OutgoingWord[];
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/components/UseCases/UseCaseCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { As, Box, Heading, HStack, Text, VStack } from '@chakra-ui/react';
import { Box, Heading, HStack, Text, VStack } from '@chakra-ui/react';

const UseCaseCard = ({
label,
Expand All @@ -8,7 +8,7 @@ const UseCaseCard = ({
flexDirection,
}: {
label: string,
as: As,
as: 'h1' | 'h2' | 'h3',
description: string,
image: string,
flexDirection: 'row' | 'row-reverse',
Expand Down
10 changes: 4 additions & 6 deletions src/pages/shared/useCases.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
import { As } from '@chakra-ui/react';

const useCases = [
{
label: 'Generate Subtitles',
as: 'h1' as As,
as: 'h1',
description:
'Generate Igbo subtitles to reach more native speakers across the world. Perfect for content-producing teams.',
image:
'https://images.pexels.com/photos/2873486/pexels-photo-2873486.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2',
},
{
label: 'Transcribe Conversations',
as: 'h1' as As,
as: 'h1',
description:
'Convert Igbo speech into text, in real-time. Perfect for team capturing customer conversations like telehealth or insurance companies.',
image:
'https://images.unsplash.com/photo-1611679782010-5ac7ff596d9a?q=80&w=3544&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
},
{
label: 'Build Language Learning Services',
as: 'h1' as As,
as: 'h1',
description:
'Rely on the +25,000 Igbo words and +100,000 Igbo sentences to build experiences for language learners. Perfect for e-learning teams.',
image:
'https://images.pexels.com/photos/27541898/pexels-photo-27541898/free-photo-of-drummers.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2',
},
];
] as const;

export default useCases;

0 comments on commit 7f302a5

Please sign in to comment.