2026-03-13 20:43:44 +08:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
// APIRequest API请求结构
|
|
|
|
|
type APIRequest struct {
|
2026-03-16 13:15:56 +08:00
|
|
|
Model string `json:"model"`
|
|
|
|
|
Messages []Message `json:"messages"`
|
|
|
|
|
MaxTokens int `json:"max_tokens"`
|
|
|
|
|
EnableThinking *bool `json:"enable_thinking,omitempty"`
|
|
|
|
|
ThinkingBudget *int `json:"thinking_budget,omitempty"`
|
2026-03-13 20:43:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Message 消息结构
|
|
|
|
|
type Message struct {
|
|
|
|
|
Role string `json:"role"`
|
|
|
|
|
Content interface{} `json:"content"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ContentItem 内容项
|
|
|
|
|
type ContentItem struct {
|
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
|
ImageURL *ImageURL `json:"image_url,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ImageURL 图片URL
|
|
|
|
|
type ImageURL struct {
|
|
|
|
|
URL string `json:"url"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// APIResponse API响应结构
|
|
|
|
|
type APIResponse struct {
|
|
|
|
|
Choices []Choice `json:"choices"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Choice 选择
|
|
|
|
|
type Choice struct {
|
|
|
|
|
Message Message `json:"message"`
|
|
|
|
|
}
|