Expand description
AI-05 (#195): Multi-dialect ingress parsers.
The gateway historically accepted only OpenAI-shaped chat requests
(openai_compat::parse_chat_request). This module adds parsers for
Anthropic Messages API and Gemini generateContent native request
formats, translating them to the canonical ChatRequest. This lets
clients using native Anthropic or Gemini SDKs use the gateway
without switching to the OpenAI format.
The parsers are the INVERSE of the provider adapters
(adapters/anthropic.rs, adapters/gemini.rs): the adapter
translates canonical -> provider-native for the outbound request;
the ingress parser translates client-native -> canonical for the
inbound request.
Functionsยง
- parse_
anthropic_ request - Parse an Anthropic Messages API request into the canonical
ChatRequest. The Anthropic native format has: - parse_
gemini_ request - Parse a Gemini generateContent request into the canonical
ChatRequest. The Gemini native format has: