package
Version:
v0.0.8
Opens a new window with list of versions in this module.
Published: Nov 25, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type ChatArgs struct {
Model string `json:"model"`
MaxTokens int `json:"max_tokens"`
Messages []Message `json:"messages"`
Temperature float64 `json:"temperature"`
Stream bool `json:"stream,omitempty"`
Stop interface{} `json:"stop"`
}
type ChatCompletionChunk struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
SystemFingerprint string `json:"system_fingerprint"`
Choices []Choice `json:"choices"`
}
Define the data model
type ChatCompletionResponse struct {
Content []map[string]string `json:"content"`
ID string `json:"id"`
Model string `json:"model"`
Role string `json:"role"`
StopReason string `json:"stop_reason"`
StopSequence string `json:"stop_sequence"`
Type string `json:"type"`
Usage map[string]int
}
type ChatError struct {
Type string `json:"type"`
Error struct {
Type string `json:"type"`
Message string `json:"message"`
} `json:"error"`
}
type Choice struct {
Index int `json:"index"`
Delta Delta `json:"delta"`
LogProbs *string `json:"logprobs"`
FinishReason *string `json:"finish_reason"`
}
type ClientChatError struct {
}
ChatError represents a chat-related error.
type Delta struct {
Role string `json:"role"`
Content string `json:"content"`
}
type ErrorResponse struct {
Error struct {
Message string `json:"message"`
Type string `json:"type"`
Code string `json:"code"`
} `json:"error"`
}
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
}
Message is a message in a chat request
Source Files
¶
Click to show internal directories.
Click to hide internal directories.