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"`
System string `json:"system"`
Messages []Message `json:"messages"`
Temperature float64 `json:"temperature"`
Stream bool `json:"stream,omitempty"`
StopSequences interface{} `json:"stop_sequences"`
}
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 ClientChatError struct {
}
ChatError represents a chat-related error.
type ContentBlockDelta struct {
Type string `json:"type"`
Index int `json:"index"`
Delta map[string]string `json:"delta"`
}
type ContentBlockStop struct {
Type string `json:"type"`
Index int `json:"index"`
}
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
type StreamedResponse struct {
Data string `json:"data"`
}
type Usage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.