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

settings.py issue - Data Source Setting with Search - Azure OpenAI grounding Issue #879

Open
apvarana opened this issue May 24, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@apvarana
Copy link

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

@apvarana apvarana added the bug Something isn't working label May 24, 2024
@warmdev
Copy link

warmdev commented May 24, 2024

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.

@abhahn
Copy link
Member

abhahn commented May 24, 2024

Hi @apvarana / @warmdev, thanks for bringing this to our attention. The variable DATASOURCE_TYPE is now required. I will update the docs accordingly in the README, which is something I missed in the recent settings refactoring PR.

@abhahn abhahn self-assigned this May 24, 2024
@abhahn
Copy link
Member

abhahn commented May 25, 2024

#881 Docs update is in this PR.

@apvarana
Copy link
Author

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

@abhahn
Copy link
Member

abhahn commented May 28, 2024

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?

@apvarana
Copy link
Author

I do not have AZURE_SEARCH_PERMITTED_GROUPS_COLUMN variable set

@MoustafaAMahmoud
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants