update invoke
This commit is contained in:
@@ -59,7 +59,13 @@ class RoutingGraph(GraphBase):
|
|||||||
def invoke(self, *nargs, as_stream:bool=False, **kwargs):
|
def invoke(self, *nargs, as_stream:bool=False, **kwargs):
|
||||||
assert len(kwargs) == 0, "due to inp assumptions"
|
assert len(kwargs) == 0, "due to inp assumptions"
|
||||||
|
|
||||||
state = self.workflow.invoke({"inp": nargs})
|
if as_stream:
|
||||||
|
for step in self.workflow.stream({"inp": nargs}, stream_mode="values", **kwargs):
|
||||||
|
step["messages"][-1].pretty_print()
|
||||||
|
state = step
|
||||||
|
else:
|
||||||
|
state = self.workflow.invoke({"inp": nargs})
|
||||||
|
|
||||||
return state["output"]
|
return state["output"]
|
||||||
|
|
||||||
def _build_modules(self):
|
def _build_modules(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user