Documentation
¶
Overview ¶
Package options print a list of global command-line options (applies to all commands).
Index ¶
- Constants
- func AddBasicFlags(flags *pflag.FlagSet, cfg *Config)
- func NewCmdOptions(out io.Writer) *cobra.Command
- func WriteConfigFile(path string) error
- type API
- type APIs
- type Aideprecated
- type AutoCoder
- type Config
- type DataStore
- type DataStoreFlags
- type FormatText
- type Model
- type ModelFlags
- type OutputFormat
Constants ¶
const ( FlagDatastoreType = "datastore.type" FlagDatastoreUrl = "datastore.url" FlagDatastorePath = "datastore.path" FlagDatastoreUsername = "datastore.username" FlagDatastorePassword = "datastore.password" )
const ( FlagDefaultSystemPrompt = "system-prompt" FlagAiModel = "model" FlagAiToken = "token" FlagAiApiBase = "api-base" FlagAiTemperature = "temperature" FlagAiTopP = "top-p" FlagAiMaxTokens = "max-tokens" FlagOutputFormat = "output-format" FlagMultiContentEnabled = "multi-content-enabled" )
const (
FlagLogFlushFrequency = "log-flush-frequency"
)
const (
// RecommendedEnvPrefix defines the ENV prefix used by all iam service.
RecommendedEnvPrefix = "AI_"
)
Variables ¶
This section is empty.
Functions ¶
func AddBasicFlags ¶
AddBasicFlags binds client configuration flags to a given flagset.
func NewCmdOptions ¶
NewCmdOptions implements the options command.
func WriteConfigFile ¶
Types ¶
type API ¶
type API struct { Name string APIKey string `yaml:"api-key"` APIKeyEnv string `yaml:"api-key-env"` APIKeyCmd string `yaml:"api-key-cmd"` Version string `yaml:"version"` BaseURL string `yaml:"base-url"` Models map[string]Model `yaml:"models"` User string `yaml:"user"` }
API represents an API endpoint and its models.
type APIs ¶
type APIs []API
APIs is a type alias to allow custom YAML decoding.
func (*APIs) UnmarshalYAML ¶
UnmarshalYAML implements sorted API YAML decoding.
type Ai
deprecated
type Ai struct { SystemPrompt string `yaml:"system-prompt,omitempty"` Token string `yaml:"token,omitempty"` Model string `yaml:"model,omitempty"` ApiBase string `yaml:"api-base,omitempty"` Temperature float64 `yaml:"temperature,omitempty"` TopP float64 `yaml:"top-p,omitempty"` MaxTokens int `yaml:"max-tokens,omitempty"` Proxy string `yaml:"proxy,omitempty"` OutputFormat OutputFormat `yaml:"output-format,omitempty"` MultiContentEnabled bool `yaml:"multi-content-enabled,omitempty"` }
Deprecated: Use Model instead.
type AutoCoder ¶ added in v0.12.0
type AutoCoder struct { PromptPrefix string `yaml:"prompt-prefix" env:"PROMPT_PREFIX"` EditFormat string `yaml:"edit-format" env:"EDIT_FORMAT"` CommitPrefix string `yaml:"commit-prefix" env:"COMMIT_PREFIX"` }
AutoCoder is the configuration for the auto coder.
type Config ¶
type Config struct { Model string `yaml:"default-model" env:"MODEL"` API string `yaml:"default-api" env:"API"` Raw bool `yaml:"raw" env:"RAW"` Quiet bool `yaml:"quiet" env:"QUIET"` MaxTokens int `yaml:"max-tokens" env:"MAX_TOKENS"` MaxInputChars int `yaml:"max-input-chars" env:"MAX_INPUT_CHARS"` Temperature float64 `yaml:"temp" env:"TEMP"` Stop []string `yaml:"stop" env:"STOP"` TopP float64 `yaml:"topp" env:"TOPP"` TopK int `yaml:"topk" env:"TOPK"` NoLimit bool `yaml:"no-limit" env:"NO_LIMIT"` NoCache bool `yaml:"no-cache" env:"NO_CACHE"` MaxRetries int `yaml:"max-retries" env:"MAX_RETRIES"` WordWrap int `yaml:"word-wrap" env:"WORD_WRAP"` Fanciness uint `yaml:"fanciness" env:"FANCINESS"` LoadingText string `yaml:"loading-text" env:"LOADING_TEXT"` FormatText FormatText `yaml:"format-text"` FormatAs string `yaml:"format-as" env:"FORMAT_AS"` APIs APIs `yaml:"apis"` DataStore DataStore `yaml:"datastore"` AutoCoder AutoCoder `yaml:"auto-coder"` DefaultPromptMode string `yaml:"default-prompt-mode,omitempty"` ChatID string `yaml:"chat-id,omitempty"` Ai Ai `yaml:"ai"` Models map[string]Model SettingsPath string System *system.Analysis Interactive bool PromptFile string }
Config is a structure used to configure a AI. Its members are sorted roughly in order of importance for composers.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config struct with the default values.
func EnsureConfig ¶
type DataStoreFlags ¶
type DataStoreFlags struct { Type *string Url *string Path *string Username *string Password *string }
func NewDatastoreFlags ¶
func NewDatastoreFlags(dsType string) *DataStoreFlags
NewDatastoreFlags returns DataStoreFlags with default values set.
func (*DataStoreFlags) AddFlags ¶
func (d *DataStoreFlags) AddFlags(flags *pflag.FlagSet)
AddFlags binds client configuration flags to a given cmd.
func (*DataStoreFlags) Validate ¶
func (d *DataStoreFlags) Validate() error
type FormatText ¶
FormatText is a map[format]formatting_text.
func (*FormatText) UnmarshalYAML ¶
func (ft *FormatText) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML conforms with yaml.Unmarshaler.
type Model ¶
type Model struct { Name string API string MaxChars int `yaml:"max-input-chars"` Aliases []string `yaml:"aliases"` Fallback string `yaml:"fallback"` }
Model represents the LLM model used in the API call.
type ModelFlags ¶
type ModelFlags struct { Token *string Model *string ApiBase *string Temperature *float64 TopP *float64 MaxTokens *int Proxy *string OutputFormat *string MultiContentEnabled *bool }
func NewModelFlags ¶
func NewModelFlags() *ModelFlags
NewModelFlags returns ModelFlags with default values set.
func (*ModelFlags) AddFlags ¶
func (m *ModelFlags) AddFlags(flags *pflag.FlagSet)
AddFlags binds client configuration flags to a given flagset.
func (*ModelFlags) Validate ¶
func (m *ModelFlags) Validate() error
type OutputFormat ¶
type OutputFormat string
const ( RawOutputFormat OutputFormat = "raw" MarkdownOutputFormat OutputFormat = "markdown" )