feat(xai): 为xAI渠道添加/v1/responses支持 (#2897)

* feat(xai): 为xAI渠道添加/v1/responses支持

* Add video generation model to constants

* fix: 修正先前更改中对于grok-3-mini的思考预算和"-search"设计
This commit is contained in:
funkpopo
2026-02-12 00:42:39 +08:00
committed by GitHub
parent 036c2df423
commit 75e533edb0
4 changed files with 39 additions and 21 deletions

View File

@@ -1,7 +1,6 @@
package xai
import (
"encoding/json"
"io"
"net/http"
"strings"
@@ -46,7 +45,7 @@ func xAIStreamHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Re
helper.StreamScannerHandler(c, resp, info, func(data string) bool {
var xAIResp *dto.ChatCompletionsStreamResponse
err := json.Unmarshal([]byte(data), &xAIResp)
err := common.UnmarshalJsonStr(data, &xAIResp)
if err != nil {
common.SysLog("error unmarshalling stream response: " + err.Error())
return true