-
Notifications
You must be signed in to change notification settings - Fork 592
Open
Labels
Description
Motivation
Hi,
In order to enable post production deployment metrics it would be very nice to have the ability to collect feedback as in:
https://github.com/microsoft/sample-app-aoai-chatGPT/tree/main
How would you feel if this feature request was implemented?
Requirements
Looking to the typescript models:
Seems that this has been already taken care partially.
Tasks
I have 0 experience with vite, javascript, typescript etc...
However it seems that adding to this file:
Something similar to this:
export const historyMessageFeedback = async (messageId: string, feedback: string): Promise<Response> => {
const response = await fetch('/history/message_feedback', {
method: 'POST',
body: JSON.stringify({
message_id: messageId,
message_feedback: feedback
}),
headers: {
'Content-Type': 'application/json'
}
})
.then(res => {
return res
})
.catch(_err => {
console.error('There was an issue logging feedback.')
const errRes: Response = {
...new Response(),
ok: false,
status: 500
}
return errRes
})
return response
}
Modifying this file: https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/blob/main/code/frontend/src/components/Answer/Answer.tsx
To add the feedback components from here:
And finally adapt this code:
Should be a great start.