API
export type ToolCall<ToolUnion extends AnyTool > =
Prettify <
ToolUnion extends Tool <
infer Name,
infer Args,
infer Result
>
?
| {
role: "tool";
status: "done";
name: Name;
args: Args;
result: PromiseSettledResult <Result>;
toolCallId: string;
}
| {
role: "tool";
status: "pending";
name: Name;
args: Args;
toolCallId: string;
progress?: number;
}
: never
>;
ToolCall
@type
ToolUnion
AnyTool