mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 12:20:52 +08:00
fix(openai): drop stream for responses/compact
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/router-for-me/CLIProxyAPI/v6/internal/registry"
|
||||
"github.com/router-for-me/CLIProxyAPI/v6/sdk/api/handlers"
|
||||
"github.com/tidwall/gjson"
|
||||
"github.com/tidwall/sjson"
|
||||
)
|
||||
|
||||
// OpenAIResponsesAPIHandler contains the handlers for OpenAIResponses API endpoints.
|
||||
@@ -113,6 +114,11 @@ func (h *OpenAIResponsesAPIHandler) Compact(c *gin.Context) {
|
||||
})
|
||||
return
|
||||
}
|
||||
if streamResult.Exists() {
|
||||
if updated, err := sjson.DeleteBytes(rawJSON, "stream"); err == nil {
|
||||
rawJSON = updated
|
||||
}
|
||||
}
|
||||
|
||||
c.Header("Content-Type", "application/json")
|
||||
modelName := gjson.GetBytes(rawJSON, "model").String()
|
||||
|
||||
Reference in New Issue
Block a user