More of OpenAI's API: Responses structured output, images and previous_response_id; rerank, score and audio passed through; moderations by the judge

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 22:56:25 +02:00
1 parent 32ff1dbd6f
commit 9136bc71c2
12 files changed
+549 -5

No files matched your search

+8 -1
View File
@@ -165,6 +165,9 @@ type Request struct {
// and a gateway that accumulated every reply in memory would be one long
// answer away from trouble; a request that stores nothing must pay nothing.
CaptureReply int
// ContentType is the body's, when it is not JSON: an audio upload's
// multipart form.
ContentType string
// Filter, when set, sees a whole non-streamed answer and the headers
// about to be sent with it, and returns the body to send: a guard's
@@ -241,7 +244,11 @@ func (p *Proxy) Do(ctx context.Context, w http.ResponseWriter, r Request) (Outco
return Outcome{Retryable: false}, err
}
req.Header = cloneForUpstream(r.Header)
req.Header.Set("Content-Type", "application/json")
ct := r.ContentType
if ct == "" {
ct = "application/json"
}
req.Header.Set("Content-Type", ct)
if r.APIKey != "" {
req.Header.Set("Authorization", "Bearer "+r.APIKey)
}