From aca2d451a2812217b9c5fa27251c44917d4be600 Mon Sep 17 00:00:00 2001 From: Keith Thompson Date: Thu, 7 Mar 2024 09:37:08 -0500 Subject: [PATCH] Enable use of custom basePath --- src/services/OpenAiGptService.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/OpenAiGptService.js b/src/services/OpenAiGptService.js index ea7fa2e..08fdd48 100644 --- a/src/services/OpenAiGptService.js +++ b/src/services/OpenAiGptService.js @@ -11,7 +11,8 @@ export default class OpenAiGptService { if (model == "gpt4") model = "gpt-4o"; const configuration = new Configuration({ - apiKey: process.env.OPENAI_API_KEY + apiKey: process.env.OPENAI_API_KEY, + basePath: process.env.OPENAI_API_BASE || "https://api.openai.com/v1" }) const verbose = CliState.verbose() const openai = new OpenAIApi(configuration) @@ -61,4 +62,4 @@ export default class OpenAiGptService { return responseBody } -} \ No newline at end of file +}