-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use "evaluation app" when the login is required in the "chat app" #1578
Comments
I managed to solve this issue by adding a new method called get_token in the "evaluate" function that retreive a token that allows the access to the chat, with login enabled. To use this new method you need:
For client_id and client_secret check The client_secret key is visible only when it is created therefore it is likely that you need to add a new one, check The get_token method to retrieve the token
In the run_evaluation function before calling the send_question_to_target you have to add
Then you have to modify the two calls to the function send_question_to_target adding the retrieved token
Finally you have to modify the send_question_to_target as follows:
Here below you may find a script that test the retrieval of the token.
|
Thanks so much for sharing your approach! I may try to add that to the repo if more folks run into it. Very helpful! |
Thanks for the detailed instructions @biancat821. However, this doesn't work for me. I'm a bit confused by the client ID and secret. Two applications are actually created by the bicep files, the client app and server app. My understanding is that the server app is the one exposing an API. So which one should be used for client_id and client_secret in the code? I'm assuming that it's the server app. However, this doesn't work for me. I'm getting this error:
My env variables are as follows: If I use the client id and secret instead of server, I get this (I configured "expose an API" for the client app to get this far)
So none of the options work. I'm a bit lost. This is related to #1935 as well. |
I found some relevant info about the api prefix which differs between version 1 and version 2, as indicated by accessTokenAcceptedVersion in the Manifest: I changed accessTokenAcceptedVersion to null (in the server app registration) and it started "working" for me. By working I mean that it got further in the code, I'm not getting the Audiences error anymore. But the JSON response from the web site seems empty. |
This issue is for a:
Minimal steps to reproduce
I would like to use the Evaluation app described in
https://learn.microsoft.com/en-us/azure/developer/python/get-started-app-chat-evaluations?tabs=github-codespaces
where the chat app has the optional login enabled, setting
azd env set AZURE_USE_AUTHENTICATION true
Which settings do I have to change to allow the Evaluations app accessing the chat app if the login is required?
Any log messages given by the failure
When I run the evaluation script with the Evaluations app as follows
python3 -m scripts evaluate --config=my_config.json --numquestions=14
I amn returned with the following error
Expected/desired behavior
The Evaluations app should work as when the optional login is disabled.
OS and Version?
I am using Windows 11 but everything is deployed on Azure.
azd version?
azd version 1.8.2 (commit 14600c7a54edac4f54397413f8638431f5c16327)
The text was updated successfully, but these errors were encountered: