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({
|
return new ChatOpenAI({
|
||||||
modelName: modelInfo.model_id,
|
modelName: modelInfo.model_id,
|
||||||
openAIApiKey: providerInfo.apiKey || "",
|
openAIApiKey: providerInfo.apiKey || "temp",
|
||||||
temperature,
|
temperature,
|
||||||
topP,
|
topP,
|
||||||
configuration: {
|
configuration: {
|
||||||
apiKey: providerInfo.apiKey || "",
|
apiKey: providerInfo.apiKey || "temp",
|
||||||
baseURL: providerInfo.baseUrl || "",
|
baseURL: providerInfo.baseUrl || "",
|
||||||
}
|
}
|
||||||
}) as any
|
}) as any
|
||||||
|
Loading…
x
Reference in New Issue
Block a user