config

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigPath    string        `toml:"-"`
	Key           string        `toml:"key"`
	Endpoint      string        `toml:"endpoint"`
	Version       string        `toml:"version"`
	Model         string        `toml:"model"`
	ModelCost     ModelCost     `toml:"modelCost"`
	Target        string        `toml:"target"`
	Output        string        `toml:"output"`
	State         string        `toml:"state"`
	Ignores       []string      `toml:"ignores"`
	Prompt        string        `toml:"prompt"`
	Type          string        `toml:"type"`
	Collector     StringOrSlice `toml:"collector"`
	Previewer     StringOrSlice `toml:"previewer"`
	Glamour       string        `toml:"glamour"`
	MaxTokens     int           `toml:"max_tokens"`
	Opener        string        `toml:"opener"`
	Sources       []Source      `toml:"sources"`
	TmpReviewPath string        `toml:"-"`
	TmpPromptPath string        `toml:"-"`
}

Config holds the configuration details for the application.

func NewConfig

func NewConfig() Config

NewConfig initializes a new Config instance and populates it with values.

func (*Config) GetSourceFromName added in v0.2.0

func (c *Config) GetSourceFromName(sourceName string) Source

func (*Config) GetSources added in v0.2.0

func (c *Config) GetSources() []Source

func (Config) ToStringArray

func (c Config) ToStringArray() []string

ToStringArray converts the Config struct to a string array.

func (*Config) ToggleSourceEnabled added in v0.2.0

func (c *Config) ToggleSourceEnabled(sourceName string)

type ModelCost added in v0.2.0

type ModelCost struct {
	Input, Output float64
}

ModelCost represents the cost associated with AI model usage.

type Source added in v0.2.0

type Source struct {
	Name      string        `toml:"name"`
	Collector StringOrSlice `toml:"collector"`
	Previewer StringOrSlice `toml:"previewer"`
	Prompt    string        `toml:"prompt"`
	Enabled   bool          `toml:"enabled"`
}

func (Source) Description added in v0.2.0

func (i Source) Description() string

func (Source) FilterValue added in v0.2.0

func (i Source) FilterValue() string

func (Source) String added in v0.2.0

func (i Source) String() string

func (Source) Title added in v0.2.0

func (i Source) Title() string

type StringOrSlice added in v0.2.0

type StringOrSlice []string

StringOrSlice is a custom type that can hold either a string or a slice of strings.

func (*StringOrSlice) UnmarshalTOML added in v0.2.0

func (s *StringOrSlice) UnmarshalTOML(data any) error

UnmarshalTOML decodes either a string or a slice of strings into a StringOrSlice.

func (*StringOrSlice) UnmarshalText added in v0.2.0

func (s *StringOrSlice) UnmarshalText(text []byte) error

UnmarshalText decodes a single string into a StringOrSlice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL