You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
3.1 KiB
99 lines
3.1 KiB
package model
|
|
|
|
type Message struct {
|
|
Role string `json:"role,omitempty"`
|
|
Name string `json:"name,omitempty"`
|
|
Content string `json:"content,omitempty"`
|
|
}
|
|
|
|
type ChatRequest struct {
|
|
Stream bool `json:"stream,omitempty"`
|
|
Model string `json:"model,omitempty"`
|
|
PresencePenalty float64 `json:"presence_penalty,omitempty"`
|
|
Temperature float64 `json:"temperature,omitempty"`
|
|
Messages []Message `json:"messages,omitempty"`
|
|
Prompt string `json:"prompt,omitempty"`
|
|
Input interface{} `json:"input,omitempty"`
|
|
Instruction string `json:"instruction,omitempty"`
|
|
N int `json:"n,omitempty"`
|
|
Functions interface{} `json:"functions,omitempty"`
|
|
}
|
|
|
|
type ImagesRequest struct {
|
|
Prompt string `json:"prompt,omitempty"`
|
|
N int `json:"n,omitempty"`
|
|
Size string `json:"size,omitempty"`
|
|
}
|
|
|
|
type ChatResponse struct {
|
|
Id string `json:"id,omitempty"`
|
|
Object string `json:"object,omitempty"`
|
|
Created int64 `json:"created,omitempty"`
|
|
Model string `json:"model,omitempty"`
|
|
Usage Usage `json:"usage,omitempty"`
|
|
Choices []Choice `json:"choices,omitempty"`
|
|
}
|
|
type ImagesResponse struct {
|
|
Created int64 `json:"created,omitempty"`
|
|
Data []ImagesData `json:"data,omitempty"`
|
|
}
|
|
|
|
type ImagesData struct {
|
|
Url string `json:"url,omitempty"`
|
|
}
|
|
|
|
type Usage struct {
|
|
PromptTokens int `json:"prompt_tokens,omitempty"`
|
|
CompletionTokens int `json:"completion_tokens,omitempty"`
|
|
TotalTokens int `json:"total_tokens,omitempty"`
|
|
}
|
|
|
|
type Choice struct {
|
|
Message Message `json:"message,omitempty"`
|
|
Delta Delta `json:"delta,omitempty"`
|
|
FinishReason string `json:"finish_reason,omitempty"`
|
|
Index int `json:"index,omitempty"`
|
|
Text string `json:"text,omitempty"`
|
|
}
|
|
|
|
type Delta struct {
|
|
Content string `json:"content,omitempty"`
|
|
}
|
|
|
|
type CreditSummary struct {
|
|
Object string `json:"object"`
|
|
TotalGranted float64 `json:"total_granted"`
|
|
TotalUsed float64 `json:"total_used"`
|
|
TotalRemaining float64 `json:"total_remaining"`
|
|
}
|
|
|
|
type ListModelResponse struct {
|
|
Object string `json:"object"`
|
|
Data []Model `json:"data"`
|
|
}
|
|
|
|
type Model struct {
|
|
ID string `json:"id"`
|
|
Object string `json:"object"`
|
|
Created int `json:"created"`
|
|
OwnedBy string `json:"owned_by"`
|
|
Permission []ModelPermission `json:"permission"`
|
|
Root string `json:"root"`
|
|
Parent any `json:"parent"`
|
|
}
|
|
|
|
type ModelPermission struct {
|
|
ID string `json:"id"`
|
|
Object string `json:"object"`
|
|
Created int `json:"created"`
|
|
AllowCreateEngine bool `json:"allow_create_engine"`
|
|
AllowSampling bool `json:"allow_sampling"`
|
|
AllowLogprobs bool `json:"allow_logprobs"`
|
|
AllowSearchIndices bool `json:"allow_search_indices"`
|
|
AllowView bool `json:"allow_view"`
|
|
AllowFineTuning bool `json:"allow_fine_tuning"`
|
|
Organization string `json:"organization"`
|
|
Group any `json:"group"`
|
|
IsBlocking bool `json:"is_blocking"`
|
|
}
|