Skip to main content

Module resolve

Module resolve 

Source
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§

ProviderSurface
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 recognized provider_hint resolves the one ambiguous shape (an Anthropic request without a top-level system, otherwise read as OpenAI Chat). Today, only the exact hints "anthropic" and "anthropic.messages" change detection; None or 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 recognized provider_hint can 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.