Expand description
Canonical AI wire types and per-protocol codecs, shared by the gateway and the agent provider clients.
The gateway speaks one provider-neutral model internally. Inbound adapters
parse a client wire request into a canonical::CanonicalRequest; outbound
adapters render that request to an upstream provider, parse the upstream
reply into a canonical::CanonicalResponse, and map upstream SSE bytes to
canonical::CanonicalEvents.
canonicalholds those provider-neutral request/response/event types.- The per-protocol modules (
anthropic,openai_chat,openai_responses,gemini) hold the codec for one wire dialect: request build, response parse, stop-reason + usage mapping, SSE-to-event translation, and auth-header construction.
These types are defined ONCE here and re-exported by the gateway and the agent provider clients so both layers share a single wire vocabulary.
Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.
Modules§
- anthropic
- Anthropic Messages wire codec.
- canonical
- Provider-neutral request, response, and streaming-event model.
- gemini
- Gemini
generateContent/streamGenerateContentwire codec. - inspect
- Inspection surface for outbound wire bodies.
- openai_
chat OpenAIChat Completions wire codec.- openai_
responses OpenAIResponses wire codec.- sse
- Server-Sent Events framing shared by every provider SSE codec.
Constants§
- BUFFERED_
BODY_ LIMIT_ BYTES - The bridge proxy and the gateway body reader must agree on this ceiling: a body the bridge accepts and forwards must not be rejected by the gateway.