Skip to content

AnthropicToolPreparer

Namespace: Vercel.AI.Anthropic

public static class AnthropicToolPreparer

Builds the Anthropic tools and tool_choice fields.

Inheritance: object

View source

Prepare(IReadOnlyList<AnthropicToolDefinition>?, string?, string?, bool?, AnthropicCacheControlValidator?, bool, bool, bool, bool)

Section titled “Prepare(IReadOnlyList<AnthropicToolDefinition>?, string?, string?, bool?, AnthropicCacheControlValidator?, bool, bool, bool, bool)”
public static AnthropicPreparedTools Prepare(IReadOnlyList<AnthropicToolDefinition>? tools, string? toolChoiceType, string? toolName, bool? disableParallelToolUse, AnthropicCacheControlValidator? cacheControl = null, bool supportsStructuredOutput = false, bool supportsStrictTools = false, bool defaultEagerInputStreaming = false, bool rejectsForcedToolUse = false)

Prepares tools. An empty list omits both tools and tool choice.

Parameters

Name Type Description
tools IReadOnlyList<AnthropicToolDefinition>
toolChoiceType string
toolName string
disableParallelToolUse bool?
cacheControl AnthropicCacheControlValidator
supportsStructuredOutput bool
supportsStrictTools bool
defaultEagerInputStreaming bool
rejectsForcedToolUse bool

Returns: AnthropicPreparedTools

View source

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