alerts

package
v0.3.66 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 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 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