fix: update OpenAI request fields to use json.RawMessage for dynamic data handling

This commit is contained in:
CaIon
2026-03-06 19:10:37 +08:00
parent 9905599d27
commit fb76abb329
6 changed files with 34 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
package baidu
import (
"encoding/json"
"time"
"github.com/QuantumNous/new-api/dto"
@@ -12,16 +13,16 @@ type BaiduMessage struct {
}
type BaiduChatRequest struct {
Messages []BaiduMessage `json:"messages"`
Temperature *float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
PenaltyScore float64 `json:"penalty_score,omitempty"`
Stream bool `json:"stream,omitempty"`
System string `json:"system,omitempty"`
DisableSearch bool `json:"disable_search,omitempty"`
EnableCitation bool `json:"enable_citation,omitempty"`
MaxOutputTokens *int `json:"max_output_tokens,omitempty"`
UserId string `json:"user_id,omitempty"`
Messages []BaiduMessage `json:"messages"`
Temperature *float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
PenaltyScore float64 `json:"penalty_score,omitempty"`
Stream bool `json:"stream,omitempty"`
System string `json:"system,omitempty"`
DisableSearch bool `json:"disable_search,omitempty"`
EnableCitation bool `json:"enable_citation,omitempty"`
MaxOutputTokens *int `json:"max_output_tokens,omitempty"`
UserId json.RawMessage `json:"user_id,omitempty"`
}
type Error struct {