Skip to content

Commit dc1cab2

Browse files
committed
Fix function name and API key prefix check
- Rename checkOpenAIKey to checkOpenaiKey in contributes/commands.ts. - Update apiKey.startsWith condition to check for "DC." instead of "dc-" in toolwrapper/devchat.ts.
1 parent f86992a commit dc1cab2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/contributes/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function checkOpenaiApiKey() {
4949
return true;
5050
}
5151

52-
function checkOpenAIKey() {
52+
function checkOpenaiKey() {
5353
let openaiApiKey = vscode.workspace.getConfiguration('DevChat').get('API_KEY');
5454
if (!openaiApiKey) {
5555
openaiApiKey = process.env.OPENAI_API_KEY;

src/toolwrapper/devchat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class DevChat {
149149

150150
apiEndpoint(apiKey: string | undefined): any {
151151
let openAiApiBase: string | undefined = undefined;
152-
if (apiKey?.startsWith("dc-")) {
152+
if (apiKey?.startsWith("DC.")) {
153153
// TODO add devchat proxy
154154
openAiApiBase = "https://xw4ymuy6qj.ap-southeast-1.awsapprunner.com/api/v1";
155155
}
@@ -218,7 +218,7 @@ class DevChat {
218218
env: {
219219
...process.env,
220220
OPENAI_API_KEY: openaiApiKey,
221-
...openaiApiBaseObject
221+
...openAiApiBaseObject
222222
},
223223
};
224224

0 commit comments

Comments
 (0)