Apologies for the confusion. But I wanted to have automatic translation to English of the transcribed text set to False.
Closed this issue · 2 comments
sanesanyo commented
Hi,
Apologies for not explaining myself properly. Currently the hook returns the transcribed text which is automatically translated in English. I was hoping that the user can control this feature by passing a prop e.g. "translation: False". Based on the documentation of Whisper API, the input is called "translation".
Great job with this hook.
chengsokdara commented
@sanesanyo I just release new version v0.0.11.
Now you can pass whisperConfig to control the language
import { useWhisper } from '@chengsokdara/use-whisper'
const App = () => {
const { transcript } = useWhisper({
apiKey: env.process.OPENAI_API_TOKEN, // YOUR_OPEN_AI_TOKEN
autoTranscribe: true,
whisperConfig: {
prompt: 'previous conversation', // you can pass previous conversation for context
response_format: 'text', // output text instead of json
temperature: 0.8, // random output
language: 'es', // Spanish
},
})
return (
<div>
<p>{transcript.text}</p>
</div>
)
}
sanesanyo commented
Perfect, that works. Thanks once again.