Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Brain ¶
type Brain interface {
// Chat generates a plain text response for a given prompt.
// Best used for simple questions, greetings, or summarization.
Chat(ctx context.Context, prompt string) (string, error)
// Analyze performs structured analysis and returns the result in the target struct.
// The target must be a pointer to a struct that can be unmarshaled from JSON.
// Useful for intent routing, safety checks, and complex data extraction.
Analyze(ctx context.Context, prompt string, target any) error
}
Brain represents the core "System 1" intelligence for HotPlex. It provides fast, structured, and low-cost reasoning capabilities.
type Config ¶
type Config struct {
// Enabled is automatically determined based on APIKey presence.
Enabled bool
// Provider supports "openai" (default), "anthropic", "gemini".
Provider string
// APIKey is the secret for accessing the provider API.
APIKey string
// Endpoint is the optional base URL for the API (e.g. for DeepSeek/Groq).
Endpoint string
// Model is the specific model to use (default: gpt-4o-mini).
Model string
// Timeout is the maximum duration for a brain request.
// Defaults to 10 seconds for standard requests.
TimeoutS int
}
Config holds the configuration for the Global Brain.
func LoadConfigFromEnv ¶
func LoadConfigFromEnv() Config
LoadConfigFromEnv loads the brain configuration from environment variables.
Click to show internal directories.
Click to hide internal directories.