Spaces:
Sleeping
Sleeping
Download agent/graph.py from andy88836/mofscreen-agent-api: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/andy88836/mofscreen-agent-api/resolve/main/agent/graph.py
- Command line
-
hf download hf://spaces/andy88836/mofscreen-agent-api/agent/graph.py
-
curl -L -o graph.py https://huggingface.co/spaces/andy88836/mofscreen-agent-api/resolve/main/agent/graph.py
1.01 kB
| """Screening workflow assembly for the MOF six-step pipeline.""" | |
| from agent import nodes | |
| from agent.state import ScreeningState | |
| class SimpleScreeningApp: | |
| """Small invoke-compatible workflow used when LangGraph is unavailable.""" | |
| def invoke(self, state: ScreeningState) -> ScreeningState: | |
| current: ScreeningState = dict(state) | |
| for node in (nodes.ingest_cif, nodes.six_step_screening_agent): | |
| update = node(current) | |
| current.update(update) | |
| return current | |
| def build_graph(): | |
| try: | |
| from langgraph.graph import END, StateGraph | |
| g = StateGraph(ScreeningState) | |
| g.add_node("ingest_cif", nodes.ingest_cif) | |
| g.add_node("six_step_screening", nodes.six_step_screening_agent) | |
| g.set_entry_point("ingest_cif") | |
| g.add_edge("ingest_cif", "six_step_screening") | |
| g.add_edge("six_step_screening", END) | |
| return g.compile() | |
| except Exception: | |
| return SimpleScreeningApp() | |
| screening_app = build_graph() | |