Files
ai_proxy/server/model/app/request/ai_proxy.go
2026-03-03 06:05:51 +08:00

32 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package request
// Message 消息结构
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
}
// CharacterCard 角色卡片
type CharacterCard struct {
Name string `json:"name"`
Description string `json:"description"`
Personality string `json:"personality"`
Scenario string `json:"scenario"`
}
// ChatCompletionRequest 聊天补全请求OpenAI兼容
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages" binding:"required"`
PresetID uint `json:"presetId"`
BindingKey string `json:"bindingKey"`
CharacterCard *CharacterCard `json:"characterCard"`
Variables map[string]string `json:"variables"`
Temperature *float64 `json:"temperature"`
TopP *float64 `json:"topP"`
MaxTokens *int `json:"maxTokens"`
FrequencyPenalty *float64 `json:"frequencyPenalty"`
PresencePenalty *float64 `json:"presencePenalty"`
Stream bool `json:"stream"`
}