🎉 初始化项目
This commit is contained in:
16
server/model/app/response/ai_preset_binding.go
Normal file
16
server/model/app/response/ai_preset_binding.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package response
|
||||
|
||||
import "time"
|
||||
|
||||
// BindingInfo 绑定信息
|
||||
type BindingInfo struct {
|
||||
ID uint `json:"id"`
|
||||
PresetID uint `json:"presetId"`
|
||||
PresetName string `json:"presetName"`
|
||||
ProviderID uint `json:"providerId"`
|
||||
ProviderName string `json:"providerName"`
|
||||
Priority int `json:"priority"`
|
||||
IsActive bool `json:"isActive"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
15
server/model/app/response/ai_provider_extra.go
Normal file
15
server/model/app/response/ai_provider_extra.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package response
|
||||
|
||||
// ModelInfo 模型信息
|
||||
type ModelInfo struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
OwnedBy string `json:"ownedBy"`
|
||||
}
|
||||
|
||||
// TestConnectionResponse 测试连接响应
|
||||
type TestConnectionResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
Latency int64 `json:"latency"` // 延迟(毫秒)
|
||||
}
|
||||
38
server/model/app/response/ai_proxy.go
Normal file
38
server/model/app/response/ai_proxy.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package response
|
||||
|
||||
// ChatCompletionResponse OpenAI兼容的聊天补全响应
|
||||
type ChatCompletionResponse struct {
|
||||
ID string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
Created int64 `json:"created"`
|
||||
Model string `json:"model"`
|
||||
Choices []Choice `json:"choices"`
|
||||
Usage Usage `json:"usage"`
|
||||
}
|
||||
|
||||
// Choice 选择项
|
||||
type Choice struct {
|
||||
Index int `json:"index"`
|
||||
Message Message `json:"message"`
|
||||
FinishReason string `json:"finish_reason"`
|
||||
}
|
||||
|
||||
// Message 消息
|
||||
type Message struct {
|
||||
Role string `json:"role"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// Usage Token使用情况
|
||||
type Usage struct {
|
||||
PromptTokens int `json:"prompt_tokens"`
|
||||
CompletionTokens int `json:"completion_tokens"`
|
||||
TotalTokens int `json:"total_tokens"`
|
||||
}
|
||||
|
||||
// StreamChunk 流式响应块
|
||||
type StreamChunk struct {
|
||||
Content string `json:"content"`
|
||||
Done bool `json:"done"`
|
||||
Error error `json:"error,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user