profile

package
v0.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default 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 NewManager

func NewManager(dataDir string) *Manager

NewManager creates a new profile manager

func (*Manager) CreateProfile

func (m *Manager) CreateProfile(userID, name string) *UserProfile

CreateProfile creates a new user profile

func (*Manager) DeleteProfile

func (m *Manager) DeleteProfile(userID string) error

DeleteProfile deletes a user profile

func (*Manager) ExportProfile

func (m *Manager) ExportProfile(userID string) ([]byte, error)

ExportProfile exports a profile for sharing

func (*Manager) GenerateInsights

func (m *Manager) GenerateInsights(userID string) *Insights

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

func (m *Manager) GetPromptContext(userID string) string

GetPromptContext returns context for system prompt

func (*Manager) ImportProfile

func (m *Manager) ImportProfile(data []byte) error

ImportProfile imports a profile

func (*Manager) ListProfiles

func (m *Manager) ListProfiles() []*UserProfile

ListProfiles lists all available profiles

func (*Manager) LoadProfile

func (m *Manager) LoadProfile(userID string) error

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

func (m *Manager) SaveProfile(userID string) error

SaveProfile saves a user profile to disk

func (*Manager) SetCurrentUser

func (m *Manager) SetCurrentUser(userID string)

SetCurrentUser sets the current active user

func (*Manager) UpdatePreference

func (m *Manager) UpdatePreference(userID string, pref string, value interface{}) error

UpdatePreference updates a user preference

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL