Expand description
Provider-surface detection, best-effort normalization, and construction of the matching built-in codecs from a raw payload, surface, or codec name.
Enums§
- Provider
Surface - A built-in provider request/response surface.
Functions§
- detect_
request_ surface - Detect the request surface from a raw request body by top-level key.
- detect_
request_ surface_ with_ hint - Like
detect_request_surface, but a recognizedprovider_hintresolves the one ambiguous shape (an Anthropic request without a top-levelsystem, otherwise read as OpenAI Chat). Today, only the exact hints"anthropic"and"anthropic.messages"change detection;Noneor any other value is ignored and detection stays shape-only. - detect_
response_ surface - Detect the response surface from a raw provider response, classifying only when exactly one built-in shape matches (the built-in codecs accept minimal objects, so decode success alone is not a reliable classifier).
- normalize_
request - Best-effort decode of a raw request into
AnnotatedLlmRequest(fail-open). - normalize_
request_ with_ hint - Like
normalize_request, but a recognizedprovider_hintcan disambiguate provider request shapes that are otherwise identical. - normalize_
response - Best-effort decode of a raw response into
AnnotatedLlmResponse(fail-open). - request_
codec - Constructs the built-in bidirectional request codec (
LlmCodec) for a surface. - response_
codec - Constructs the built-in decode-only response codec (
LlmResponseCodec) for a surface. - streaming_
codec - Constructs a fresh, single-use streaming codec (
StreamingCodec) for a surface. - supported_
codec_ names - The canonical codec names of every built-in provider surface, for config validation and “supported codec” messages.