diff --git a/package/src/components/AITypingIndicatorView/hooks/useAIState.ts b/package/src/components/AITypingIndicatorView/hooks/useAIState.ts index 9e7edcac5..6cdb24b90 100644 --- a/package/src/components/AITypingIndicatorView/hooks/useAIState.ts +++ b/package/src/components/AITypingIndicatorView/hooks/useAIState.ts @@ -33,17 +33,17 @@ export const useAIState = < } const indicatorChangedListener = channel.on( - 'ai_indicator_changed', + 'ai_indicator.update', (event: Event) => { const { cid } = event; - const state = event.state as AIStateType; + const state = event.ai_state as AIStateType; if (channel.cid === cid) { setAiState(state); } }, ); - const indicatorClearedListener = channel.on('ai_indicator_clear', (event) => { + const indicatorClearedListener = channel.on('ai_indicator.clear', (event) => { const { cid } = event; if (channel.cid === cid) { setAiState(AIStates.Idle); diff --git a/package/src/components/MessageInput/MessageInput.tsx b/package/src/components/MessageInput/MessageInput.tsx index 807dfc1fa..cd7f2de54 100644 --- a/package/src/components/MessageInput/MessageInput.tsx +++ b/package/src/components/MessageInput/MessageInput.tsx @@ -734,7 +734,7 @@ const MessageInputWithContext = < const { aiState } = useAIState(channel); const stopGenerating = useCallback( - () => channel.sendEvent({ type: 'stop_generating' }), + () => channel.sendEvent({ type: 'ai_indicator.stop' }), [channel], ); const shouldDisplayStopAIGeneration = [AIStates.Thinking, AIStates.Generating].includes(aiState);