Add OpenAI endpoint config
This commit is contained in:
parent
19ce45fdaf
commit
a0efb9a200
18
package.json
18
package.json
@ -76,7 +76,13 @@
|
||||
"default": "",
|
||||
"description": "Open API Key",
|
||||
"when": "DevChat.llmModel == 'OpenAI'"
|
||||
}
|
||||
},
|
||||
"DevChat.OpenAI.EndPoint": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "OpenAI api server",
|
||||
"when": "DevChat.llmModel == 'OpenAI'"
|
||||
}
|
||||
}
|
||||
},
|
||||
"views": {
|
||||
@ -94,15 +100,15 @@
|
||||
},
|
||||
{
|
||||
"command": "devchat.addConext",
|
||||
"title": "add to DevChat"
|
||||
"title": "Add to DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForCode",
|
||||
"title": "add to DevChat"
|
||||
"title": "Add to DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForFile",
|
||||
"title": "add to DevChat"
|
||||
"title": "Add to DevChat"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
@ -118,13 +124,13 @@
|
||||
"command": "devchat.askForCode",
|
||||
"when": "editorTextFocus && editorHasSelection",
|
||||
"group": "navigation",
|
||||
"title": "add to DevChat"
|
||||
"title": "Add to DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForFile",
|
||||
"when": "editorTextFocus && !editorHasSelection",
|
||||
"group": "navigation",
|
||||
"title": "add to DevChat"
|
||||
"title": "Add to DevChat"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -114,6 +114,9 @@ class DevChat {
|
||||
logger.channel()?.show();
|
||||
}
|
||||
|
||||
const openAiApiBase = vscode.workspace.getConfiguration('DevChat').get('OpenAI.EndPoint');
|
||||
const openAiApiBaseObject = openAiApiBase ? { OPENAI_API_BASE: openAiApiBase } : {};
|
||||
|
||||
const openaiModel = vscode.workspace.getConfiguration('DevChat').get('OpenAI.model');
|
||||
const openaiTemperature = vscode.workspace.getConfiguration('DevChat').get('OpenAI.temperature');
|
||||
const openaiStream = vscode.workspace.getConfiguration('DevChat').get('OpenAI.stream');
|
||||
@ -206,6 +209,7 @@ class DevChat {
|
||||
env: {
|
||||
...process.env,
|
||||
OPENAI_API_KEY: openaiApiKey,
|
||||
...openAiApiBaseObject,
|
||||
},
|
||||
}, onStdoutPartial);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user