Submit feedback on an assistant message.
When positive feedback is received, the conversation exchange is stored to memory for future context. When negative feedback is received, the exchange is NOT stored. This enables learning from quality interactions.
Args: request: FastAPI request with tenant context session_id: Session identifier payload: Feedback request
Returns: SubmitFeedbackResponse with feedback status
Raises: NotFoundError: If session or message not found
Example:
curl -X POST http://localhost:8000/v1/agents/sessions/ses_abc123/feedback \
-H "Authorization: Bearer {api_key}" \
-H "X-Namespace: {namespace_id}" \
-H "Content-Type: application/json" \
-d '{
"message_id": "msg_xyz789",
"rating": "positive",
"feedback_text": "Very helpful response!"
}'
REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.
"Bearer YOUR_API_KEY"
"Bearer YOUR_STRIPE_API_KEY"
REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'
"ns_abc123def456"
"production"
"my-namespace"
Session ID
Request payload for submitting feedback on a message.
Attributes: message_id: The assistant message ID to provide feedback for rating: Feedback rating (positive or negative) feedback_text: Optional additional feedback text
Example:
python request = SubmitFeedbackRequest( message_id="msg_abc123", rating="positive", feedback_text="This was very helpful!" )
Successful Response
Response for feedback submission.
Attributes: session_id: Session identifier message_id: Message that received feedback rating: The feedback rating submitted stored: Whether the exchange was stored to memory recorded_at: Timestamp when feedback was recorded
Example:
python response = SubmitFeedbackResponse( session_id="ses_abc123", message_id="msg_xyz789", rating="positive", stored=True, recorded_at=datetime.utcnow() )