init repo
This commit is contained in:
69
internal/model/formula/request.go
Normal file
69
internal/model/formula/request.go
Normal file
@@ -0,0 +1,69 @@
|
||||
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"`
|
||||
}
|
||||
13
internal/model/formula/response.go
Normal file
13
internal/model/formula/response.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package formula
|
||||
|
||||
type CreateTaskResponse struct {
|
||||
TaskNo string `json:"task_no"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type GetFormulaTaskResponse struct {
|
||||
TaskNo string `json:"task_no"`
|
||||
Status int `json:"status"`
|
||||
Count int `json:"count"`
|
||||
Latex string `json:"latex"`
|
||||
}
|
||||
Reference in New Issue
Block a user