Documentation
¶
Index ¶
- Variables
- func ChunkText(text string, size, overlap int) ([]string, error)
- func GenerateDefault() string
- func ListFiles(dir string, predicate func(string) bool) ([]string, error)
- func NewCmdChat(defaults *DefaultRAGOptions) *cobra.Command
- func NewCmdConfig(defaults *DefaultRAGOptions) *cobra.Command
- func NewCmdListModels(defaults *DefaultRAGOptions) *cobra.Command
- func NewCmdQuery(defaults *DefaultRAGOptions) *cobra.Command
- func NewConfigOptions(stdio *genericclioptions.StdioOptions) *configOptions
- func NewDefaultRAGCommand(iostreams *genericclioptions.IOStreams, args []string) *cobra.Command
- type ChatOptions
- type Config
- type ConfigError
- type DefaultRAGOptions
- type Duration
- type EnvConfig
- type Flags
- type ListModelsOptions
- type QueryOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidChunkSize = errors.New("size must be > 0") ErrInvalidChunkOverlap = errors.New("overlap must satisfy 0 <= overlap < size") )
var ( ErrMissingQuery = errors.New("missing required --query flag") ErrMissingLLMModel = errors.New("missing LLM model") ErrMissingEmbeddingModel = errors.New("missing embedding model") ErrMissingDimension = errors.New("missing or invalid embedding dimension") ErrInvalidSelectedModel = errors.New("selected model not found in available models") ErrNoEmbedInput = errors.New("no input provided for embedding") ErrConflictingEmbedInputs = errors.New("cannot embed from both piped input and file arguments") )
var ErrInvalidModel = errors.New("invalid model selected")
var Version = "0.0.0"
Functions ¶
func GenerateDefault ¶
func GenerateDefault() string
GenerateDefault returns a TOML string with default values and comments.
func ListFiles ¶
ListFiles returns all files under dir recursively. If predicate is nil, all files are returned.
func NewCmdChat ¶
func NewCmdChat(defaults *DefaultRAGOptions) *cobra.Command
NewCmdChat creates the <cmd> cobra command.
func NewCmdConfig ¶
func NewCmdConfig(defaults *DefaultRAGOptions) *cobra.Command
NewCmdConfig creates the cobra config command tree.
func NewCmdListModels ¶
func NewCmdListModels(defaults *DefaultRAGOptions) *cobra.Command
NewCmdListModels creates the ListModels cobra command.
func NewCmdQuery ¶
func NewCmdQuery(defaults *DefaultRAGOptions) *cobra.Command
NewCmdQuery creates the <cmd> cobra command.
func NewConfigOptions ¶
func NewConfigOptions(stdio *genericclioptions.StdioOptions) *configOptions
NewConfigOptions initializes ConfigOptions with default values.
func NewDefaultRAGCommand ¶
func NewDefaultRAGCommand(iostreams *genericclioptions.IOStreams, args []string) *cobra.Command
NewDefaultRAGCommand creates the root cobra command.
Types ¶
type ChatOptions ¶
type ChatOptions struct {
*genericclioptions.StdioOptions
// contains filtered or unexported fields
}
func NewChatOptions ¶
func NewChatOptions(stdio *genericclioptions.StdioOptions, llmOptions *llmOptions) *ChatOptions
NewChatOptions initializes the options struct.
func (*ChatOptions) Complete ¶
func (*ChatOptions) Complete() error
func (*ChatOptions) Validate ¶
func (*ChatOptions) Validate() error
type Config ¶
type Config struct {
LLM types.LLMConfig `json:"llm" toml:"llm"`
Prompt *types.PromptConfig `json:"prompt,omitempty" toml:"prompt,omitempty"`
Embedding *types.EmbeddingConfig `json:"embedding,omitempty" toml:"embedding,omitempty"`
Logging *types.LoggingConfig `json:"logging,omitempty" toml:"logging,commented"`
// contains filtered or unexported fields
}
func LoadFileConfig ¶
LoadFileConfig loads the config from the given or default path.
func (*Config) ConfigPath ¶
type ConfigError ¶
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
func (*ConfigError) Unwrap ¶
func (e *ConfigError) Unwrap() error
type DefaultRAGOptions ¶
type DefaultRAGOptions struct {
*genericclioptions.StdioOptions
// contains filtered or unexported fields
}
DefaultRAGOptions is the base cli config shared across all ragx subcommands.
func NewDefaultRAGOptions ¶
func NewDefaultRAGOptions(iostreams *genericclioptions.IOStreams) *DefaultRAGOptions
NewDefaultRAGOptions initializes the options struct.
func (*DefaultRAGOptions) Complete ¶
func (o *DefaultRAGOptions) Complete() error
func (*DefaultRAGOptions) Run ¶
func (o *DefaultRAGOptions) Run(ctx context.Context, args ...string) error
func (*DefaultRAGOptions) Validate ¶
func (o *DefaultRAGOptions) Validate() error
type Duration ¶
func (Duration) MarshalJSON ¶
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
Flags holds cli overrides for configuration.
type ListModelsOptions ¶
type ListModelsOptions struct {
*genericclioptions.StdioOptions
// contains filtered or unexported fields
}
func NewListModelsOptions ¶
func NewListModelsOptions(stdio *genericclioptions.StdioOptions, llmOptions *llmOptions) *ListModelsOptions
NewListModelsOptions initializes the options struct.
func (*ListModelsOptions) Complete ¶
func (*ListModelsOptions) Complete() error
func (*ListModelsOptions) Run ¶
func (o *ListModelsOptions) Run(_ context.Context, _ ...string) error
func (*ListModelsOptions) Validate ¶
func (*ListModelsOptions) Validate() error
type QueryOptions ¶
type QueryOptions struct {
*genericclioptions.StdioOptions
// contains filtered or unexported fields
}
func NewQueryOptions ¶
func NewQueryOptions(stdio *genericclioptions.StdioOptions, llmOptions *llmOptions) *QueryOptions
NewQueryOptions initializes the options struct.
func (*QueryOptions) Complete ¶
func (*QueryOptions) Complete() error
func (*QueryOptions) Validate ¶
func (*QueryOptions) Validate() error