Skip to content

⚙️ fix: Ensure Azure AI Search TOP is a number #3891

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

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

s-diez
Copy link
Contributor

@s-diez s-diez commented Sep 2, 2024

Summary

Configuration of the parameter top for the AzureAiSearch tool through the enviroment variable AZURE_AI_SEARCH_SEARCH_OPTION_TOP is currently not possible. The enviroment variable is of course a string but the code explicitly requires a type number. If you set the enviroment variable, any message sent to the tool will result in an error in the log and fail to execute the Ai Search request.

error: Azure AI Search request failed Error "searchRequest.top with value 1 must be of type number." occurred in serializing the payload - undefined

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)

Testing

Build the latest docker image from main, and configure the enviroment variable. Observe the problems above. Rebuild the docker image and observe a successful request to the AI Search.

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

allows configuration through AZURE_AI_SEARCH_SEARCH_OPTION_TOP enviroment variable
@RAPHCVR
Copy link

RAPHCVR commented Sep 6, 2024

Indeed that's the fix needed

Copy link

@RAPHCVR RAPHCVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@danny-avila danny-avila changed the title fix: Ensure Azure AI Search TOP is a number ⚙️ fix: Ensure Azure AI Search TOP is a number Sep 11, 2024
@danny-avila danny-avila merged commit 07e5531 into danny-avila:main Sep 11, 2024
@s-diez s-diez deleted the azure-ai-search-top-env branch December 5, 2024 14:15
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
allows configuration through AZURE_AI_SEARCH_SEARCH_OPTION_TOP enviroment variable
MichielMAnalytics pushed a commit to MichielMAnalytics/ProAI that referenced this pull request Jun 6, 2025
allows configuration through AZURE_AI_SEARCH_SEARCH_OPTION_TOP enviroment variable
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.

3 participants