settings.py issue - Data Source Setting with Search - Azure OpenAI grounding Issue
apvarana opened this issue · comments
looks like some env variables required like Data Source type, the new code is failing saying the data source is not set and Az open ai cannot be grounded. Specifically if we are using AI search. This problem surfaced after the latest checkout and settings,py file . Can someone pls look into this issue
Also encountered the same issue. If you use Azure AI Search, creating an environment variable DATASOURCE_TYPE = "AzureCognitiveSearch" (in your .env file or App Service environment settings) solves the problem.
#881 Docs update is in this PR.
Hi Thanks for the above one.
There is one more error that I got
Error code: 400 - {'error': {'requestid': 'xxxxxx', 'code': 400, 'message': 'An error occurred when calling Azure Cognitive Search: Azure Search Error: 400, message='Server responded with status 400. Error message: {"error":{"code":"","message":"Invalid expression: Could not find a property named \'True\' on type \'search.document\'.\\r\\nParameter name: $filter"}}', url=URL('https://xxxxxxxx.windows.net/indexes/xxxxxxxx/docs/search?api-version=2024-03-01-preview\')\nPotential issue with Azure search filter. Please ensure all field names in the filter are correct and syntax is correct for filter.'}}
Potential Fix
In settings.py , I changed the filters line to
filter: Optional[str] = Field(default=None, exclude=True)
in _AzureSearchSettings Class
Hi @apvarana , thanks for sharing the details of the issue with the filter. I have changed the line to what you have recommended above for the time being, but actually I'm not sure if exclude=True
is what we want, since it will prevent the value from being available in the dumped model output.
Did you have the AZURE_SEARCH_PERMITTED_GROUPS_COLUMN
variable set in your environment at the time you got the error message above?
I do not have AZURE_SEARCH_PERMITTED_GROUPS_COLUMN variable set
One more issue here, on the one click deployment there is no option to set DATA_SOURCE
https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/infrastructure/deployment.json.
WIP: https://github.com/microsoft/sample-app-aoai-chatGPT/pull/896/files