-
Notifications
You must be signed in to change notification settings - Fork 960
Open
Labels
Description
When using Azure AI Agents with DevUI, the interface breaks during execution. The logs show:
Response status: 200 Response headers: 'Content-Type': 'text/event-stream; charset=utf-8' ... [CANCELLATION] Execution cancelled via CancelledError for resp_9af4a376 [CANCELLATION] Stream cancelled for resp_9af4a376
The DevUI Events panel shows thousands of output_text.delta events (2629+ in my case), and then the execution gets cancelled.
Here is the code I am using:
from agent_framework import WorkflowBuilder
from agent_framework.azure import AzureAIAgentClient
from src.executors.document_ingestion import DocumentIngestionExecutor
from src.agents.requirements_extraction import create_requirements_extraction_agent
def create_workflow(
chat_client: AzureAIAgentClient,
as_agent: bool = True
):
"""
This workflow processes uploaded documents and extracts structured requirements.
Workflow Flow:
User Input → DocumentIngestion → RequirementsExtraction → User Output (JSON)
Args:
chat_client: Azure AI agent client for creating agents
as_agent: If True, returns workflow.as_agent() for compatibility with container mode
Returns:
Workflow or workflow agent depending on as_agent parameter
"""
# Step 1: Create the document ingestion executor
document_ingestion = DocumentIngestionExecutor()
# Step 2: Create the requirements extraction agent
requirements_extraction = create_requirements_extraction_agent(chat_client)
# Step 3: Build the workflow
workflow = (
WorkflowBuilder(
name="Workflow",
description="Extracts structured requirements from documents",
)
.set_start_executor(document_ingestion)
.add_edge(document_ingestion, requirements_extraction)
.build()
)
return workflow.as_agent() if as_agent else workflow