Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfigDirName = "fraga" ConfigFileName = "fraga.json" ConfigFileNameJSONC = "fraga.jsonc" // Default provider URLs DefaultOpenAIBaseURL = "https://api.openai.com/v1" DefaultAnthropicBaseURL = "https://api.anthropic.com" )
Variables ¶
View Source
var ( ErrUnknownProvider = errors.New("unknown provider") ErrConfigExists = errors.New("config already exists") )
Functions ¶
func GetConfigDir ¶
func GetSystemPromptsDir ¶
func GetSystemPromptsDir() string
func InitDefault ¶
func InitDefault() error
InitDefault creates a default config file with helpful comments
func InitSystemPromptsDir ¶
func InitSystemPromptsDir() error
Types ¶
type Config ¶
type Config struct {
Model string `json:"model"`
Provider string `json:"provider"`
Providers map[string]ProviderConfig `json:"providers"`
Settings Settings `json:"settings"`
MCP map[string]MCPServer `json:"mcp,omitempty"`
}
Config holds the complete Fraga configuration
func LoadWithoutValidation ¶
LoadWithoutValidation loads config without requiring provider configuration
type MCPServer ¶
type MCPServer struct {
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
URL string `json:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
}
MCPServer holds configuration for an MCP server Headers are sent with every request when using the Streamable HTTP transport (i.e. when URL is set).
type ProviderConfig ¶
type ProviderConfig struct {
Type string `json:"type"`
APIKey string `json:"api_key,omitempty"`
BaseURL string `json:"base_url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
}
ProviderConfig holds configuration for a single provider. The Type field determines which backend is used: "openai" or "anthropic".
type Settings ¶
type Settings struct {
Temperature *float64 `json:"temperature,omitempty"`
MaxTokens int `json:"max_tokens"`
SystemPrompt string `json:"system_prompt"`
RenderMarkdown *bool `json:"render_markdown,omitempty"`
}
Settings holds application settings
func (Settings) ShouldRenderMarkdown ¶
ShouldRenderMarkdown returns true if markdown rendering should be enabled. It defaults to true when the field is omitted from config.
type SystemPrompt ¶
func GetDefaultSystemPrompt ¶
func GetDefaultSystemPrompt() (SystemPrompt, error)
func LoadSystemPrompt ¶
func LoadSystemPrompt(name string) (SystemPrompt, error)
Click to show internal directories.
Click to hide internal directories.