Documentation
¶
Index ¶
- type BehaviorProfile
- type Config
- type DialecticModel
- type Insights
- type InteractionSummary
- type Manager
- func (m *Manager) CreateProfile(userID, name string) *UserProfile
- func (m *Manager) DeleteProfile(userID string) error
- func (m *Manager) ExportProfile(userID string) ([]byte, error)
- func (m *Manager) GenerateInsights(userID string) *Insights
- func (m *Manager) GetCurrentProfile() *UserProfile
- func (m *Manager) GetProfile(userID string) *UserProfile
- func (m *Manager) GetPromptContext(userID string) string
- func (m *Manager) ImportProfile(data []byte) error
- func (m *Manager) ListProfiles() []*UserProfile
- func (m *Manager) LoadProfile(userID string) error
- func (m *Manager) RecordInteraction(userID string, interaction *InteractionSummary) error
- func (m *Manager) SaveProfile(userID string) error
- func (m *Manager) SetCurrentUser(userID string)
- func (m *Manager) UpdatePreference(userID string, pref string, value interface{}) error
- type PreferenceProfile
- type UserProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BehaviorProfile ¶
type BehaviorProfile struct {
SessionCount int `json:"session_count"`
AvgSessionLength int `json:"avg_session_length"` // minutes
ActiveHours []int `json:"active_hours"` // 0-23
ActiveDays []int `json:"active_days"` // 0-6 (Sunday=0)
CommonTasks map[string]int `json:"common_tasks"` // task -> count
SuccessRate float64 `json:"success_rate"` // task success rate
LastInteraction int64 `json:"last_interaction"`
Patterns []string `json:"behavioral_patterns"`
}
BehaviorProfile tracks user behavior patterns
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled"`
AutoLearn bool `yaml:"auto_learn"` // Learn from interactions
ProfilePath string `yaml:"profile_path"` // Custom profile location
SaveInterval int `yaml:"save_interval"` // Seconds between auto-saves
MinInteractions int `yaml:"min_interactions"` // Before generating insights
Anonymize bool `yaml:"anonymize"` // Don't store sensitive data
}
Config holds profile manager configuration
type DialecticModel ¶
type DialecticModel struct {
TrainedAt int64 `json:"trained_at"`
Accuracy float64 `json:"accuracy"`
Predictions map[string]float64 `json:"predictions"`
Patterns []string `json:"learned_patterns"`
}
DialecticModel analyzes and predicts user behavior
type Insights ¶
type Insights struct {
Profile *UserProfile `json:"profile"`
TopTasks []string `json:"top_tasks"`
PreferredTools []string `json:"preferred_tools"`
BusiestHours []int `json:"busiest_hours"`
SuccessRate float64 `json:"success_rate"`
PersonalitySummary string `json:"personality_summary"`
Recommendations []string `json:"recommendations"`
GeneratedAt int64 `json:"generated_at"`
}
Insights contains generated user insights
type InteractionSummary ¶
type InteractionSummary struct {
Timestamp int64 `json:"timestamp"`
Task string `json:"task"`
ToolsUsed []string `json:"tools_used"`
Success bool `json:"success"`
Satisfaction float64 `json:"satisfaction"` // 1-5 scale
Duration int `json:"duration_seconds"`
Topic string `json:"topic"`
}
InteractionSummary summarizes an interaction
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles user profiles
func (*Manager) CreateProfile ¶
func (m *Manager) CreateProfile(userID, name string) *UserProfile
CreateProfile creates a new user profile
func (*Manager) DeleteProfile ¶
DeleteProfile deletes a user profile
func (*Manager) ExportProfile ¶
ExportProfile exports a profile for sharing
func (*Manager) GenerateInsights ¶
GenerateInsights generates insights from user profile
func (*Manager) GetCurrentProfile ¶
func (m *Manager) GetCurrentProfile() *UserProfile
GetCurrentProfile returns the current user's profile
func (*Manager) GetProfile ¶
func (m *Manager) GetProfile(userID string) *UserProfile
GetProfile returns a user profile
func (*Manager) GetPromptContext ¶
GetPromptContext returns context for system prompt
func (*Manager) ImportProfile ¶
ImportProfile imports a profile
func (*Manager) ListProfiles ¶
func (m *Manager) ListProfiles() []*UserProfile
ListProfiles lists all available profiles
func (*Manager) LoadProfile ¶
LoadProfile loads a user profile from disk
func (*Manager) RecordInteraction ¶
func (m *Manager) RecordInteraction(userID string, interaction *InteractionSummary) error
RecordInteraction records a user interaction
func (*Manager) SaveProfile ¶
SaveProfile saves a user profile to disk
func (*Manager) SetCurrentUser ¶
SetCurrentUser sets the current active user
type PreferenceProfile ¶
type PreferenceProfile struct {
ResponseLength string `json:"response_length"` // brief, medium, detailed
CodeStyle []string `json:"code_style"` // preferred languages
Tools []string `json:"preferred_tools"` // frequently used tools
Platforms []string `json:"preferred_platforms"`
LearningStyle string `json:"learning_style"` // visual, auditory, reading, kinesthetic
CommunicationStyle string `json:"communication_style"` // direct, elaborate
}
PreferenceProfile tracks user preferences
type UserProfile ¶
type UserProfile struct {
ID string `json:"id"`
Name string `json:"name"`
Language string `json:"language"` // Primary language
Timezone string `json:"timezone"` // User's timezone
Tone string `json:"tone"` // casual, formal, technical
Expertise []string `json:"expertise"` // Areas of expertise
Preferences *PreferenceProfile `json:"preferences"`
Behavior *BehaviorProfile `json:"behavior"`
History []*InteractionSummary `json:"interaction_history"`
Traits map[string]float64 `json:"personality_traits"` // Big Five traits
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Version int `json:"version"`
}
UserProfile represents a user's dialectic profile