feat: enable SSE streaming support in Anthropic handler
- Updated AnthropicHandler to check for streaming configuration before handling SSE transform. - Modified handleStreaming to use the original request body instead of forcing stream to true. - Adjusted the transformation logic in AnthropicToBifrost to respect the original stream setting. - Added logging for SSE streaming configuration in the main application.
This commit is contained in:
@@ -143,16 +143,11 @@ func AnthropicToBifrost(rawBody []byte) ([]byte, error) {
|
||||
log.Printf("[TRANSFORM] Model auto-prefixed: %s -> %s", antReq.Model, model)
|
||||
}
|
||||
|
||||
// Force stream=false — streaming SSE responses can't be transformed back to Anthropic format.
|
||||
if antReq.Stream {
|
||||
log.Printf("[TRANSFORM] Stream forced to false (SSE not supported for transform)")
|
||||
}
|
||||
|
||||
bfReq := BifrostRequest{
|
||||
Model: model,
|
||||
Messages: bfMessages,
|
||||
MaxTokens: antReq.MaxTokens,
|
||||
Stream: false,
|
||||
Stream: antReq.Stream,
|
||||
}
|
||||
return json.Marshal(bfReq)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user