Discover Packages
within.website/x
web
openai
chatgpt
package
Version:
v1.9.0
Opens a new window with list of versions in this module.
Published: Feb 24, 2024
License: CC0-1.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package chatgpt is a simple binding to the ChatGPT API.
type Choice struct {
Message Message `json:"message"`
FinishReason string `json:"finish_reason"`
Index int `json:"index"`
}
type Funcall struct {
Name string `json:"name"`
Arguments string `json:"arguments"`
}
type Function struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Parameters Param `json:"parameters"`
}
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
FunctionCall *Funcall `json:"function_call,omitempty"`
}
type Param struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
Properties Properties `json:"properties"`
Required []string `json:"required,omitempty"`
}
type Request struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
Functions []Function `json:"functions,omitempty"`
Seed *int `json:"seed,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
}
type Response struct {
ID string `json:"id"`
Object string `json:"object"`
Created int `json:"created"`
Model string `json:"model"`
Usage Usage `json:"usage"`
Choices []Choice `json:"choices"`
}
type Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.