mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-19 00:46:37 +08:00
87 lines
2.4 KiB
Go
87 lines
2.4 KiB
Go
package dto
|
|
|
|
type TextResponse struct {
|
|
Choices []OpenAITextResponseChoice `json:"choices"`
|
|
Usage `json:"usage"`
|
|
Error OpenAIError `json:"error"`
|
|
}
|
|
|
|
type OpenAITextResponseChoice struct {
|
|
Index int `json:"index"`
|
|
Message `json:"message"`
|
|
FinishReason string `json:"finish_reason"`
|
|
}
|
|
|
|
type OpenAITextResponse struct {
|
|
Id string `json:"id"`
|
|
Object string `json:"object"`
|
|
Created int64 `json:"created"`
|
|
Choices []OpenAITextResponseChoice `json:"choices"`
|
|
Usage `json:"usage"`
|
|
}
|
|
|
|
type OpenAIEmbeddingResponseItem struct {
|
|
Object string `json:"object"`
|
|
Index int `json:"index"`
|
|
Embedding []float64 `json:"embedding"`
|
|
}
|
|
|
|
type OpenAIEmbeddingResponse struct {
|
|
Object string `json:"object"`
|
|
Data []OpenAIEmbeddingResponseItem `json:"data"`
|
|
Model string `json:"model"`
|
|
Usage `json:"usage"`
|
|
}
|
|
|
|
type ImageResponse struct {
|
|
Created int `json:"created"`
|
|
Data []struct {
|
|
Url string `json:"url"`
|
|
B64Json string `json:"b64_json"`
|
|
}
|
|
}
|
|
|
|
type ChatCompletionsStreamResponseChoice struct {
|
|
Delta struct {
|
|
Content string `json:"content"`
|
|
} `json:"delta"`
|
|
FinishReason *string `json:"finish_reason,omitempty"`
|
|
}
|
|
|
|
type ChatCompletionsStreamResponse struct {
|
|
Id string `json:"id"`
|
|
Object string `json:"object"`
|
|
Created int64 `json:"created"`
|
|
Model string `json:"model"`
|
|
Choices []ChatCompletionsStreamResponseChoice `json:"choices"`
|
|
}
|
|
|
|
type ChatCompletionsStreamResponseSimple struct {
|
|
Choices []ChatCompletionsStreamResponseChoice `json:"choices"`
|
|
}
|
|
|
|
type CompletionsStreamResponse struct {
|
|
Choices []struct {
|
|
Text string `json:"text"`
|
|
FinishReason string `json:"finish_reason"`
|
|
} `json:"choices"`
|
|
}
|
|
|
|
type MidjourneyRequest struct {
|
|
Prompt string `json:"prompt"`
|
|
NotifyHook string `json:"notifyHook"`
|
|
Action string `json:"action"`
|
|
Index int `json:"index"`
|
|
State string `json:"state"`
|
|
TaskId string `json:"taskId"`
|
|
Base64Array []string `json:"base64Array"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type MidjourneyResponse struct {
|
|
Code int `json:"code"`
|
|
Description string `json:"description"`
|
|
Properties interface{} `json:"properties"`
|
|
Result string `json:"result"`
|
|
}
|