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:
parent
8bf2a65a0b
commit
9435458033
2 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue