Documentation
¶
Overview ¶
Package prediction provides predictive interaction capabilities for AI agents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType defines specific actions that can be predicted.
const ( ActionViewWeekSchedule ActionType = "view_week_schedule" ActionViewTomorrow ActionType = "view_tomorrow" ActionCreateSchedule ActionType = "create_schedule" ActionSetReminder ActionType = "set_reminder" ActionSearchRelated ActionType = "search_related" ActionViewWeeklyReport ActionType = "view_weekly_report" ActionMonthlyReview ActionType = "monthly_review" ActionQuickNote ActionType = "quick_note" )
type ContextEvent ¶
type ContextEvent struct {
Type string `json:"type"` // "schedule_created", "memo_viewed", etc.
TargetID string `json:"target_id"`
Timestamp time.Time `json:"timestamp"`
}
ContextEvent represents a recent user action for context-based prediction.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine provides prediction capabilities based on user habits and context.
func NewEngine ¶
func NewEngine(habitAnalyzer habit.HabitAnalyzer, memSvc memory.MemoryService) *Engine
NewEngine creates a new prediction engine.
func (*Engine) Predict ¶
func (e *Engine) Predict(ctx context.Context, userID int32, recentEvents []ContextEvent) ([]Prediction, error)
Predict generates predictions for a user based on time, context, and patterns.
func (*Engine) SetMaxPredictions ¶
SetMaxPredictions sets the maximum number of predictions to return.
type Prediction ¶
type Prediction struct {
Type PredictionType `json:"type"`
Label string `json:"label"`
Confidence float64 `json:"confidence"`
Action ActionType `json:"action"`
Payload any `json:"payload,omitempty"`
Reason string `json:"reason,omitempty"` // Why this was predicted
}
Prediction represents a predicted user action.
type PredictionType ¶
type PredictionType string
PredictionType defines the type of prediction.
const ( PredictionTypeAction PredictionType = "action" PredictionTypeQuery PredictionType = "query" PredictionTypeReminder PredictionType = "reminder" )
type TriggerType ¶
type TriggerType string
TriggerType defines what triggered the prediction.
const ( TriggerTime TriggerType = "time" TriggerContext TriggerType = "context" TriggerPattern TriggerType = "pattern" )
Click to show internal directories.
Click to hide internal directories.