Python: [BREAKING] consolidate workflow run APIs (#1723)

* consolidate workflow run apis

* improve validation, add tests

* Proper code tags for docs

* Update sample output

* Remove cycle validation

* PR feedback

* Validation

* Cleanup
This commit is contained in:
Evan Mattson
2025-11-04 08:34:59 +09:00
committed by GitHub
Unverified
parent b0ee7028a6
commit 50d9b13bfc
26 changed files with 722 additions and 477 deletions
@@ -261,17 +261,21 @@ async def main() -> None:
pending_responses: dict[str, str] | None = None
completed = False
initial_run = True
while not completed:
last_executor: str | None = None
stream = (
workflow.send_responses_streaming(pending_responses)
if pending_responses is not None
else workflow.run_stream(
if initial_run:
stream = workflow.run_stream(
"Create a short launch blurb for the LumenX desk lamp. Emphasize adjustability and warm lighting."
)
)
pending_responses = None
initial_run = False
elif pending_responses is not None:
stream = workflow.send_responses_streaming(pending_responses)
pending_responses = None
else:
break
requests: list[tuple[str, DraftFeedbackRequest]] = []
async for event in stream: