Skip to content

AnthropicParseContext

Namespace: Vercel.AI.Anthropic

public sealed class AnthropicParseContext

Settings for mapping an Anthropic Messages response onto SDK content.

Inheritance: object

View source

AnthropicParseContext(bool, string, bool, IReadOnlyList<CallWarning>?)

Section titled “AnthropicParseContext(bool, string, bool, IReadOnlyList<CallWarning>?)”
public AnthropicParseContext(bool usesJsonResponseTool, string providerOptionsName, bool usedCustomProviderKey, IReadOnlyList<CallWarning>? warnings = null)

Creates parse settings.

Parameters

Name Type Description
usesJsonResponseTool bool
providerOptionsName string
usedCustomProviderKey bool
warnings IReadOnlyList<CallWarning>

View source

public Func<string>? GenerateId { get; set; }

Id factory for citation sources. Defaults to source-n.

Value: Func<string>

View source

public string ProviderOptionsName { get; }

Provider-options key.

Value: string

View source

public Dictionary<string, string> ToolNames { get; }

Maps an API tool name back to the caller’s tool name.

Value: Dictionary<string, string>

View source

public bool UsedCustomProviderKey { get; }

True when a custom provider-options key was present.

Value: bool

View source

public bool UsesJsonResponseTool { get; }

True when structured output was requested through the json tool.

Value: bool

View source

public IReadOnlyList<CallWarning> Warnings { get; }

Warnings from request preparation.

Value: IReadOnlyList<CallWarning>

View source

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