Replies: 2 comments 1 reply
-
Hi @khanetor ,Thanks for reaching out. |
Beta Was this translation helpful? Give feedback.
-
Hi @khanetor we also have this function- def get_step_content(self, step_name: str) -> Optional[Union[str, Dict[str, str]]]:
"""Get content from a specific previous step by name
For parallel steps, if you ask for the parallel step name, returns a dict
with {step_name: content} for each sub-step.
For other nested steps (Condition, Router, Loop, Steps), returns the deepest content.
""" so if you do get_step_content() you should see them all |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a workflow with a Parallel step as the final step, and when I call
print_response
, I can see the outputs of all substeps in the parallel step. However, when I callrun
, I only get the output of the last substep in the parallel step. I saw in the Parallel workflow examples that there is an agent after the parallel step to synthesise the result, but I don't want to waste another agent and llm call to do this, to save cost, and to avoid sending lots of text to llm to do something very trivial, and risk having the content modified. So I have the last step as a function instead. In this function, when callingcontext.get_last_step_content
, I also saw the output of the last substep output.Eventually, I managed this with
This seems unintuitive to me, because we usually expect the output of a Parallel step is a list. Do we have a more elegant way to get the list of outputs of a Parallel step?
Beta Was this translation helpful? Give feedback.
All reactions