ToolSearchGeneration
Namespace: Vercel.AI.Operations
public static class ToolSearchGenerationRuns the tool-search step loop used by generateText, streamText, and the tool-loop agent. The model tool list, execution timing, and catalog messages match across those modes.
Inheritance: object
Methods
Section titled “Methods”RunAsync(string, IReadOnlyDictionary<string, SearchableTool>, IReadOnlyDictionary<string, IReadOnlyList<string>>?, string, IReadOnlyList<IReadOnlyList<ToolSearchCall>>, string, CancellationToken)
Section titled “RunAsync(string, IReadOnlyDictionary<string, SearchableTool>, IReadOnlyDictionary<string, IReadOnlyList<string>>?, string, IReadOnlyList<IReadOnlyList<ToolSearchCall>>, string, CancellationToken)”public static Task<ToolSearchRun> RunAsync(string mode, IReadOnlyDictionary<string, SearchableTool> tools, IReadOnlyDictionary<string, IReadOnlyList<string>>? routing, string prompt, IReadOnlyList<IReadOnlyList<ToolSearchCall>> calls, string finalText, CancellationToken cancellationToken = default)Runs one generation mode. Discovered tools appear on the next step.
Parameters
| Name | Type | Description |
|---|---|---|
mode |
string | |
tools |
IReadOnlyDictionary<string, SearchableTool> | |
routing |
IReadOnlyDictionary<string, IReadOnlyList<string>> | |
prompt |
string | |
calls |
IReadOnlyList<IReadOnlyList<ToolSearchCall>> | |
finalText |
string | |
cancellationToken |
CancellationToken |
Returns: Task<ToolSearchRun>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product