Provide feedback on an AI response to help improve future responses.
Bearer token obtained from the authenticate endpoint.
Unique identifier of the message to provide feedback on.
Either "positive" (thumbs up) or "negative" (thumbs down).
Optional additional context. Typically used with negative feedback to explain what was wrong.
Response
Updated message metadata.
The feedback value that was saved.
curl -X PATCH https://api.trellis.sh/v1/chats/messages/msg_002/feedback \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"feedback": "positive"}'
import requests
response = requests.patch(
"https://api.trellis.sh/v1/chats/messages/msg_002/feedback",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={"feedback": "positive"}
)
result = response.json()
const response = await fetch(
"https://api.trellis.sh/v1/chats/messages/msg_002/feedback",
{
method: "PATCH",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({ feedback: "positive" }),
}
);
const result = await response.json();
{
"id": "msg_002",
"metadata": {
"feedback": "positive"
}
}
{
"detail": "Feedback must be 'positive' or 'negative'"
}
{
"detail": "Message not found"
}