From dfa1d1a7c90ed1a1db4f041018a180cedefbf758 Mon Sep 17 00:00:00 2001 From: Sebastian Diez Date: Mon, 5 Aug 2024 09:24:15 +0200 Subject: [PATCH] fix: Ensure Azure AI Search TOP is a number allows configuration through AZURE_AI_SEARCH_SEARCH_OPTION_TOP enviroment variable --- api/app/clients/tools/AzureAiSearch.js | 2 +- api/app/clients/tools/structured/AzureAISearch.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/clients/tools/AzureAiSearch.js b/api/app/clients/tools/AzureAiSearch.js index 9b50aa2c433..1e20b9ce81d 100644 --- a/api/app/clients/tools/AzureAiSearch.js +++ b/api/app/clients/tools/AzureAiSearch.js @@ -77,7 +77,7 @@ class AzureAISearch extends StructuredTool { try { const searchOption = { queryType: this.queryType, - top: this.top, + top: typeof this.top === 'string' ? Number(this.top) : this.top, }; if (this.select) { searchOption.select = this.select.split(','); diff --git a/api/app/clients/tools/structured/AzureAISearch.js b/api/app/clients/tools/structured/AzureAISearch.js index 0ce7b43fb21..1a8c3e9e6e5 100644 --- a/api/app/clients/tools/structured/AzureAISearch.js +++ b/api/app/clients/tools/structured/AzureAISearch.js @@ -83,7 +83,7 @@ class AzureAISearch extends StructuredTool { try { const searchOption = { queryType: this.queryType, - top: this.top, + top: typeof this.top === 'string' ? Number(this.top) : this.top, }; if (this.select) { searchOption.select = this.select.split(',');