Skip to content

Commit

Permalink
Merge private-agent-modal with web-app
Browse files Browse the repository at this point in the history
  • Loading branch information
wadhia-yash committed Sep 22, 2024
2 parents d5def36 + 5f766ab commit a8a46bd
Show file tree
Hide file tree
Showing 9 changed files with 1,414 additions and 537 deletions.
1 change: 0 additions & 1 deletion vscode/media/command-deck/command-deck.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ class CommandDeck {
this.ref.innerHTML = textContent.substring(0, atIndex) + textContent.substring(atIndex + 1);
}
if (option?.name.startsWith('@')) {
console.log('agents options', option?.metadata);
activeAgentAttach.style = "color: #497BEF; !important";

agentName = option?.metadata.display_name;
Expand Down
1 change: 0 additions & 1 deletion vscode/media/onboarding/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,6 @@ function handleSubmit(event) {
} else {

matchingItems = getAgents().filter(item => {
console.log('name', item);
return item.search?.toLowerCase().startsWith(query.toLowerCase());
});
}
Expand Down
46 changes: 19 additions & 27 deletions vscode/src/providers/chat_view_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
// StorageManager.instance.deleteAgents();

webviewView.onDidChangeVisibility(() => {
console.log("webview", webviewView.visible);
if (webviewView.visible && this._view) {
this._view?.webview.postMessage({ type: "focusChatInput" });
}
Expand Down Expand Up @@ -454,6 +453,7 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
private: false,
};
try {
console.log(JSON.stringify(data));
const modelResponse = await makeHttpRequest<{ response: string, references: Array<string> }>({
url: "https://api.commanddash.dev/v2/ai/agent/answer",
method: "post",
Expand All @@ -468,19 +468,15 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
value: this._publicConversationHistory,
});
} catch (error) {
this._publicConversationHistory.push({
[this._activeAgent]: {
role: "error",
text:
error instanceof Error
? (error as Error).message
: (error as any).toString(),
},
});
this._view?.webview.postMessage({
type: "displayMessages",
value: this._publicConversationHistory,
});
// this._publicConversationHistory.push({
// [this._activeAgent]: {
// role: "error",
// text:
// error instanceof Error
// ? (error as Error).message
// : (error as any).toString(),
// },
// });
} finally {
this?._view?.webview?.postMessage({ type: "hideLoadingIndicator" });
}
Expand Down Expand Up @@ -730,19 +726,15 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
} catch (error) {
console.error(error);
logError("command-deck-conversation-error", error);
this._publicConversationHistory.push({
[this._activeAgent]: {
role: "error",
text:
error instanceof Error
? (error as Error).message
: (error as any).toString(),
},
});
this._view?.webview.postMessage({
type: "displayMessages",
value: this._publicConversationHistory,
});
// this._publicConversationHistory.push({
// [this._activeAgent]: {
// role: "error",
// text:
// error instanceof Error
// ? (error as Error).message
// : (error as any).toString(),
// },
// });
} finally {
this._view?.webview.postMessage({ type: "hideLoadingIndicator" });
this._view?.webview.postMessage({
Expand Down
Loading

0 comments on commit a8a46bd

Please sign in to comment.