Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/agent_patterns/parallelization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

async def main():
msg = input("Hi! Enter a message, and we'll translate it to Spanish.\n\n")
if not msg.strip():
raise ValueError("Input message cannot be empty.")

# Ensure the entire workflow is a single trace
with trace("Parallel translation"):
Expand All @@ -37,7 +39,6 @@ async def main():
msg,
),
)

outputs = [
ItemHelpers.text_message_outputs(res_1.new_items),
ItemHelpers.text_message_outputs(res_2.new_items),
Expand Down