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