Documentation
¶
Index ¶
- type Alert
- type AlertEngine
- func (e *AlertEngine) AcknowledgeAlert(alertID string) error
- func (e *AlertEngine) Evaluate(ctx context.Context, evalCtx *EvalContext) []Alert
- func (e *AlertEngine) EvaluateRiskEscalation(ctx context.Context, conversationID string, ...) []Alert
- func (e *AlertEngine) EvaluateSentimentDrop(ctx context.Context, conversationID string, trend *sentiment.Trend) []Alert
- func (e *AlertEngine) EvaluateWaitTime(ctx context.Context, conversationID string, waitTime time.Duration) []Alert
- func (e *AlertEngine) EvaluateWorkload(ctx context.Context, workloads []CounselorWorkload) []Alert
- func (e *AlertEngine) GetAlerts(filter AlertFilter) []Alert
- func (e *AlertEngine) ResolveAlert(alertID string) error
- type AlertFilter
- type AlertRule
- type AlertType
- type Config
- type CounselorWorkload
- type EvalContext
- type Handler
- type LLMProvider
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID string `json:"id"`
Type AlertType `json:"type"`
Severity Severity `json:"severity"`
ConversationID string `json:"conversationId,omitempty"`
CounselorID string `json:"counselorId,omitempty"`
Title string `json:"title"`
Description string `json:"description"`
CreatedAt time.Time `json:"createdAt"`
AcknowledgedAt *time.Time `json:"acknowledgedAt,omitempty"`
ResolvedAt *time.Time `json:"resolvedAt,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Alert represents a supervisor alert.
type AlertEngine ¶
type AlertEngine struct {
// contains filtered or unexported fields
}
AlertEngine generates and manages supervisor alerts using a hybrid rule-based + AI approach.
func NewAlertEngine ¶
func NewAlertEngine(provider LLMProvider, cfg Config) *AlertEngine
NewAlertEngine creates a new AlertEngine. If provider is nil, only rule-based detection is used.
func (*AlertEngine) AcknowledgeAlert ¶
func (e *AlertEngine) AcknowledgeAlert(alertID string) error
AcknowledgeAlert marks an alert as acknowledged.
func (*AlertEngine) Evaluate ¶
func (e *AlertEngine) Evaluate(ctx context.Context, evalCtx *EvalContext) []Alert
Evaluate runs all alert rules against the given context and returns any new alerts.
func (*AlertEngine) EvaluateRiskEscalation ¶
func (e *AlertEngine) EvaluateRiskEscalation(ctx context.Context, conversationID string, classification *classifier.Classification) []Alert
EvaluateRiskEscalation checks for risk escalation in a conversation.
func (*AlertEngine) EvaluateSentimentDrop ¶
func (e *AlertEngine) EvaluateSentimentDrop(ctx context.Context, conversationID string, trend *sentiment.Trend) []Alert
EvaluateSentimentDrop checks for sentiment drops in a conversation.
func (*AlertEngine) EvaluateWaitTime ¶
func (e *AlertEngine) EvaluateWaitTime(ctx