Discover Packages
github.com/nayonacademy/openai-go
client
package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Apr 9, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
const (
MODEL_GPT_DAVINCI string = "text-davinci-003"
MODEL_CODEX_DAVINCI string = "code-davinci-002"
COMPLETIONAPIURL string = "https://api.openai.com/v1/completions"
)
type Choice struct {
Text string `json:"text"`
Index int64 `json:"index"`
Logprobs bool `json:"logprobs"`
FinishReason string `json:"finish_reason"`
}
type Client struct {
BearerToken string `json:"token"`
}
type ClientProperty struct {
Model string `json:"model"`
Prompt string `json:"prompt"`
MaxToken int64 `json:"max_tokens"`
Temperatur int64 `json:"temperature"`
}
type CompletionRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt"`
MaxToken int `json:"max_tokens"`
Temperature float64 `json:"temperature"`
}
type CompletionResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []Choice `json:"choices"`
Use Usage `json:"use"`
}
type Usage struct {
PromptTokens int64 `json:"prompt_token"`
CompletionTokens int64 `json:"completion_token"`
TotalTokens int64 `json:"total_token"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.