add useHistoryPrompts config
This commit is contained in:
parent
bbb93a5fda
commit
ac4f9d6802
@ -53,6 +53,12 @@
|
|||||||
"description": "token for each prompt",
|
"description": "token for each prompt",
|
||||||
"when": "DevChat.llmModel == 'OpenAI'"
|
"when": "DevChat.llmModel == 'OpenAI'"
|
||||||
},
|
},
|
||||||
|
"DevChat.OpenAI.useHistoryPrompt": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "use history prompts as context",
|
||||||
|
"when": "DevChat.llmModel == 'OpenAI'"
|
||||||
|
},
|
||||||
"DevChat.OpenAI.apiKey": {
|
"DevChat.OpenAI.apiKey": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "",
|
"default": "",
|
||||||
|
@ -70,9 +70,6 @@ class DevChat {
|
|||||||
async chat(content: string, options: ChatOptions = {}, onData: (data: string) => void): Promise<ChatResponse> {
|
async chat(content: string, options: ChatOptions = {}, onData: (data: string) => void): Promise<ChatResponse> {
|
||||||
let args = ["prompt"];
|
let args = ["prompt"];
|
||||||
|
|
||||||
if (options.parent) {
|
|
||||||
args.push("-p", options.parent);
|
|
||||||
}
|
|
||||||
if (options.reference) {
|
if (options.reference) {
|
||||||
for (const reference of options.reference) {
|
for (const reference of options.reference) {
|
||||||
args.push("-r", reference);
|
args.push("-r", reference);
|
||||||
@ -102,6 +99,11 @@ class DevChat {
|
|||||||
const openaiStream = vscode.workspace.getConfiguration('DevChat').get('OpenAI.stream');
|
const openaiStream = vscode.workspace.getConfiguration('DevChat').get('OpenAI.stream');
|
||||||
const llmModel = vscode.workspace.getConfiguration('DevChat').get('llmModel');
|
const llmModel = vscode.workspace.getConfiguration('DevChat').get('llmModel');
|
||||||
const tokensPerPrompt = vscode.workspace.getConfiguration('DevChat').get('OpenAI.tokensPerPrompt');
|
const tokensPerPrompt = vscode.workspace.getConfiguration('DevChat').get('OpenAI.tokensPerPrompt');
|
||||||
|
const userHistoryPrompts = vscode.workspace.getConfiguration('DevChat').get('OpenAI.useHistoryPrompt');
|
||||||
|
|
||||||
|
if (userHistoryPrompts && options.parent) {
|
||||||
|
args.push("-p", options.parent);
|
||||||
|
}
|
||||||
|
|
||||||
const devchatConfig = {
|
const devchatConfig = {
|
||||||
model: openaiModel,
|
model: openaiModel,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user