A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
I am trying to run the backend service locally by using separate AzureKeyCredential instances with the keys for each service. Because, the app will be deployed to a local server (not Azure).
ERROR:root:Exception in /chat: 'AzureKeyCredential' object has no attribute 'get_token'
Traceback (most recent call last):
File "src\backend\app.py", line 178, in chat
result = await approach.run(
File "src\backend\approaches\chatapproach.py", line 222, in run
return await self.run_without_streaming(messages, overrides, auth_claims, session_state)
File "src\backend\approaches\chatapproach.py", line 134, in run_without_streaming
extra_info, chat_coroutine = await self.run_until_final_call(
File "src\backend\approaches\chatreadretrieveread.py", line 149, in run_until_final_call
chat_completion: ChatCompletion = await self.openai_client.chat.completions.create(
File "AppData\Local\Programs\Python\Python310\lib\site-packages\openai\resources\chat\completions.py", line 1181, in create
return await self._post(
File "AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_base_client.py", line 1790, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_base_client.py", line 1493, in request
return await self._request(
File AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_base_client.py", line 1511, in _request
await self._prepare_options(options)
File "AppData\Local\Programs\Python\Python310\lib\site-packages\openai\lib\azure.py", line 531, in _prepare_options
azure_ad_token = await self._get_azure_ad_token()
File "AppData\Local\Programs\Python\Python310\lib\site-packages\openai\lib\azure.py", line 517, in _get_azure_ad_token
token = await token
File "AppData\Local\Programs\Python\Python310\lib\site-packages\azure\identity\aio\_bearer_token_provider.py", line 44, in wrapper
await policy.on_request(request)
File "AppData\Local\Programs\Python\Python310\lib\site-packages\azure\core\pipeline\policies\_authentication_async.py", line 70, in on_request
self._token = await await_result(self._credential.get_token, *self._scopes)
AttributeError: 'AzureKeyCredential' object has no attribute 'get_token'
This issue is for a: (mark with an
x
)Minimal steps to reproduce
I am trying to run the backend service locally by using separate AzureKeyCredential instances with the keys for each service. Because, the app will be deployed to a local server (not Azure).
Any log messages given by the failure
Expected/desired behavior
OS and Version?