Files
doc_ai_backed/internal/model/formula/request.go
liuyuanchuang 48e63894eb init repo
2025-12-10 18:33:37 +08:00

70 lines
2.0 KiB
Go

package formula
type CreateFormulaRecognitionRequest struct {
FileURL string `json:"file_url" binding:"required"` // oss file url
FileHash string `json:"file_hash" binding:"required"` // file hash
FileName string `json:"file_name" binding:"required"` // file name
TaskType string `json:"task_type" binding:"required,oneof=FORMULA"` // task type
}
type GetRecognitionStatusRequest struct {
TaskNo string `uri:"task_no" binding:"required"`
}
type AIEnhanceRecognitionRequest struct {
TaskNo string `json:"task_no" binding:"required"`
}
type VLFormulaRequest struct {
Model string `json:"model"`
Stream bool `json:"stream"`
MaxTokens int `json:"max_tokens"`
Temperature float64 `json:"temperature"`
TopP float64 `json:"top_p"`
TopK int `json:"top_k"`
N int `json:"n"`
FrequencyPenalty float64 `json:"frequency_penalty"`
Messages []Message `json:"messages"`
}
type Message struct {
Role string `json:"role"`
Content []Content `json:"content"`
}
type Content struct {
Text string `json:"text"`
Type string `json:"type"`
ImageURL Image `json:"image_url"`
}
type Image struct {
Detail string `json:"detail"`
URL string `json:"url"`
}
type VLFormulaResponse 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"`
SystemFingerprint string `json:"system_fingerprint"`
}
type Choice struct {
Index int `json:"index"`
Message struct {
Content string `json:"content"`
Role string `json:"role"`
} `json:"message"`
FinishReason string `json:"finish_reason"`
}
type Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
}