Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
francamps committed Sep 13, 2024
1 parent 5f61753 commit cc8d536
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions packages/react/src/lib/useVoiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,28 +220,37 @@ export const useVoiceClient = (props: {
[readyState],
);

const sendAudio = useCallback((arrayBuffer: ArrayBufferLike) => {
if (readyState !== VoiceReadyState.OPEN) {
throw new Error('Socket is not open');
}
client.current?.socket?.send(arrayBuffer);
}, [readyState]);
const sendAudio = useCallback(
(arrayBuffer: ArrayBufferLike) => {
if (readyState !== VoiceReadyState.OPEN) {
throw new Error('Socket is not open');
}
client.current?.socket?.send(arrayBuffer);
},
[readyState],
);

const sendUserInput = useCallback((text: string) => {
if (readyState !== VoiceReadyState.OPEN) {
throw new Error('Socket is not open');
}
client.current?.sendUserInput(text);
}, [readyState]);
const sendUserInput = useCallback(
(text: string) => {
if (readyState !== VoiceReadyState.OPEN) {
throw new Error('Socket is not open');
}
client.current?.sendUserInput(text);
},
[readyState],
);

const sendAssistantInput = useCallback((text: string) => {
if (readyState !== VoiceReadyState.OPEN) {
throw new Error('Socket is not open');
}
client.current?.sendAssistantInput({
text,
});
}, [readyState]);
const sendAssistantInput = useCallback(
(text: string) => {
if (readyState !== VoiceReadyState.OPEN) {
throw new Error('Socket is not open');
}
client.current?.sendAssistantInput({
text,
});
},
[readyState],
);

const sendToolMessage = useCallback(
(
Expand Down

0 comments on commit cc8d536

Please sign in to comment.