AgentToolOptions
このコンテンツはまだ日本語訳がありません。
type AgentToolOptions<TContext, TAgent, TParameters> = object;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
|
|
|
|
Properties
Section titled “Properties”customOutputExtractor?
Section titled “customOutputExtractor?”optional customOutputExtractor?: (output) => string | Promise<string>;A function that extracts the output text from the agent. If not provided, the last message from the agent will be used.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”string | Promise<string>
includeInputSchema?
Section titled “includeInputSchema?”optional includeInputSchema?: boolean;Include the full JSON Schema for the structured tool input when invoking the agent.
inputBuilder?
Section titled “inputBuilder?”optional inputBuilder?: AgentToolInputBuilder<TParameters>;Builds the nested agent input from structured tool input data.
isEnabled?
Section titled “isEnabled?”optional isEnabled?: boolean | ((args) => boolean | Promise<boolean>);Determines whether this tool should be exposed to the model for the current run.
needsApproval?
Section titled “needsApproval?”optional needsApproval?: boolean | ToolApprovalFunction<TParameters>;Whether invoking this tool requires approval, matching the behavior of tool helpers. When provided as a function it receives the tool arguments and can implement custom approval logic.
onStream?
Section titled “onStream?”optional onStream?: (event) => void | Promise<void>;Optional hook to receive streamed events from the nested agent run.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”void | Promise<void>
parameters?
Section titled “parameters?”optional parameters?: TParameters;The schema used to validate tool input. Defaults to { input: string }.
resumeState?
Section titled “resumeState?”optional resumeState?: AgentToolResumeStateOptions;Controls how context is applied when resuming from serialized run state.
runConfig?
Section titled “runConfig?”optional runConfig?: Partial<RunConfig>;Run configuration for initializing the internal agent runner.
runOptions?
Section titled “runOptions?”optional runOptions?: AgentToolRunOptions<TContext, TAgent>;Additional run options for the agent (as tool) execution.
toolDescription?
Section titled “toolDescription?”optional toolDescription?: string;The description of the tool, which should indicate what the tool does and when to use it.
toolName?
Section titled “toolName?”optional toolName?: string;The name of the tool. If not provided, the name of the agent will be used.