-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
26 lines (23 loc) · 945 Bytes
/
app.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
from langgraph.checkpoint.memory import MemorySaver
from cheese.workflow_builder import WorkflowBuilder
from cheese.config.config_graph import ConfigGraph
from cheese.entity.models.stategraph import SharedState
from cheese.entity.models.inputgraph import InputState
from cheese.entity.models.outputgraph import OutputState
from cheese.utils.common import read_yaml
from cheese.utils.logger import setup_logging
from cheese.constants import *
## Read the config.yaml
config = read_yaml(CONFIG_FILE_PATH)
## Setup logging Configuration
setup_logging(config)
## Workflow Configuration for the main graph
workflow_builder = WorkflowBuilder(
config=ConfigGraph,
state_schema=SharedState,
input=InputState,
output=OutputState,
checkpointer=MemorySaver(),
)
main_graph = workflow_builder.compile() # compile the graph
workflow_builder.display_graph(save=True, filepath="artifacts/cheese_graph.png") # update the graph artifact