Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatResponse ¶
ChatResponse represents the LLM response including potential tool calls.
type Config ¶
type Config struct {
Embedding EmbeddingConfig
Reranker RerankerConfig
IntentClassifier IntentClassifierConfig
LLM LLMConfig
Enabled bool
}
Config represents AI configuration.
func NewConfigFromProfile ¶
NewConfigFromProfile creates AI config from profile.
type EmbeddingConfig ¶
type EmbeddingConfig struct {
Provider string
Model string
APIKey string
BaseURL string
Dimensions int
}
EmbeddingConfig represents vector embedding configuration.
type EmbeddingService ¶
type EmbeddingService interface {
// Embed generates vector for a single text.
Embed(ctx context.Context, text string) ([]float32, error)
// EmbedBatch generates vectors for multiple texts.
EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)
// Dimensions returns the vector dimension.
Dimensions() int
}
EmbeddingService is the vector embedding service interface.
func NewEmbeddingService ¶
func NewEmbeddingService(cfg *EmbeddingConfig) (EmbeddingService, error)
NewEmbeddingService creates a new EmbeddingService.
type FunctionCall ¶
FunctionCall represents the function details.
type IntentClassifierConfig ¶
IntentClassifierConfig represents intent classification LLM configuration. Uses a lightweight model for fast, cost-effective classification.
type LLMConfig ¶
type LLMConfig struct {
Provider string // deepseek, openai, ollama
Model string // deepseek-chat
APIKey string
BaseURL string
MaxTokens int // default: 2048
Temperature float32 // default: 0.7
}
LLMConfig represents LLM configuration.
type LLMService ¶
type LLMService interface {
// Chat performs synchronous chat.
Chat(ctx context.Context, messages []Message) (string, error)
// ChatStream performs streaming chat.
ChatStream(ctx context.Context, messages []Message) (<-chan string, <-chan error)
// ChatWithTools performs chat with function calling support.
ChatWithTools(ctx context.Context, messages []Message, tools []ToolDescriptor) (*ChatResponse, error)
}
LLMService is the LLM service interface.
func NewLLMService ¶
func NewLLMService(cfg *LLMConfig) (LLMService, error)
NewLLMService creates a new LLMService.
type Message ¶
Message represents a chat message.
func AssistantMessage ¶
Helper for creating assistant messages.
func FormatMessages ¶
FormatMessages formats messages for prompt templates.
type RerankResult ¶
RerankResult represents a reranking result.
type RerankerConfig ¶
type RerankerConfig struct {
Provider string
Model string
APIKey string
BaseURL string
Enabled bool
}
RerankerConfig represents reranker configuration.
type RerankerService ¶
type RerankerService interface {
// Rerank reorders documents by relevance.
Rerank(ctx context.Context, query string, documents []string, topN int) ([]RerankResult, error)
// IsEnabled returns whether the service is enabled.
IsEnabled() bool
}
RerankerService is the reranking service interface.
func NewRerankerService ¶
func NewRerankerService(cfg *RerankerConfig) RerankerService
NewRerankerService creates a new RerankerService.
type ToolCall ¶
type ToolCall struct {
ID string
Type string
Function FunctionCall
}
ToolCall represents a request to call a tool.
type ToolDescriptor ¶
type ToolDescriptor struct {
Name string
Description string
Parameters string // JSON Schema string
}
ToolDescriptor represents a function/tool available to the LLM.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent provides conversation context management for multi-turn dialogues.
|
Package agent provides conversation context management for multi-turn dialogues. |
|
tools
Package tools provides resilient tool execution for AI agents.
|
Package tools provides resilient tool execution for AI agents. |
|
Package aitime provides the time parsing service interface for AI agents.
|
Package aitime provides the time parsing service interface for AI agents. |
|
Package cache provides the cache service interface for AI agents.
|
Package cache provides the cache service interface for AI agents. |
|
Package context provides context building for LLM prompts.
|
Package context provides context building for LLM prompts. |
|
core
|
|
|
Package duplicate provides memo duplicate detection for P2-C002.
|
Package duplicate provides memo duplicate detection for P2-C002. |
|
Package genui provides Generative UI components for AI agents.
|
Package genui provides Generative UI components for AI agents. |
|
Package graph - builder implementation for P3-C001.
|
Package graph - builder implementation for P3-C001. |
|
Package habit provides user habit learning and analysis for AI agents.
|
Package habit provides user habit learning and analysis for AI agents. |
|
Package memory provides the unified memory service interface for AI agents.
|
Package memory provides the unified memory service interface for AI agents. |
|
Package metrics provides the evaluation metrics service interface for AI agents.
|
Package metrics provides the evaluation metrics service interface for AI agents. |
|
Package prediction provides predictive interaction capabilities for AI agents.
|
Package prediction provides predictive interaction capabilities for AI agents. |
|
Package rag provides Self-RAG optimization.
|
Package rag provides Self-RAG optimization. |
|
Package reminder provides reminder management for schedules and todos.
|
Package reminder provides reminder management for schedules and todos. |
|
Package review provides intelligent memo review system based on spaced repetition.
|
Package review provides intelligent memo review system based on spaced repetition. |
|
Package router provides the LLM routing service.
|
Package router provides the LLM routing service. |
|
Package schedule provides schedule-related AI agent utilities.
|
Package schedule provides schedule-related AI agent utilities. |
|
Package session provides the session persistence service interface for AI agents.
|
Package session provides the session persistence service interface for AI agents. |
|
Package stats provides cost alerting for agent sessions.
|
Package stats provides cost alerting for agent sessions. |
|
Package tags provides intelligent tag suggestion for memos.
|
Package tags provides intelligent tag suggestion for memos. |
|
Package timeout defines centralized timeout constants for AI operations.
|
Package timeout defines centralized timeout constants for AI operations. |
|
Package vector provides the vector retrieval service interface for AI agents.
|
Package vector provides the vector retrieval service interface for AI agents. |