Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoKey = errorutil.New("OPENAI_API_KEY is not configured / provided.")
ErrNoKey is returned when no key is provided
Functions ¶
func GetUpdateCallback ¶
func GetUpdateCallback() func()
GetUpdateCallback returns a callback function that updates aix
Types ¶
type Options ¶
type Options struct {
OpenaiApiKey string `yaml:"openai_api_key"`
Prompt string `yaml:"prompt"`
Gpt3 bool `yaml:"gpt3"`
Gpt4 bool `yaml:"gpt4"`
Model string `yaml:"model"`
ListModels bool `yaml:"list_models"`
Update bool `yaml:"update"`
DisableUpdateCheck bool `yaml:"disable_update_check"`
Output string `yaml:"output"`
Jsonl bool `yaml:"jsonl"`
Verbose bool `yaml:"verbose"`
Silent bool `yaml:"silent"`
NoColor bool `yaml:"no_color"`
Version bool `yaml:"version"`
Stream bool `yaml:"stream"`
TopP float32 `yaml:"top_p"`
Temperature float32 `yaml:"temperature"`
System goflags.StringSlice `yaml:"system"` // system message if any
NoMarkdown bool `yaml:"no-markdown"` // render markdown message
}
Options contains the configuration options for tuning the enumeration process.
func ParseOptions ¶
func ParseOptions() *Options
ParseOptions parses the command line flags provided by a user
type Result ¶
type Result struct {
Timestamp string `json:"timestamp"`
Prompt string `json:"prompt"`
Completion string `json:"completion"`
Model string `json:"model"`
CompletionStream *io.PipeReader `json:"-"` // contained stream response
Error error `json:"-"`
// contains filtered or unexported fields
}
func (*Result) CloseCompletionStream ¶ added in v0.0.3
func (r *Result) CloseCompletionStream()
CloseCompletionStream closes the completion stream
func (*Result) SetupStreaming ¶ added in v0.0.3
func (r *Result) SetupStreaming()
SetupStreaming sets up the streaming for the result
func (*Result) WriteCompletionStreamResponse ¶ added in v0.0.3
WriteCompletionStreamResponse writes a response to the completion stream
Click to show internal directories.
Click to hide internal directories.