Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶ added in v1.0.2
type Content struct {
Id string `json:"id,omitempty"`
Type string `json:"type,width:4"`
Text string `json:"text,omitempty,wrap,width:60"`
Source *contentSource `json:"source,omitempty"`
// contains filtered or unexported fields
}
Message Content
type Embeddings ¶
type Embeddings struct {
Id string `json:"id"`
Data []Embedding `json:"data"`
Model string `json:"model"`
Usage struct {
PromptTokerns int `json:"prompt_tokens"`
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}
An set of created embeddings
type Message ¶
type Message struct {
// user or assistant
Role string `json:"role"`
// Message Id
Id string `json:"id,omitempty"`
// Model
Model string `json:"model,omitempty"`
// Content can be a string, array of strings, content
// object or an array of content objects
Content any `json:"content,omitempty"`
}
A chat completion message
func NewMessage ¶ added in v1.0.2
Create a new message, with optional content
type MessageChoice ¶
type MessageChoice struct {
Message `json:"message"`
Index int `json:"index"`
FinishReason string `json:"finish_reason"`
}
One choice of chat completion messages
type Model ¶
type Model struct {
Id string `json:"id"`
Created int64 `json:"created,omitempty"`
Owner string `json:"owned_by,omitempty"`
}
A model object
Click to show internal directories.
Click to hide internal directories.