config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearConfig added in v0.3.0

func ClearConfig() error

func NewFromConfigFile added in v0.3.0

func NewFromConfigFile() (openai.ClientConfig, error)

func SanitizeInput added in v0.3.0

func SanitizeInput(input string) string

SanitizeInput trims whitespaces and newlines from a string.

func SaveConfig added in v0.3.0

func SaveConfig(config *Config) error

SaveConfig writes the configuration to disk, and the API key to the keyring.

func ValidateConfig added in v0.3.0

func ValidateConfig(c *Config) error

ValidateConfig checks if a Config object has valid data.

Types

type Config added in v0.3.0

type Config struct {
	Endpoint        string `json:"endpoint"`
	ApiVersion      string `json:"apiVersion"`
	ModelDeployment string `json:"modelDeployment"`
	// contains filtered or unexported fields
}

func LoadConfig added in v0.3.0

func LoadConfig() (*Config, error)

LoadConfig reads the configuration from disk and loads the API key from the keyring.

func NewConfig added in v0.3.0

func NewConfig(endpoint, apiVersion, modelDeployment string) *Config

NewConfig creates a new Config object

func (*Config) APIKey added in v0.3.0

func (c *Config) APIKey() string

APIKey returns the confidential field apiKey

func (*Config) SetAPIKey added in v0.3.0

func (c *Config) SetAPIKey(apiKey string)

SetAPIKey sets the confidential field apiKey

Jump to

Keyboard shortcuts

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