output cost by /ask-code
This commit is contained in:
parent
d0e8a25c27
commit
407f5d46dd
@ -273,7 +273,7 @@ export function registerAskCodeIndexStartCommand(context: vscode.ExtensionContex
|
|||||||
// check whether pythonVirtualEnv is stisfy the requirement version
|
// check whether pythonVirtualEnv is stisfy the requirement version
|
||||||
const devchatAskVersion = getPackageVersion(pythonVirtualEnv, "devchat-ask");
|
const devchatAskVersion = getPackageVersion(pythonVirtualEnv, "devchat-ask");
|
||||||
|
|
||||||
let requireAskVersion = "0.1.3";
|
let requireAskVersion = "0.1.7";
|
||||||
|
|
||||||
if (!devchatAskVersion || devchatAskVersion < requireAskVersion) {
|
if (!devchatAskVersion || devchatAskVersion < requireAskVersion) {
|
||||||
logger.channel()?.info(`The version of devchat-ask is ${devchatAskVersion}`);
|
logger.channel()?.info(`The version of devchat-ask is ${devchatAskVersion}`);
|
||||||
|
@ -10,7 +10,7 @@ export async function isDevChatInstalledImpl() {
|
|||||||
if (pythonVirtualEnv) {
|
if (pythonVirtualEnv) {
|
||||||
// check whether pythonVirtualEnv is stisfy the requirement version
|
// check whether pythonVirtualEnv is stisfy the requirement version
|
||||||
const devchatAskVersion = getPackageVersion(pythonVirtualEnv, "devchat-ask");
|
const devchatAskVersion = getPackageVersion(pythonVirtualEnv, "devchat-ask");
|
||||||
if (!devchatAskVersion || devchatAskVersion < "0.1.3") {
|
if (!devchatAskVersion || devchatAskVersion < "0.1.7") {
|
||||||
pythonVirtualEnv = undefined;
|
pythonVirtualEnv = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import { logger } from "../logger";
|
|||||||
export async function installAskCode(): Promise<string> {
|
export async function installAskCode(): Promise<string> {
|
||||||
try {
|
try {
|
||||||
logger.channel()?.info(`start installing AskCode with python=3.11.4 ...`);
|
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');
|
const pythonCommand = await appInstall("devchat-ask", devchatAskVersion, '3.11.4');
|
||||||
if (!pythonCommand) {
|
if (!pythonCommand) {
|
||||||
logger.channel()?.error(`failed to install devchat-ask with python=3.11.4`);
|
logger.channel()?.error(`failed to install devchat-ask with python=3.11.4`);
|
||||||
|
@ -228,14 +228,20 @@ You can configure DevChat from [Settings](#settings).`;
|
|||||||
message: userMessage
|
message: userMessage
|
||||||
});
|
});
|
||||||
const isInstalled = yield isDevChatInstalled();
|
const isInstalled = yield isDevChatInstalled();
|
||||||
|
|
||||||
if (isInstalled){
|
if (isInstalled){
|
||||||
self.disabled = true;
|
// self.disabled = true;
|
||||||
self.errorMessage = '';
|
// self.errorMessage = '';
|
||||||
self.messages.push({
|
// self.messages.push({
|
||||||
type: 'bot',
|
// type: 'bot',
|
||||||
message: '',
|
// message: '',
|
||||||
confirm: true
|
// confirm: true
|
||||||
});
|
// });
|
||||||
|
self.messages.push({
|
||||||
|
type: 'bot',
|
||||||
|
message: ''
|
||||||
|
});
|
||||||
|
startGenerating(userMessage, chatContexts);
|
||||||
} else {
|
} else {
|
||||||
self.messages.push({
|
self.messages.push({
|
||||||
type: 'bot',
|
type: 'bot',
|
||||||
|
2
tools
2
tools
@ -1 +1 @@
|
|||||||
Subproject commit 782ec455d62cae6dc0f94f5f977330d14d0637b8
|
Subproject commit ce89bf904f70acd832d70cd564d763df18b09504
|
Loading…
x
Reference in New Issue
Block a user