Skip to content

AnthropicJsonSchema

Namespace: Vercel.AI.Anthropic

public static class AnthropicJsonSchema

Relaxes a JSON Schema so it can be sent as Anthropic output_config.format.schema. The caller’s original schema is not modified.

Inheritance: object

View source

public static JsonNode Sanitize(JsonElement schema)

Returns a schema Anthropic’s constrained decoder accepts.

Parameters

Name Type Description
schema JsonElement

Returns: JsonNode

View source

public static JsonNode Sanitize(JsonNode schema)

Returns a schema Anthropic’s constrained decoder accepts.

Parameters

Name Type Description
schema JsonNode

Returns: JsonNode

View source

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