sentiment

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 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 Analysis

type Analysis struct {
	Score      Score     `json:"score"`
	Label      string    `json:"label"`
	Confidence float64   `json:"confidence"`
	Keywords   []string  `json:"keywords,omitempty"`
	AnalyzedAt time.Time `json:"analyzedAt"`
}

Analysis represents the sentiment analysis result for a single message or conversation.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler provides HTTP handlers for the sentiment API.

func NewHandler

func NewHandler(analyzer *SentimentAnalyzer, detector *TrendDetector) *Handler

NewHandler creates a new sentiment API handler.

func (*Handler) HandleAnalyzeSentiment

func (h *Handler) HandleAnalyzeSentiment(w http.ResponseWriter, r *http.Request)

HandleAnalyzeSentiment handles POST /api/conversations/{id}/sentiment. Analyzes messages and returns sentiment timeline with trend.

func (*Handler) HandleGetSentiment

func (h *Handler) HandleGetSentiment(w http.ResponseWriter, r *http.Request)

HandleGetSentiment handles GET /api/conversations/{id}/sentiment. Returns the stored trend for a conversation.

func (*Handler) RegisterRoutes