Documentation
¶
Index ¶
- func PostChatCompletion(messages []ChatCompletionMessage, apiKey string, apiHost string) (string, error)
- func PostTextCompletion(prompt string, apiKey string, apiHost string) (string, error)
- type ChatCompletionChoice
- type ChatCompletionMessage
- type ChatCompletionResponse
- type TextCompletionChoice
- type TextCompletionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostChatCompletion ¶
func PostChatCompletion(messages []ChatCompletionMessage, apiKey string, apiHost string) (string, error)
Types ¶
type ChatCompletionChoice ¶
type ChatCompletionChoice struct {
Message *ChatCompletionMessage `json:"message"`
}
type ChatCompletionMessage ¶
type ChatCompletionResponse ¶
type ChatCompletionResponse struct {
Error any `json:"error"`
Model string `json:"model"`
Choices []ChatCompletionChoice `json:"choices"`
}
type TextCompletionChoice ¶
type TextCompletionChoice struct {
Text string `json:"text"`
}
type TextCompletionResponse ¶
type TextCompletionResponse struct {
Error any `json:"error"`
Model string `json:"model"`
Choices []TextCompletionChoice `json:"choices"`
}
Click to show internal directories.
Click to hide internal directories.