From 3cd67194087d242d05480c745ba47fc8f916f160 Mon Sep 17 00:00:00 2001 From: isamu Date: Fri, 21 Jun 2024 20:54:01 +0900 Subject: [PATCH] run --- package.json | 4 ++-- src/views/Home.vue | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c06edf8..aace0e0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/views/Home.vue b/src/views/Home.vue index 5db570f..5e68bf3 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -8,6 +8,7 @@ + @@ -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"; @@ -80,12 +83,20 @@ export default defineComponent({ liteGraph.configure(defaultData); } }; + const runGraph = async () => { + const data = liteGraph.serialize(); + 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, }; }, });