fix: solve the problem that openai baseurl does not exist
This commit is contained in:
@@ -42,8 +42,13 @@ export default class OpenAILikeProvider extends BaseProvider {
|
|||||||
throw new Error(`Missing configuration for ${this.name} provider`);
|
throw new Error(`Missing configuration for ${this.name} provider`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let openaiBaseUrl = baseUrl;
|
||||||
|
if (!baseUrl) {
|
||||||
|
openaiBaseUrl = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
const openai = createOpenAI({
|
const openai = createOpenAI({
|
||||||
baseURL: baseUrl,
|
baseURL: openaiBaseUrl,
|
||||||
apiKey,
|
apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user