Expand description
Runtime-keyed transform dispatcher.
The typed transforms in crate::transform::{claude,gemini,openai}::* are
statically dispatched via TryFrom bounds. This module exposes the same
conversions as a dynamic API keyed on (OperationFamily, ProtocolKind)
pairs, which is what an LLM gateway needs at request time when the source
and destination protocols are only known at runtime.
Moved here from gproxy-provider::transform_dispatch in the SDK layer
refactor (spec: docs/superpowers/specs/2026-04-13-sdk-layer-refactor-design.md).
Structs§
Functions§
- convert_
error_ body_ or_ raw - Convert an upstream error body (non-2xx response body) from the upstream protocol’s error schema to the client’s expected error schema, falling back to the raw bytes on any failure.
- create_
stream_ response_ transformer - nonstream_
to_ stream - Convert a non-streaming response to stream events (same protocol).
Output is NDJSON (one JSON line per event) written into
out. - stream_
to_ nonstream - Convert stream events (NDJSON lines) to a non-streaming response (same protocol).
- transform_
request - Transform a request body from one (operation, protocol) to another.
- transform_
response - Transform a response body from upstream protocol back to client protocol.