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.
This commit is contained in:
parent
d7510333a7
commit
efec675b9a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user