Skip to content

AnthropicResponse

Namespace: Vercel.AI.Anthropic

public static class AnthropicResponse

Maps an Anthropic Messages JSON body onto a generate result.

Inheritance: object

View source

Parse(string, AnthropicParseContext, IReadOnlyDictionary<string, string>?)

Section titled “Parse(string, AnthropicParseContext, IReadOnlyDictionary<string, string>?)”
public static LanguageModelGenerateResult Parse(string json, AnthropicParseContext context, IReadOnlyDictionary<string, string>? headers = null)

Parses a Messages response body.

Parameters

Name Type Description
json string
context AnthropicParseContext
headers IReadOnlyDictionary<string, string>

Returns: LanguageModelGenerateResult

View source

Parse(JsonElement, AnthropicParseContext, string?, IReadOnlyDictionary<string, string>?)

Section titled “Parse(JsonElement, AnthropicParseContext, string?, IReadOnlyDictionary<string, string>?)”
public static LanguageModelGenerateResult Parse(JsonElement root, AnthropicParseContext context, string? raw = null, IReadOnlyDictionary<string, string>? headers = null)

Parses a Messages response object.

Parameters

Name Type Description
root JsonElement
context AnthropicParseContext
raw string
headers IReadOnlyDictionary<string, string>

Returns: LanguageModelGenerateResult

View source

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