Genkit JS API reference
Preparing search index...
genkit
beta
AgentFn
Type Alias AgentFn<State>
AgentFn
:
(
sess
:
SessionRunner
<
State
>
,
options
:
{
abortSignal
?:
AbortSignal
;
context
?:
ActionContext
;
sendChunk
:
(
chunk
:
AgentStreamChunk
)
=>
void
;
}
,
)
=>
Promise
<
AgentResult
>
Function handler definition for custom agent actions.
Type Parameters
State
Type Declaration
(
sess
:
SessionRunner
<
State
>
,
options
:
{
abortSignal
?:
AbortSignal
;
context
?:
ActionContext
;
sendChunk
:
(
chunk
:
AgentStreamChunk
)
=>
void
;
}
,
)
:
Promise
<
AgentResult
>
Parameters
sess
:
SessionRunner
<
State
>
options
:
{
abortSignal
?:
AbortSignal
;
context
?:
ActionContext
;
sendChunk
:
(
chunk
:
AgentStreamChunk
)
=>
void
;
}
Returns
Promise
<
AgentResult
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Genkit JS API reference
Loading...
Function handler definition for custom agent actions.