Documentation
¶
Overview ¶
Package can provides a system for interacting with api.openai.com/v1
The main purpose of this system is to support a simple command line application (cmd/can). It is Not a generic client for api.openai.com
Index ¶
- type System
- func (s *System) Run() error
- func (s *System) SetAPIKey(v string)
- func (s *System) SetAPIKeyFile(v string)
- func (s *System) SetAPIUrl(v *url.URL)
- func (s *System) SetDebugOutput(v io.Writer)
- func (s *System) SetInput(v string)
- func (s *System) SetSrc(v string)
- func (s *System) SetSysContent(v string)
- func (s *System) SetUpdateSrc(v bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type System ¶
type System struct {
// contains filtered or unexported fields
}
func (*System) Run ¶
Run builds and executes the request according to the system settings. The idea is to call Run once. It is Not safe to call in concurrent goroutines.
func (*System) SetAPIKeyFile ¶
SetAPIKeyFile sets the path to the file containing the API Key. If SetAPIKey is used this has no effect.
func (*System) SetAPIUrl ¶
SetAPIUrl use scheme://hostname[:port], e.g. https://api.openai.com
func (*System) SetDebugOutput ¶
SetDebugOutput writer, use nil to disable
func (*System) SetSysContent ¶
SetSysContent sets the system role content for /v1/chat/completions.
func (*System) SetUpdateSrc ¶
SetUpdateSrc to control if result from /v1/edits should be written back to the src file. Has no effect if the src is not a file.

