Conversion¶
- protoverta.convert_request(body, source, target, *, messages_mid_system=False, public_reasoning=False, text_logprobs=False, responses_penalties=False)[source]¶
Convert JSON input, including stream requests; reject unsupported semantics.
- protoverta.convert_response(body, source, target, *, public_reasoning=False, request_context=None, text_logprobs=False, max_top_logprobs=None, omit_reasoning=False)[source]¶
Convert a completed text/function response without inventing usage.
omit_reasoningis an explicit policy that drops upstream reasoning the target route cannot represent instead of rejecting the response.
- class protoverta.Protocol(*values)[source]¶
Bases:
StrEnumWire protocol of a request or response:
chat(Chat Completions),messages(Anthropic Messages) orresponses(OpenAI Responses).- CHAT = 'chat'¶
- MESSAGES = 'messages'¶
- RESPONSES = 'responses'¶
- exception protoverta.ConversionError[source]¶
Bases:
ValueErrorA request cannot be converted without changing its meaning.
- exception protoverta.UnsupportedFeatureError(feature)[source]¶
Bases:
ConversionErrorRecognized wire semantics without an equivalent enabled target mapping.
- Parameters:
feature (str)
- Return type:
None