File size: 662 Bytes
4fb906a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

import asyncio
from app.knowledge.graph.graph_query_service import GraphQueryService
from app.core.database import init_db
from app.models.project import Project

async def main():
    await init_db()
    projects = await Project.find_all().to_list()
    print("Found projects:")
    for p in projects:
        print(f"- {p.id}: {p.name}")
        if p.id:
            try:
                tree = await GraphQueryService.get_project_graph_tree(str(p.id))
                print(f"Graph tree: {tree}")
            except Exception as e:
                print(f"Error getting graph: {e}")

if __name__ == "__main__":
    asyncio.run(main())