Skip to content

Commit 8318a5d

Browse files
authored
Update voice assistant state attribute (#948)
1 parent 68cf9a8 commit 8318a5d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react/src/hooks/useVoiceAssistant.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export interface VoiceAssistant {
3030
agentAttributes: RemoteParticipant['attributes'] | undefined;
3131
}
3232

33+
const state_attribute = 'voice_assistant.state';
34+
3335
/**
3436
* @alpha
3537
*
@@ -50,11 +52,11 @@ export function useVoiceAssistant(): VoiceAssistant {
5052
} else if (
5153
connectionState === ConnectionState.Connecting ||
5254
!agent ||
53-
!attributes?.['agent.state']
55+
!attributes?.[state_attribute]
5456
) {
5557
return 'connecting';
5658
} else {
57-
return attributes['agent.state'] as VoiceAssistantState;
59+
return attributes[state_attribute] as VoiceAssistantState;
5860
}
5961
}, [attributes, agent, connectionState]);
6062

0 commit comments

Comments
 (0)