Skip to main content
ClaudeChatGPT

Answer Feedback

Use this guide to send ratings of Wren AI answers from your own application. Every rating is attached to the exact answer it is about, so the people who review answer quality can see which answers missed and why.

Plan support

Only in Essential Cloud plan and above. Also available on the Self-Hosted Version.

Using Wren AI through Claude or ChatGPT?

You don't need this API. Tell the assistant an answer is wrong and it reports it for you. See Rating an answer.

Get the answer ID​

Every API answer comes with its own answer ID, returned in the id field of the response. For example, the id in this generate_sql response is the answer ID:

{
"id": "1fbc0d64-1c58-45b2-a990-9183bbbcf913",
"sql": "SELECT * FROM \"olist_customers_dataset\"",
"threadId": "9c537507-9cec-46ed-b877-07bfa6322bed"
}

Use the answer ID, not the threadId: one thread can hold many answers.

Send a rating​

Send the rating from your backend, not from the browser, because the request needs your API key.

curl -X POST 'https://cloud.getwren.ai/api/v2/answers/1fbc0d64-1c58-45b2-a990-9183bbbcf913/feedback' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"rating": "down",
"topics": ["INCORRECT_DATA_RETRIEVED"],
"comment": "The total includes refunded orders.",
"correction": "Exclude orders with status refunded."
}'

The response includes a feedbackId. Keep it if you may need to update this rating later.

FieldRequiredDescription
rating✓up or down.
topicsReasons for the rating, from the feedback topics below.
commentWhat the user says is wrong, in their own words.
correctionWhat the user says the right answer is.
feedbackIdSet it to update an earlier rating instead of creating a new one.

Update a rating​

Send the same request again with the feedbackId from the first response. The new values replace the earlier rating.

curl -X POST 'https://cloud.getwren.ai/api/v2/answers/1fbc0d64-1c58-45b2-a990-9183bbbcf913/feedback' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"feedbackId": "8a6f3d1e-2b47-4c09-9e1a-5d7c0b4f6a21",
"rating": "up"
}'

A rating can't be withdrawn.

Feedback topics​

topics accepts these values. In the Wren AI web app, the reasons offered depend on the kind of answer, shown in the last column.

ValueLabel in Wren AIOffered for
SQL_GENERATION_FAILEDSQL generation failedText, Agentic
INCORRECT_DATA_RETRIEVEDIncorrect data retrievedText, Agentic
INCORRECT_AI_SUMMARYIncorrect AI summaryText
FAILED_TO_ADHERE_INSTRUCTIONSFailed to follow instructionsText, Agentic
FAILED_TO_ADHERE_SUMMARY_INSTRUCTIONSFailed to follow summary instructionsText
FAILED_TO_ADHERE_SQL_PAIRSFailed to follow question-SQL pairsText, Agentic
INCORRECT_CHART_DATAIncorrect chart dataChart, Agentic
INCORRECT_CHART_TYPEWrong chart typeChart, Agentic
CHART_GENERATION_FAILEDChart generation failedChart
DID_NOT_FOLLOW_CHART_INSTRUCTIONSDid not follow chart instructionsChart
MISUNDERSTOOD_QUESTIONMisunderstood the questionAgentic
ASKED_UNNECESSARY_CLARIFICATIONSAsked unnecessary clarificationsAgentic
SHOULD_HAVE_ASKED_CLARIFICATIONShould have asked for clarificationAgentic
WRONG_FILE_FORMATWrong file formatAgentic
INCORRECT_FILE_CONTENTIncorrect file contentAgentic
DOWNLOAD_FAILEDDownload failedAgentic
INCORRECT_OR_HALLUCINATED_ANSWERIncorrect or hallucinated answerAgentic
INCOMPLETE_ANSWERIncomplete answerAgentic
WRONG_APPROACH_OR_PLANWrong approach or planAgentic
TOO_MANY_STEPSToo many stepsAgentic
SKILL_MEMORY_ISSUESkill or memory issueAgentic
OTHEROtherText, Chart, Agentic

Text means an answer without a chart, Chart an answer with a chart, and Agentic an answer from an Agentic project.

Current limits​

  • Ratings sent through the API don't appear in Thread tracing yet.
  • There is no endpoint to read ratings back. If your application needs to show a user's earlier rating, store it on your side.