Documentation
¶
Overview ¶
Package utils contains utility functions for the application.
Index ¶
- func ConfigPath(fileName ...string) string
- func ExpandVariables(s string, variables ...map[string]string) string
- func InitConfig(fileName string) error
- func Or[T any](candidates ...T) T
- func SplitContentAndVariables(args []string) ([]string, map[string]string)
- func UserPrompt(variables map[string]string, args ...string) string
- type AppConf
- type LLM
- type Prompt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath returns the path to the configuration file. It is located in the user's home directory.
func ExpandVariables ¶ added in v0.2.12
func InitConfig ¶
InitConfig initializes the configuration file if it does not exist.
func SplitContentAndVariables ¶ added in v0.2.12
Types ¶
type AppConf ¶
type AppConf struct {
LLM LLM `yaml:"llm" json:"llm"`
LLMs map[string]LLM `yaml:"llms,omitempty" json:"llms,omitempty"`
Prompt *Prompt
}
AppConf defines the application's configuration.
func LoadConfig ¶
LoadConfig loads the configuration from the given file.
func (*AppConf) PickupModel ¶
func (c *AppConf) PickupModel()
PickupModel overrides the default model with the one provided by the user.
type LLM ¶
type LLM struct {
Gateway string `yaml:"gateway,omitempty" json:"gateway,omitempty"`
ApiKey string `yaml:"apiKey,omitempty" json:"apiKey,omitempty"`
Provider string `yaml:"provider" json:"provider"`
Model string `yaml:"model" json:"model"`
ReasonEffort string `yaml:"reasonEffort,omitempty" json:"reasonEffort,omitempty"`
}
LLM defines the configuration for a large language model.
Click to show internal directories.
Click to hide internal directories.