MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / _invoke_graph

Method _invoke_graph

runner/task_runner.py:152–167  ·  view source on GitHub ↗
(self, graph: Any, state: Any, recursion_limit: int)

Source from the content-addressed store, hash-verified

150 return "failed"
151
152 def _invoke_graph(self, graph: Any, state: Any, recursion_limit: int) -> Any:
153 try:
154 import nest_asyncio
155
156 nest_asyncio.apply()
157 except ImportError:
158 pass
159
160 coro = graph.ainvoke(state, config={"recursion_limit": recursion_limit})
161 try:
162 return asyncio.run(coro)
163 except RuntimeError as exc:
164 if "asyncio.run() cannot be called from a running event loop" not in str(exc):
165 raise
166 loop = asyncio.get_event_loop()
167 return loop.run_until_complete(coro)

Callers 1

runMethod · 0.95

Calls 2

applyMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected