修复spark请求问题

This commit is contained in:
junleea 2025-03-24 15:42:32 +08:00
parent f4f197fa8c
commit 26126a10c8
1 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ import (
/***************** Spark请求结构 ***********************/ /***************** Spark请求结构 ***********************/
type SparkRequestHeader struct { type SparkRequestHeader struct {
AppID string `json:"app_id"` AppID string `json:"app_id"`
UID string `json:"uid"` UID string `json:"uid,omitempty"`
} }
type ChatParameter struct { type ChatParameter struct {
@ -123,7 +123,7 @@ func Spark(modelParam proto.ModelParam, question, channel string, SessionID, Use
//发送消息 //发送消息
go func() { go func() {
data := genSparkParams(modelParam.APPID, question) data := genSparkParams(question, modelParam.APPID)
//将数据转换为json //将数据转换为json
//dataByte, err := json.Marshal(data) //dataByte, err := json.Marshal(data)
if err != nil { if err != nil {
@ -154,7 +154,7 @@ func Spark(modelParam proto.ModelParam, question, channel string, SessionID, Use
} }
if data.Header.Code != 0 { if data.Header.Code != 0 {
log.Println("Error response:", data.Header.Message, msg) log.Println("Error response:", data.Header.Message, string(msg))
break break
} }
if data.Header.Status == 2 { if data.Header.Status == 2 {