mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fix workflow samples for bugbash: part 2 (#4061)
This commit is contained in:
committed by
GitHub
Unverified
parent
21769e2cd1
commit
396807ab17
+1
-6
@@ -8,7 +8,6 @@ from typing import Any
|
||||
|
||||
from agent_framework import (
|
||||
Agent,
|
||||
AgentResponseUpdate,
|
||||
Content,
|
||||
FileCheckpointStorage,
|
||||
Workflow,
|
||||
@@ -120,7 +119,6 @@ def print_handoff_agent_user_request(request: HandoffAgentUserRequest, request_i
|
||||
print(f"\n{'=' * 60}")
|
||||
print("User input needed")
|
||||
print(f"Request ID: {request_id}")
|
||||
print(f"Awaiting agent: {request.agent_response.agent_id}")
|
||||
|
||||
response = request.agent_response
|
||||
if not response.messages:
|
||||
@@ -207,7 +205,7 @@ async def main() -> None:
|
||||
# This creates a new workflow instance to simulate a fresh process start,
|
||||
# but points it to the same checkpoint storage
|
||||
while request_events:
|
||||
print("=" * 60)
|
||||
print("\n" + "=" * 60)
|
||||
print("Simulating process restart...")
|
||||
print("=" * 60)
|
||||
|
||||
@@ -240,11 +238,8 @@ async def main() -> None:
|
||||
# Iterate through streamed events and collect request_info events
|
||||
request_events: list[WorkflowEvent] = []
|
||||
async for event in results:
|
||||
event: WorkflowEvent
|
||||
if event.type == "request_info":
|
||||
request_events.append(event)
|
||||
elif event.type == "output" and isinstance(event.data, AgentResponseUpdate):
|
||||
print(event.data.text, end="", flush=True)
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
print("DEMO COMPLETE")
|
||||
|
||||
Reference in New Issue
Block a user