Skip to content

Commit

Permalink
run
Browse files Browse the repository at this point in the history
  • Loading branch information
isamu committed Jun 21, 2024
1 parent 99de9d6 commit 3cd6719
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"format": "prettier --write '{src/**/*,*}.{js,ts,vue,json}'"
},
"dependencies": {
"@graphai/vanilla": "^0.0.5",
"@graphai/vanilla": "^0.0.6",
"@vueuse/head": "^1.0.16",
"core-js": "^3.25.2",
"firebase": "^10.7.1",
"graphai": "^0.5.1",
"graphai": "^0.5.2",
"litegraph.js": "^0.7.18",
"pinia": "^2.1.7",
"vue": "^3.4.4",
Expand Down
13 changes: 12 additions & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<button @click="load" class="border-2 border-blue-200">Load</button>
<button @click="reset" class="border-2 border-blue-200">Reset</button>
<button @click="download" class="border-2 border-blue-200">Download</button>
<button @click="runGraph" class="border-2 border-blue-200">Run</button>
</div>
</template>

Expand All @@ -20,7 +21,9 @@ import "litegraph.js/css/litegraph.css";
import { liteGraph2GraphData } from "../utils/toGraphAi";
import { LiteGraph, setAgentToLiteGraph } from "../utils/setAgentToLiteGraph";
// import * as vanillaAgents from "@graphai/vanilla";
import { GraphAI } from "graphai";
import * as vanillaAgents from "@graphai/vanilla";
import { agentlist } from "../utils/agentlist";
import { defaultData } from "../utils/defaultData";
Expand Down Expand Up @@ -80,12 +83,20 @@ export default defineComponent({
liteGraph.configure(defaultData);
}
};
const runGraph = async () => {
const data = liteGraph.serialize();

Check failure on line 87 in src/views/Home.vue

View workflow job for this annotation

GitHub Actions / build (20.x)

'liteGraph' is possibly 'undefined'.
const graphData = liteGraph2GraphData(data, lite2graph as any);
const graphAI = new GraphAI(graphData, vanillaAgents);
const res = await graphAI.run(true);
console.log(res);
};
return {
download,
canvasRef,
save,
load,
reset,
runGraph,
};
},
});
Expand Down

0 comments on commit 3cd6719

Please sign in to comment.