add baidu ai model api configrations

This commit is contained in:
RockYang
2023-10-10 18:19:56 +08:00
parent cb2cb72333
commit da38684cdd
6 changed files with 274 additions and 8 deletions

View File

@@ -2,9 +2,9 @@ package types
// ApiRequest API 请求实体
type ApiRequest struct {
Model string `json:"model"`
Model string `json:"model,omitempty"` // 兼容百度文心一言
Temperature float32 `json:"temperature"`
MaxTokens int `json:"max_tokens"`
MaxTokens int `json:"max_tokens,omitempty"` // 兼容百度文心一言
Stream bool `json:"stream"`
Messages []interface{} `json:"messages,omitempty"`
Prompt []interface{} `json:"prompt,omitempty"` // 兼容 ChatGLM

View File

@@ -90,6 +90,7 @@ type Platform string
const OpenAI = Platform("OpenAI")
const Azure = Platform("Azure")
const ChatGLM = Platform("ChatGLM")
const Baidu = Platform("Baidu")
// UserChatConfig 用户的聊天配置
type UserChatConfig struct {