Skip to content

Commit a787d86

Browse files
committed
document aibridge stream mashalling behaviour for chat completions
1 parent d43b583 commit a787d86

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

intercept/chatcompletions/streaming.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ func (i *StreamingInterception) ProcessRequest(w http.ResponseWriter, r *http.Re
125125
opts = append(opts, intercept.ActorHeadersAsOpenAIOpts(actor)...)
126126
}
127127

128+
// We take control of request body here and pass it to the SDK as a raw byte slice.
129+
// This is because the SDK's serialization applies hidden request options that result in
130+
// unexpected, breaking behaviour. See https://github.com/coder/aibridge/pull/164
128131
body, err := json.Marshal(i.req.ChatCompletionNewParams)
129132
if err != nil {
130133
return fmt.Errorf("marshal request body: %w", err)

0 commit comments

Comments
 (0)