Valora
API Reference@valora-ai/reactindexFunctions

useAgent

function useAgent(session?): UseAgentReturn;

Defined in: packages/react/src/hooks/session/useAgent.ts:28

Note. This feature is under active development and may change based on developer feedback and real-world usage. useAgent encapculates all agent state, normalizing some quirks around how remote voice agents work.

Parameters

ParameterType
session?unknown

Returns

UseAgentReturn

Example

const { agent, state } = useAgent();
return <button disabled={state !== "speaking"} onClick={() => agent.interrupt()}>Interrupt</button>;

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub