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
This commit is contained in:
Nexus Dev 2026-04-04 02:43:10 +00:00
parent b777ebe345
commit 39bfec7fd8
2 changed files with 3 additions and 3 deletions

View file

@ -62,7 +62,7 @@ export const chatApi = {
async postMessageAndStream( async postMessageAndStream(
conversationId: string, conversationId: string,
data: { content: string; agentId?: string }, data: { content: string; agentId?: string; voiceMode?: string },
callbacks: { callbacks: {
onToken: (token: string) => void; onToken: (token: string) => void;
onDone: (messageId: string, content: string) => void; onDone: (messageId: string, content: string) => void;

View file

@ -10,7 +10,7 @@ export function useStreamingChat(conversationId: string | null) {
const [, startTransition] = useTransition(); const [, startTransition] = useTransition();
const startStream = useCallback( const startStream = useCallback(
(userMessage: string, agentId?: string) => { (userMessage: string, agentId?: string, voiceMode?: string) => {
if (!conversationId) return; if (!conversationId) return;
setIsStreaming(true); setIsStreaming(true);
@ -21,7 +21,7 @@ export function useStreamingChat(conversationId: string | null) {
chatApi.postMessageAndStream( chatApi.postMessageAndStream(
conversationId, conversationId,
{ content: userMessage, agentId }, { content: userMessage, agentId, voiceMode },
{ {
onToken: (token: string) => { onToken: (token: string) => {
startTransition(() => { startTransition(() => {