config

package
v0.0.0-...-9ebf03c Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DataDir           = ""
	CfgFile           = ""
	DbFile            = ""
	LogLevel          = "INFO"
	AnthropicApiKey   = ""
	AnthropicUrl      = "https://api.anthropic.com/"
	AnthropicEndpoint = "v1/messages"
	AnthropicVersion  = "2023-06-01"
	AnthropicBeta     = ""
	MaxTokens         = 2000
	Model             = "claude-3-5-sonnet-20240620"
	Stream            = true
	Temperature       float64 // might should be a string in order to support an empty value?
	TopP              float64 // might should be a string in order to support an empty value?
	TopK              float64 // might should be a string in order to support an empty value?

	DataDirKey           = "data_dir"
	CfgFileKey           = "cfg_file"
	DbFileKey            = "db_file"
	LogLevelKey          = "log_level"
	AnthropicApiKeyKey   = "anthropic_api_key"
	AnthropicUrlKey      = "anthropic_url"
	AnthropicEndpointKey = "anthropic_endpoint"
	AnthropicVersionKey  = "anthropic_version"
	AnthripicBetaKey     = "anthropic_beta"
	MaxTokensKey         = "max_tokens"
	ModelKey             = "model_key"
	StreamKey            = "enableHttpStream"
	TemperatureKey       = "temperature_key"
	TopPKey              = "top_p"
	TopKKey              = "top_k"
)
View Source
var ConfigItems = []ConfigItem{
	{Flag: "stream", ConfigKey: StreamKey, Value: &Stream},
	{Flag: "max-tokens", ConfigKey: MaxTokensKey, Value: &MaxTokens},
	{Flag: "data-dir", ConfigKey: DataDirKey, Value: &DataDir},
	{Flag: "cfg-file", ConfigKey: CfgFileKey, Value: &CfgFile},
	{Flag: "db-file", ConfigKey: DbFileKey, Value: &DbFile},
	{Flag: "log-level", ConfigKey: LogLevelKey, Value: &LogLevel},
	{Flag: "anthropic-url", ConfigKey: AnthropicUrlKey, Value: &AnthropicUrl},
	{Flag: "anthropic-endpoint", ConfigKey: AnthropicEndpointKey, Value: &AnthropicEndpoint},
	{Flag: "anthropic-version", ConfigKey: AnthropicVersionKey, Value: &AnthropicVersion},
	{Flag: "anthropic-beta", ConfigKey: AnthripicBetaKey, Value: &AnthropicBeta},
	{Flag: "max-tokens", ConfigKey: MaxTokensKey, Value: &MaxTokens},
	{Flag: "model", ConfigKey: ModelKey, Value: &Model},
	{Flag: "stream", ConfigKey: StreamKey, Value: &Stream},
	{Flag: "temperature", ConfigKey: TemperatureKey, Value: &Temperature},
	{Flag: "top-p", ConfigKey: TopPKey, Value: &TopP},
	{Flag: "top-k", ConfigKey: TopKKey, Value: &TopK},
}

Functions

func AddFlags

func AddFlags(cmd *cobra.Command)

func GetBool

func GetBool(key string) bool

func GetFloat64

func GetFloat64(key string) float64

func GetInt

func GetInt(key string) int

func GetString

func GetString(key string) string

func InitConfig

func InitConfig()

func ResetToDefaults

func ResetToDefaults()

func UpdateConfig

func UpdateConfig(cmd *cobra.Command)

Types

type ConfigItem

type ConfigItem struct {
	Flag      string
	ConfigKey string
	Value     interface{}
}

Jump to

Keyboard shortcuts

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