From efec675b9a2adc29a937c8b879eaf8326aaa5145 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Mon, 30 Sep 2024 10:28:35 +0530 Subject: [PATCH] Fix: Replace empty API keys with temporary placeholder The previous code used an empty string for the `apiKey` when no key was provided, which could lead to unexpected behavior. This commit replaces those with a temporary placeholder ("temp") to avoid potential errors and make the code more robust. --- src/models/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/index.ts b/src/models/index.ts index 07c134e..c33e312 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -44,11 +44,11 @@ export const pageAssistModel = async ({ return new ChatOpenAI({ modelName: modelInfo.model_id, - openAIApiKey: providerInfo.apiKey || "", + openAIApiKey: providerInfo.apiKey || "temp", temperature, topP, configuration: { - apiKey: providerInfo.apiKey || "", + apiKey: providerInfo.apiKey || "temp", baseURL: providerInfo.baseUrl || "", } }) as any