ADK for TypeScript: API Reference
System
Light
Dark
Search…
Preparing search index...
AgentRouter
Type Alias AgentRouter
AgentRouter
:
(
agents
:
Readonly
<
Record
<
string
,
BaseAgent
>
>
,
context
:
InvocationContext
,
errorContext
?:
{
failedKeys
:
ReadonlySet
<
string
>
;
lastError
:
unknown
}
,
)
=>
Promise
<
string
|
undefined
>
|
string
|
undefined
Type definition for a function that selects an agent based on the invocation context.
Type Declaration
(
agents
:
Readonly
<
Record
<
string
,
BaseAgent
>
>
,
context
:
InvocationContext
,
errorContext
?:
{
failedKeys
:
ReadonlySet
<
string
>
;
lastError
:
unknown
}
,
)
:
Promise
<
string
|
undefined
>
|
string
|
undefined
Parameters
agents
:
Readonly
<
Record
<
string
,
BaseAgent
>
>
context
:
InvocationContext
Optional
errorContext
:
{
failedKeys
:
ReadonlySet
<
string
>
;
lastError
:
unknown
}
Returns
Promise
<
string
|
undefined
>
|
string
|
undefined
ADK for TypeScript: API Reference - v1.5.0
Loading...
Type definition for a function that selects an agent based on the invocation context.