Conversation Feedback API
Collect and manage user feedback on AI responses to improve your models and user experience.
Overview
The Conversation Feedback API allows you to collect user ratings (upvotes/downvotes) on AI responses in conversations. This feedback can be used for analytics, model training, and improving the quality of responses over time.
Rate a Conversation Message
Submit a rating for a specific assistant message in a conversation.
POST
/messages/{conversation}/rate
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user | string | Yes | The user identifier that the conversation belongs to |
| message_id | string | Yes | The ID of the message to rate |
| rating | integer | Yes | The rating value: 1 (upvote) or -1 (downvote) |
Path Parameters
| Parameter | Description |
|---|---|
| conversation | The nanoid of the conversation containing the message |
Response
On success, the server returns a 200 OK response with the following JSON:
{
"message": "Message rated successfully.",
"rating": 1
}
Error Codes
| Code | Description |
|---|---|
| 404 | Conversation not found, message not found, or user mismatch |
| 422 | Validation error or attempt to rate a non-assistant message |
Example Request
curl -X POST "https://api.vectorforgeai.com/v1/messages/abc123def456/rate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user": "user123",
"message_id": "resp_assi_xyz789",
"rating": 1
}'
Use Cases
- Collect user feedback on AI responses to identify areas for improvement
- Track user satisfaction with different types of responses
- Build datasets for fine-tuning models based on user-preferred responses
- Create analytics dashboards to understand user sentiment over time
Best Practices
- Implement both upvote and downvote options in your UI for balanced feedback
- Consider coupling ratings with optional text feedback for more detailed insights
- Use the rating data to identify patterns in responses that users find helpful or unhelpful
- Periodically review highly-rated and lowly-rated responses to improve your system prompts
Need Help?
If you're having trouble with the Conversation API or have questions, we're here to help!