Skip to content

Commit

Permalink
馃悰 fix: Fix response
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Nov 18, 2023
1 parent be086db commit 0e737d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/react/useOpenAISTT/useOpenAISTTAutoStop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ export const useOpenAISTTAutoStop = (
setIsGlobalLoading(false);
}, [stop]);

const { isLoading, error, mutate } = useOpenAISTTCore({
const {
isLoading,
error,
mutate,
data: response,
} = useOpenAISTTCore({
onError: (err, ...rest) => {
onError?.(err, ...rest);
console.error('Error useOpenAISTTAutoStop:', err);
Expand Down Expand Up @@ -93,6 +98,7 @@ export const useOpenAISTTAutoStop = (
isLoading: isGlobalLoading || isLoading || isRecording,
isRecording,
mutate,
response,
start: handleStart,
stop: handleStop,
text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const useSpeechRecognitionAutoStop = (
formattedTime,
isLoading,
isRecording: isLoading,
response: new Response(JSON.stringify({ text }), { status: 200 }),
start: handleStart,
stop: handleStop,
text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const useSpeechRecognitionInteractive = (
formattedTime,
isLoading: isGLobalLoading,
isRecording: isGLobalLoading,
response: new Response(JSON.stringify({ text: resultText }), { status: 200 }),
start: handleStart,
stop: handleStop,
text: resultText,
Expand Down

0 comments on commit 0e737d9

Please sign in to comment.