output cost by /ask-code

This commit is contained in:
bobo.yang 2023-11-14 17:28:20 +08:00
parent d0e8a25c27
commit 407f5d46dd
5 changed files with 17 additions and 11 deletions

View File

@ -273,7 +273,7 @@ export function registerAskCodeIndexStartCommand(context: vscode.ExtensionContex
// check whether pythonVirtualEnv is stisfy the requirement version
const devchatAskVersion = getPackageVersion(pythonVirtualEnv, "devchat-ask");
let requireAskVersion = "0.1.3";
let requireAskVersion = "0.1.7";
if (!devchatAskVersion || devchatAskVersion < requireAskVersion) {
logger.channel()?.info(`The version of devchat-ask is ${devchatAskVersion}`);

View File

@ -10,7 +10,7 @@ export async function isDevChatInstalledImpl() {
if (pythonVirtualEnv) {
// check whether pythonVirtualEnv is stisfy the requirement version
const devchatAskVersion = getPackageVersion(pythonVirtualEnv, "devchat-ask");
if (!devchatAskVersion || devchatAskVersion < "0.1.3") {
if (!devchatAskVersion || devchatAskVersion < "0.1.7") {
pythonVirtualEnv = undefined;
}
}

View File

@ -13,7 +13,7 @@ import { logger } from "../logger";
export async function installAskCode(): Promise<string> {
try {
logger.channel()?.info(`start installing AskCode with python=3.11.4 ...`);
let devchatAskVersion = '>=0.1.3';
let devchatAskVersion = '>=0.1.7';
const pythonCommand = await appInstall("devchat-ask", devchatAskVersion, '3.11.4');
if (!pythonCommand) {
logger.channel()?.error(`failed to install devchat-ask with python=3.11.4`);

View File

@ -228,14 +228,20 @@ You can configure DevChat from [Settings](#settings).`;
message: userMessage
});
const isInstalled = yield isDevChatInstalled();
if (isInstalled){
self.disabled = true;
self.errorMessage = '';
self.messages.push({
type: 'bot',
message: '',
confirm: true
});
// self.disabled = true;
// self.errorMessage = '';
// self.messages.push({
// type: 'bot',
// message: '',
// confirm: true
// });
self.messages.push({
type: 'bot',
message: ''
});
startGenerating(userMessage, chatContexts);
} else {
self.messages.push({
type: 'bot',

2
tools

@ -1 +1 @@
Subproject commit 782ec455d62cae6dc0f94f5f977330d14d0637b8
Subproject commit ce89bf904f70acd832d70cd564d763df18b09504