llmconfig.go

 1package server
 2
 3import (
 4	"log/slog"
 5
 6	"shelley.exe.dev/db"
 7)
 8
 9// Link represents a custom link to be displayed in the UI
10type Link struct {
11	Title   string `json:"title"`
12	IconSVG string `json:"icon_svg,omitempty"` // SVG path data for the icon
13	URL     string `json:"url"`
14}
15
16// LLMConfig holds all configuration for LLM services
17type LLMConfig struct {
18	// API keys for each provider
19	AnthropicAPIKey string
20	OpenAIAPIKey    string
21	GeminiAPIKey    string
22	FireworksAPIKey string
23
24	// Gateway is the base URL of the LLM gateway (optional)
25	Gateway string
26
27	// TerminalURL is the URL to the terminal interface (optional)
28	TerminalURL string
29
30	// DefaultModel is the default model to use (optional, defaults to models.Default())
31	DefaultModel string
32
33	// Links are custom links to be displayed in the UI (optional)
34	Links []Link
35
36	// DB is the database for recording LLM requests (optional)
37	DB *db.DB
38
39	Logger *slog.Logger
40}