Merge pull request #351 from devchat-ai/remove_user_date_from_response
Remove user date from response
This commit is contained in:
commit
1ebebcc76b
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
|||||||
[submodule "tools"]
|
[submodule "tools"]
|
||||||
path = tools
|
path = tools
|
||||||
url = https://github.com/devchat-ai/devchat-vscode-tools.git
|
url = git@github.com:devchat-ai/devchat-vscode-tools.git
|
||||||
|
@ -87,6 +87,12 @@ function regAccessKeyCommand(context: vscode.ExtensionContext, provider: string)
|
|||||||
if (passwordInput === undefined) {
|
if (passwordInput === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (provider === "DevChat" && passwordInput.trim() !== "") {
|
||||||
|
if (!passwordInput.trim().startsWith("DC.")) {
|
||||||
|
UiUtilWrapper.showErrorMessage("Your key is invalid! DevChat Access Key is: DC.xxxxx");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (passwordInput.trim() !== "" && !isValidApiKey(passwordInput)) {
|
if (passwordInput.trim() !== "" && !isValidApiKey(passwordInput)) {
|
||||||
UiUtilWrapper.showErrorMessage("Your key is invalid!");
|
UiUtilWrapper.showErrorMessage("Your key is invalid!");
|
||||||
@ -223,6 +229,8 @@ export function regApplyDiffResultCommand(context: vscode.ExtensionContext) {
|
|||||||
const leftDoc = await vscode.workspace.openTextDocument(leftUri);
|
const leftDoc = await vscode.workspace.openTextDocument(leftUri);
|
||||||
const rightDoc = await vscode.workspace.openTextDocument(rightUri);
|
const rightDoc = await vscode.workspace.openTextDocument(rightUri);
|
||||||
|
|
||||||
|
// close rightDoc
|
||||||
|
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
|
||||||
// 将右边文档的内容替换到左边文档
|
// 将右边文档的内容替换到左边文档
|
||||||
const leftEditor = await vscode.window.showTextDocument(leftDoc);
|
const leftEditor = await vscode.window.showTextDocument(leftDoc);
|
||||||
await leftEditor.edit(editBuilder => {
|
await leftEditor.edit(editBuilder => {
|
||||||
@ -289,9 +297,9 @@ export function registerInstallCommandsPython(context: vscode.ExtensionContext)
|
|||||||
if (!fs.existsSync(requirementsFile)) {
|
if (!fs.existsSync(requirementsFile)) {
|
||||||
requirementsFile = path.join(os.homedir(), '.chat', 'workflows', 'sys', 'requirements.txt');
|
requirementsFile = path.join(os.homedir(), '.chat', 'workflows', 'sys', 'requirements.txt');
|
||||||
if (!fs.existsSync(requirementsFile)) {
|
if (!fs.existsSync(requirementsFile)) {
|
||||||
logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`);
|
// logger.channel()?.warn(`requirements.txt not found in ~/.chat/workflows dir.`);
|
||||||
logger.channel()?.show();
|
// logger.channel()?.show();
|
||||||
vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`);
|
// vscode.window.showErrorMessage(`Error: see OUTPUT for more detail!`);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,7 +327,7 @@ export function registerInstallCommandsPython(context: vscode.ExtensionContext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UiUtilWrapper.updateConfiguration("DevChat", "PythonForCommands", pythonCommand.trim());
|
UiUtilWrapper.updateConfiguration("DevChat", "PythonForCommands", pythonCommand.trim());
|
||||||
vscode.window.showInformationMessage(`All slash Command has ready to use! Please input / to try it!`);
|
vscode.window.showInformationMessage(`All slash Commands are ready to use! Please input / to try workflow commands!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
context.subscriptions.push(disposable);
|
context.subscriptions.push(disposable);
|
||||||
|
@ -31,5 +31,5 @@ export async function getUserAccessKey(message: any, panel: vscode.WebviewPanel|
|
|||||||
"keyType": llmModelData.api_key?.startsWith("DC.") ? "DevChat" : "others",
|
"keyType": llmModelData.api_key?.startsWith("DC.") ? "DevChat" : "others",
|
||||||
"endPoint": llmModelData.api_base ? llmModelData.api_base : ""
|
"endPoint": llmModelData.api_base ? llmModelData.api_base : ""
|
||||||
};
|
};
|
||||||
MessageHandler.sendMessage(panel, keyData);
|
MessageHandler.sendMessage(panel, keyData, false);
|
||||||
}
|
}
|
@ -116,7 +116,11 @@ class DevChat {
|
|||||||
args.push("-m", llmModelData.model);
|
args.push("-m", llmModelData.model);
|
||||||
|
|
||||||
args.push("-ns");
|
args.push("-ns");
|
||||||
args.push("-a");
|
|
||||||
|
const functionCalling = UiUtilWrapper.getConfiguration('DevChat', 'EnableFunctionCalling');
|
||||||
|
if (functionCalling) {
|
||||||
|
args.push("-a");
|
||||||
|
}
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
@ -194,11 +198,11 @@ class DevChat {
|
|||||||
private async runCommand(args: string[]): Promise<{code: number | null, stdout: string, stderr: string}> {
|
private async runCommand(args: string[]): Promise<{code: number | null, stdout: string, stderr: string}> {
|
||||||
// build env variables for command
|
// build env variables for command
|
||||||
const envs = {
|
const envs = {
|
||||||
|
...process.env,
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
"PYTHONUTF8":1,
|
"PYTHONUTF8":1,
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
"PYTHONPATH": UiUtilWrapper.extensionPath() + "/tools/site-packages",
|
"PYTHONPATH": UiUtilWrapper.extensionPath() + "/tools/site-packages"
|
||||||
...process.env
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const pythonApp = UiUtilWrapper.getConfiguration("DevChat", "PythonForChat") || "python3";
|
const pythonApp = UiUtilWrapper.getConfiguration("DevChat", "PythonForChat") || "python3";
|
||||||
@ -291,7 +295,7 @@ class DevChat {
|
|||||||
"prompt-hash": logs[0]['hash'],
|
"prompt-hash": logs[0]['hash'],
|
||||||
user: "",
|
user: "",
|
||||||
date: "",
|
date: "",
|
||||||
response: stdout,
|
response: responseData.response,
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
finish_reason: "",
|
finish_reason: "",
|
||||||
isError: false,
|
isError: false,
|
||||||
|
2
tools
2
tools
@ -1 +1 @@
|
|||||||
Subproject commit c9cc0d51a4d24162aaa2216e0bb0c6b198f74206
|
Subproject commit bbd2c13b6b08622bdea6b1e78a593af854c78859
|
Loading…
x
Reference in New Issue
Block a user