Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

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

Sebastian Diez07e5531b5b46
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(',');