Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable feedback to cosmos DB #1620

Open
edgBR opened this issue Jan 8, 2025 · 3 comments
Open

Enable feedback to cosmos DB #1620

edgBR opened this issue Jan 8, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@edgBR
Copy link

edgBR commented Jan 8, 2025

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?

image

Requirements

Looking to the typescript models:

image

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:

https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/blob/main/code/frontend/src/api/api.ts

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:

https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/frontend/src/components/Answer/Answer.tsx

And finally adapt this code:

https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/blob/main/code/frontend/src/pages/chat/Chat.tsx

Should be a great start.

@edgBR edgBR added the enhancement New feature or request label Jan 8, 2025
@Vinay-Microsoft
Copy link

@edgBR Are you proposing to collect the telemetry data post deployment? If yes then we have another mechanism known as Azure Verified Modules (AVM) for this activity.

@edgBR
Copy link
Author

edgBR commented Jan 8, 2025

Hi @Vinay-Microsoft

I'm not talking about the telemetry. I am talking about giving feedback to the answers provided by the chat as we can do in sample-aoi-chat.

@Vinay-Microsoft
Copy link

ok @edgBR got it will relay this request to our engineering team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants