mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-29 22:56:39 +08:00
25 lines
583 B
Go
25 lines
583 B
Go
package types
|
|
|
|
type Usage struct {
|
|
PromptTokens int `json:"prompt_tokens"`
|
|
CompletionTokens int `json:"completion_tokens"`
|
|
TotalTokens int `json:"total_tokens"`
|
|
}
|
|
|
|
type OpenAIError struct {
|
|
Code any `json:"code,omitempty"`
|
|
Message string `json:"message"`
|
|
Param string `json:"param,omitempty"`
|
|
Type string `json:"type"`
|
|
InnerError any `json:"innererror,omitempty"`
|
|
}
|
|
|
|
type OpenAIErrorWithStatusCode struct {
|
|
OpenAIError
|
|
StatusCode int `json:"status_code"`
|
|
}
|
|
|
|
type OpenAIErrorResponse struct {
|
|
Error OpenAIError `json:"error,omitempty"`
|
|
}
|