util

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrompt

func GetPrompt(userPrompt string) (string, error)

func GetSystemPrompt

func GetSystemPrompt() (string, error)

func IsSupportedProvider added in v0.0.2

func IsSupportedProvider(provider string) bool

func SetDefaultProvider added in v0.0.2

func SetDefaultProvider(provider string) error

Types

type Config

type Config struct {
	DefaultProvider string               `toml:"default-provider"`
	LLMProvider     map[string]LLMConfig `toml:"llm-provider"`
}

Config represents the top-level configuration structure

func GetConfig

func GetConfig() (*Config, error)

func ParseConfig

func ParseConfig(filePath string) (*Config, error)

ParseConfig reads and parses the TOML configuration file

type LLMConfig

type LLMConfig struct {
	BaseURL string `toml:"base_url"`
	Model   string `toml:"model"`
	ApiKey  string `toml:"api_key"`
}

LLMConfig represents the configuration for an LLM provider

type SysInfo

type SysInfo struct {
	OS     string
	OSName string
	Arch   string
}

func GetSysInfo

func GetSysInfo() (*SysInfo, error)

Jump to

Keyboard shortcuts

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