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.