azure-search-openai-demo
azure-search-openai-demo copied to clipboard
Exception while generating response stream: () The request is invalid. Details: Must specify valid information for parsing in the string. (Parameter 'value')
The project is designed to work with rbac permissions. even with. the whole permission set, I'm stuck at this. Response comes from backend, so it is kind of difficult for me to pinpoint what is not working.
ERROR:root:Exception while generating response stream: () The request is invalid. Details: Must specify valid information for parsing in the string. (Parameter 'value') Code: Message: The request is invalid. Details: Must specify valid information for parsing in the string. (Parameter 'value') Traceback (most recent call last): File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/app/backend/app.py", line 203, in format_as_ndjson async for event in r: File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/app/backend/approaches/chatapproach.py", line 72, in run_with_streaming extra_info, chat_coroutine = await self.run_until_final_call( File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/app/backend/approaches/chatreadretrieveread.py", line 139, in run_until_final_call results = await self.search( File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/app/backend/approaches/approach.py", line 177, in search async for page in results.by_page(): File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/.venv/lib/python3.9/site-packages/azure/core/async_paging.py", line 94, in __anext__ self._response = await self._get_next(self.continuation_token) File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/.venv/lib/python3.9/site-packages/azure/search/documents/aio/_paging.py", line 109, in _get_next_cb return await self._client.documents.search_post(search_request=self._initial_query.request, **self._kwargs) File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/.venv/lib/python3.9/site-packages/azure/core/tracing/decorator_async.py", line 105, in wrapper_use_tracer return await func(*args, **kwargs) File "/Users/nico/Documents/Cognativ/POCs/GoDocAI/code/azure-search-openai-demo/.venv/lib/python3.9/site-packages/azure/search/documents/_generated/aio/operations/_documents_operations.py", line 409, in search_post raise HttpResponseError(response=response, model=error) azure.core.exceptions.HttpResponseError: () The request is invalid. Details: Must specify valid information for parsing in the string. (Parameter 'value')
Hm, that's an interesting error. It seems to be coming from the search index, so I've forwarded it to search team to see if they're familiar with it. Are you still seeing it? Does it happen for every query? What if you change search options, like vector vs hybrid?
I think the issue is an empty string for the query language and query speller settings. Please try changing these two lines in app.py:
AZURE_SEARCH_QUERY_LANGUAGE = os.getenv("AZURE_SEARCH_QUERY_LANGUAGE") or "en-us"
AZURE_SEARCH_QUERY_SPELLER = os.getenv("AZURE_SEARCH_QUERY_SPELLER") or "lexicon"