From 39bfec7fd877f7d73c928574a81ebec027a8e899 Mon Sep 17 00:00:00 2001 From: Nexus Dev Date: Sat, 4 Apr 2026 02:43:10 +0000 Subject: [PATCH] feat(37-04): add voiceMode to chatApi.postMessageAndStream + useStreamingChat.startStream - postMessageAndStream data type extended with optional voiceMode field - startStream signature updated: (userMessage, agentId?, voiceMode?) - voiceMode forwarded into fetch body via postMessageAndStream call --- ui/src/api/chat.ts | 2 +- ui/src/hooks/useStreamingChat.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/api/chat.ts b/ui/src/api/chat.ts index 233742ac..6d5d5a94 100644 --- a/ui/src/api/chat.ts +++ b/ui/src/api/chat.ts @@ -62,7 +62,7 @@ export const chatApi = { async postMessageAndStream( conversationId: string, - data: { content: string; agentId?: string }, + data: { content: string; agentId?: string; voiceMode?: string }, callbacks: { onToken: (token: string) => void; onDone: (messageId: string, content: string) => void; diff --git a/ui/src/hooks/useStreamingChat.ts b/ui/src/hooks/useStreamingChat.ts index 85b24228..f76cfdb0 100644 --- a/ui/src/hooks/useStreamingChat.ts +++ b/ui/src/hooks/useStreamingChat.ts @@ -10,7 +10,7 @@ export function useStreamingChat(conversationId: string | null) { const [, startTransition] = useTransition(); const startStream = useCallback( - (userMessage: string, agentId?: string) => { + (userMessage: string, agentId?: string, voiceMode?: string) => { if (!conversationId) return; setIsStreaming(true); @@ -21,7 +21,7 @@ export function useStreamingChat(conversationId: string | null) { chatApi.postMessageAndStream( conversationId, - { content: userMessage, agentId }, + { content: userMessage, agentId, voiceMode }, { onToken: (token: string) => { startTransition(() => {