From 07e5531b5b46c7dc402d62bdfe54d696cc0757cb Mon Sep 17 00:00:00 2001 From: Sebastian Diez Date: Wed, 11 Sep 2024 15:21:33 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20fix:=20Ensure=20Azure=20AI?= =?UTF-8?q?=20Search=20TOP=20is=20a=20number=20(#3891)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 9b50aa2c43..1e20b9ce81 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 0ce7b43fb2..1a8c3e9e6e 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(',');