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

chore(gen-ai): remove strict validation of query response for aggregation generation #5858

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Jun 3, 2024

Our current query response validation in Compass strictly checks for if a query exists in the response:

if (typeof query !== 'object' || query === null) {

The changes in https://github.com/10gen/mms/pull/98900 made it so that we don't return a query if no query fields were returned. Because of this change we now error in the validation when an aggregation is returned:

Error: Unexpected response: expected query to be an object

Cloud pr where we fix this: https://github.com/10gen/mms/pull/100505

We missed this as the ai-accuracy-tests do not do this same validation. This pr updates our validation in our accuracy tests to use what we do in our code flow. It also makes the check less strict.

@Anemy Anemy merged commit b319a42 into main Jun 4, 2024
12 of 16 checks passed
@Anemy Anemy deleted the allow-empty-query-to-be-returned-from-ai-endpoint branch June 4, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants