Skip to content

Commit 4321ada

Browse files
committed
feat(service): add ForwardAsResponses/ForwardAsChatCompletions on GatewayService
New forwarding methods on GatewayService for Anthropic platform groups: - ForwardAsResponses: accept Responses body → convert to Anthropic → forward to upstream → convert response back to Responses format. Supports both streaming (SSE event-by-event conversion) and buffered (accumulate then convert) response modes. - ForwardAsChatCompletions: chain CC→Responses→Anthropic for request, Anthropic→Responses→CC for response. Streaming uses dual state machine chain with [DONE] marker. Both methods reuse existing GatewayService infrastructure: buildUpstreamRequest, Claude Code mimicry, cache control enforcement, model mapping, and return UpstreamFailoverError for handler-level retry.
1 parent 68f151f commit 4321ada

2 files changed

Lines changed: 962 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)