🎉 初始化项目

This commit is contained in:
2026-03-03 06:05:51 +08:00
commit e1c70fe218
241 changed files with 148285 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
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"`
}