Skip to content

PromptTools

Namespace: Vercel.AI.Prompt

public static class PromptTools

Tool preparation. Maps to prepareTools.

Inheritance: object

View source

PrepareTools(IReadOnlyDictionary<string, PromptTool>?, IReadOnlyList<string>?, IReadOnlyDictionary<string, object?>?, string?)

Section titled “PrepareTools(IReadOnlyDictionary<string, PromptTool>?, IReadOnlyList<string>?, IReadOnlyDictionary<string, object?>?, string?)”
public static IReadOnlyList<PreparedTool>? PrepareTools(IReadOnlyDictionary<string, PromptTool>? tools, IReadOnlyList<string>? toolOrder = null, IReadOnlyDictionary<string, object?>? toolsContext = null, string? sandboxDescription = null)

Converts tools into the language-model list. Returns null when <code class=“paramref”>tools</code> is null or empty. <code class=“paramref”>toolOrder</code> names come first. The rest are sorted by name.

Parameters

Name Type Description
tools IReadOnlyDictionary<string, PromptTool>
toolOrder IReadOnlyList<string>
toolsContext IReadOnlyDictionary<string, object>
sandboxDescription string

Returns: IReadOnlyList<PreparedTool>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product