Skip to main content

UseA2AOptions

Agent Runtimes


Agent Runtimes / hooks/useA2A / UseA2AOptions

Interface: UseA2AOptions

Defined in: hooks/useA2A.tsx:33

Properties

agentId?

optional agentId?: string

Defined in: hooks/useA2A.tsx:41

Agent ID to use (default: 'demo-agent')


autoConnect?

optional autoConnect?: boolean

Defined in: hooks/useA2A.tsx:49

Auto-connect on mount (default: true)


baseUrl?

optional baseUrl?: string

Defined in: hooks/useA2A.tsx:37

Base URL for the A2A endpoint (e.g., http://localhost:8000).


onError?

optional onError?: (error) => void

Defined in: hooks/useA2A.tsx:65

Callback when an error occurs

Parameters

error

Error

Returns

void


onMessageReceived?

optional onMessageReceived?: (message) => void

Defined in: hooks/useA2A.tsx:57

Callback when a message is received

Parameters

message

Message

Returns

void


onMessageSent?

optional onMessageSent?: (content) => void

Defined in: hooks/useA2A.tsx:53

Callback when a message is sent

Parameters

content

string

Returns

void


onTaskStatusChange?

optional onTaskStatusChange?: (task) => void

Defined in: hooks/useA2A.tsx:61

Callback when a task status changes

Parameters

task

Task

Returns

void


streaming?

optional streaming?: boolean

Defined in: hooks/useA2A.tsx:45

Whether to use streaming (default: true)