forked from SylphAI-Inc/AdalFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchitecture_generator.py
64 lines (52 loc) · 1.88 KB
/
architecture_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from diagrams import Diagram, Cluster, Edge
from diagrams.programming.language import Python
from diagrams.onprem.database import PostgreSQL
from diagrams.generic.storage import Storage
def generate_architecture():
"""Generate architecture diagram for AdalFlow project."""
graph_attr = {
"fontsize": "30",
"bgcolor": "white",
"splines": "ortho",
"pad": "0.5"
}
node_attr = {
"fontsize": "14"
}
with Diagram(
"AdalFlow Architecture",
show=False,
direction="TB",
graph_attr=graph_attr,
node_attr=node_attr,
filename="architecture",
outformat="png"
):
with Cluster("Core"):
core = Python("Core Engine")
with Cluster("Data Processing"):
datasets = Python("Datasets")
optim = Python("Optimization")
eval_comp = Python("Evaluation")
with Cluster("Infrastructure"):
database = PostgreSQL("Database")
tracing = Storage("Tracing")
with Cluster("Components"):
components = Python("Components")
utils = Python("Utils")
# Core connections
core >> Edge(color="darkgreen") >> datasets
core >> Edge(color="darkgreen") >> optim
core >> Edge(color="darkgreen") >> eval_comp
core >> Edge(color="darkblue") >> components
# Infrastructure connections
components >> Edge(color="red") >> database
datasets >> Edge(color="red") >> database
# Tracing connections
optim >> Edge(color="orange") >> tracing
eval_comp >> Edge(color="orange") >> tracing
# Utils connections
utils >> Edge(style="dotted") >> components
utils >> Edge(style="dotted") >> core
if __name__ == "__main__":
generate_architecture()