vllm.entrypoints.anthropic.protocol
¶
Pydantic models for Anthropic API protocol.
Classes:
-
AnthropicContentBlock–Content block in message.
-
AnthropicContextManagement–Context management information for token counting.
-
AnthropicCountTokensRequest–Anthropic messages.count_tokens request.
-
AnthropicCountTokensResponse–Anthropic messages.count_tokens response.
-
AnthropicDelta–Delta for streaming responses.
-
AnthropicError–Error structure for Anthropic API.
-
AnthropicErrorResponse–Error response structure for Anthropic API.
-
AnthropicJsonOutputFormat–JSON output format configuration.
-
AnthropicMessage–Message structure.
-
AnthropicMessagesRequest–Anthropic Messages API request.
-
AnthropicMessagesResponse–Anthropic Messages API response.
-
AnthropicOutputConfig–Configuration options for the model's output, such as the output format.
-
AnthropicStreamEvent–Streaming event.
-
AnthropicThinkingConfigAdaptive–Extended thinking whose depth the model chooses.
-
AnthropicThinkingConfigBetweenTools–Thinking that is off up front but may resume between tool calls.
-
AnthropicThinkingConfigEnabled–Extended thinking with a fixed token budget.
-
AnthropicTool–Tool definition.
-
AnthropicToolChangeDefinition–A tool defined by value in a tool_addition block.
-
AnthropicToolChangeReference–A tool named by a tool_addition or tool_removal block.
-
AnthropicToolChoice–Tool Choice definition.
-
AnthropicUsage–Token usage information.
Functions:
-
translate_error_type–Translate an HTTP status code to Anthropic's
error.typevocabulary.
AnthropicContentBlock
¶
Bases: BaseModel
Content block in message.
AnthropicContextManagement
¶
Bases: BaseModel
Context management information for token counting.
AnthropicCountTokensRequest
¶
Bases: BaseModel
Anthropic messages.count_tokens request.
AnthropicCountTokensResponse
¶
Bases: BaseModel
Anthropic messages.count_tokens response.
AnthropicDelta
¶
Bases: BaseModel
Delta for streaming responses.
AnthropicError
¶
Bases: BaseModel
Error structure for Anthropic API.
AnthropicErrorResponse
¶
Bases: BaseModel
Error response structure for Anthropic API.
AnthropicJsonOutputFormat
¶
Bases: BaseModel
JSON output format configuration.
AnthropicMessage
¶
Bases: BaseModel
Message structure.
AnthropicMessagesRequest
¶
Bases: BaseModel
Anthropic Messages API request.
AnthropicMessagesResponse
¶
Bases: BaseModel
Anthropic Messages API response.
AnthropicOutputConfig
¶
Bases: BaseModel
Configuration options for the model's output, such as the output format.
AnthropicStreamEvent
¶
Bases: BaseModel
Streaming event.
AnthropicThinkingConfigAdaptive
¶
Bases: BaseModel
Extended thinking whose depth the model chooses.
display is accepted but ignored: reasoning is always returned.
AnthropicThinkingConfigBetweenTools
¶
Bases: BaseModel
Thinking that is off up front but may resume between tool calls.
vLLM maps this to disabled thinking. It cannot force a model to emit progress notes between tool calls; any reasoning the model emits is still returned as thinking blocks.
AnthropicThinkingConfigEnabled
¶
Bases: BaseModel
Extended thinking with a fixed token budget.
display is accepted but ignored: reasoning is always returned.
AnthropicTool
¶
Bases: BaseModel
Tool definition.
AnthropicToolChangeDefinition
¶
Bases: BaseModel
A tool defined by value in a tool_addition block.
AnthropicToolChangeReference
¶
Bases: BaseModel
A tool named by a tool_addition or tool_removal block.
AnthropicToolChoice
¶
Bases: BaseModel
Tool Choice definition.
AnthropicUsage
¶
Bases: BaseModel
Token usage information.
translate_error_type(status_code)
¶
Translate an HTTP status code to Anthropic's error.type vocabulary.