跳转到内容

runToolInputGuardrails

此内容尚不支持你的语言。

function runToolInputGuardrails<TContext, TAgent>(__namedParameters): Promise<
| {
type: "allow";
}
| {
message: string;
type: "reject";
}>;
Type Parameter

TContext

TAgent extends Agent<any, any>

Parameter Type Description

__namedParameters

{ agent: TAgent; context: RunContext<TContext>; guardrails?: ToolInputGuardrailDefinition<TContext>[]; onResult?: (result) => void; toolCall: { arguments: string; callId: string; id?: string; name: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; }

__namedParameters.agent

TAgent

__namedParameters.context

RunContext<TContext>

__namedParameters.guardrails?

ToolInputGuardrailDefinition<TContext>[]

__namedParameters.onResult?

(result) => void

__namedParameters.toolCall

{ arguments: string; callId: string; id?: string; name: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }

__namedParameters.toolCall.arguments

string

The arguments of the function call.

__namedParameters.toolCall.callId

string

The ID of the tool call. Required to match up the respective tool call result.

__namedParameters.toolCall.id?

string

An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level.

__namedParameters.toolCall.name

string

The name of the function.

__namedParameters.toolCall.providerData?

Record<string, any>

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

__namedParameters.toolCall.status?

"in_progress" | "completed" | "incomplete"

The status of the function call.

__namedParameters.toolCall.type

"function_call"

Promise< | { type: "allow"; } | { message: string; type: "reject"; }>