Skip to content

Commit

Permalink
fix(Install agents): Bypassing the api to install agents and directly…
Browse files Browse the repository at this point in the history
… installing from the get-agent-list api
  • Loading branch information
wadhia-yash committed Sep 9, 2024
1 parent cee7738 commit 00f7a47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions vscode/media/onboarding/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ async function submitResponse() {
if (checkValueExists(agentsData.registered_inputs)) {
const currentAgentData = data.find((agent) => agent.name === currentActiveAgent);
toggleLoader(true);
vscode.postMessage({ type: "agents", value: { data: { ...agentsData, agent: currentActiveAgent, agent_version: currentAgentData?.version, testing: currentAgentData?.testing, metadata: currentAgentData?.metadata }, isCommandLess: false } });
vscode.postMessage({ type: "agents", value: { data: { ...agentsData, agent: currentActiveAgent, agent_version: currentAgentData?.version ?? currentAgentData.versions[0].version, testing: currentAgentData?.testing, metadata: currentAgentData?.metadata }, isCommandLess: false } });

questionnaireContainer.classList.add("hidden");
textInput.textContent = "";
Expand All @@ -995,7 +995,7 @@ async function submitResponse() {
commandLessData.prompt = value;

const activeAgentData = data.find(agent => agent.name === currentActiveAgent);
const commandLess = { agent_version: activeAgentData.version, agent: activeAgentData.name, chat_mode: activeAgentData?.chat_mode, ...commandLessData, testing: activeAgentData?.testing, metadata: activeAgentData?.metadata };
const commandLess = { agent_version: activeAgentData.version ?? activeAgentData.versions[0].version, agent: activeAgentData.name, chat_mode: activeAgentData?.chat_mode, ...commandLessData, testing: activeAgentData?.testing, metadata: activeAgentData?.metadata };
vscode.postMessage({ type: "agents", value: { data: { ...commandLess }, isCommandLess: true } });
questionnaireContainer.classList.add("hidden");
textInput.textContent = "";
Expand Down
16 changes: 8 additions & 8 deletions vscode/src/providers/chat_view_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
try {
const { value } = data;
const _parsedAgent = JSON.parse(value);
const agentDetails = ((await this._fetchAgent(
_parsedAgent.name,
_parsedAgent.versions[0].version,
_parsedAgent.testing
)) as any) ?? { agent: { name: "", version: "" } };
this._storingAgentsLocally(agentDetails);
// const agentDetails = ((await this._fetchAgent(
// _parsedAgent.name,
// _parsedAgent.versions[0].version,
// _parsedAgent.testing
// )) as any) ?? { agent: { name: "", version: "" } };
this._storingAgentsLocally(_parsedAgent);
} catch (error) {
console.error("Error installing agents:", error);
}
Expand Down Expand Up @@ -360,7 +360,7 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
...agentDetails,
name: `@${name}`,
search: `@${metadata.display_name}`,
supported_commands: agentDetails?.supported_commands.map(
supported_commands: agentDetails?.supported_commands?.map(

Check warning on line 363 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `supported_commands` must match one of the following formats: camelCase
(command: any) => ({
...command,
slug: `/${command.slug}`,
Expand Down Expand Up @@ -448,7 +448,7 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider {
const agentName = agentResponse["agent"];
const data = {
agent_name: agentName.split("@")[1],

Check warning on line 450 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `agent_name` must match one of the following formats: camelCase
agent_version: agentResponse["agent_version"],
agent_version: agentResponse["agent_version"] ?? "1.0.0",

Check warning on line 451 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `agent_version` must match one of the following formats: camelCase
chat_history: conversationHistory,

Check warning on line 452 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `chat_history` must match one of the following formats: camelCase
included_references: conversationReference.length > 0 ? conversationReference[conversationReference.length - 1].references : [],

Check warning on line 453 in vscode/src/providers/chat_view_provider.ts

View workflow job for this annotation

GitHub Actions / lint

Object Literal Property name `included_references` must match one of the following formats: camelCase
private: false,
Expand Down

0 comments on commit 00f7a47

Please sign in to comment.