Merge pull request #1117 from ManishMadan2882/main

Adding option to collect feedback in React widget
This commit is contained in:
Alex
2024-09-10 12:18:08 +01:00
committed by GitHub
7 changed files with 132 additions and 22 deletions

View File

@@ -84,14 +84,10 @@ def api_feedback():
question = data["question"]
answer = data["answer"]
feedback = data["feedback"]
feedback_collection.insert_one(
{
"question": question,
"answer": answer,
"feedback": feedback,
}
)
new_doc = {"question": question, "answer": answer, "feedback": feedback}
if "api_key" in data:
new_doc["api_key"] = data["api_key"]
feedback_collection.insert_one(new_doc)
return {"status": "ok"}