Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCompletionRequest ¶
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
Temperature *float32 `json:"temperature,omitempty"` // Optional field (pointer to float32)
Stream bool `json:"stream"`
}
ChatCompletionRequest Define the request body structure
type ChatCompletionResponse ¶
type ChatCompletionResponse struct {
Choices []Choice `json:"choices"`
}
ChatCompletionResponse represents the entire response structure from OpenAI's chat completion API.
type Choice ¶
type Choice struct {
Delta Delta `json:"delta"`
}
Choice represents an individual choice in the response.
type Data ¶
type Data struct {
Object string `json:"object"`
Embedding []float64 `json:"embedding"` // Embedding is an array of 1536 floats
Index int `json:"index"`
}
Data represents each individual embedding
type Delta ¶
type Delta struct {
Content string `json:"content"`
}
Delta represents the delta object in each choice containing the content.
type EmbeddingRequest ¶
type EmbeddingRequest struct {
Input string `json:"input"` // The input text to be embedded
Model string `json:"model"` // The model used for generating embeddings
EncodingFormat string `json:"encoding_format"` // The encoding format (in this case, "float")
}
EmbeddingRequest represents the request structure for the OpenAI embedding API
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Object string `json:"object"`
Data []Data `json:"data"`
Model string `json:"model"`
Usage UsageInfo `json:"usage"`
}
EmbeddingResponse represents the entire response from the embedding API
type StreamResponse ¶ added in v1.3.4
Click to show internal directories.
Click to hide internal directories.