From 061991c792478a62726867bf82931b33ec552182 Mon Sep 17 00:00:00 2001 From: akash Date: Thu, 19 Feb 2026 23:30:05 +0800 Subject: [PATCH] Update item type check for workflow actions As per SDK, package name correction and item payload correction. Else there will be error indicates event.item is None when you try to access event.item.type. Add a null check before comparing the type --- .../samples/agents/sample_workflow_multi_agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py index 65e51a97aa6c..b75031d328b7 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent.py @@ -31,7 +31,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, WorkflowAgentDefinition, - ItemResourceType, + ItemResource, ) load_dotenv() @@ -157,7 +157,7 @@ print(f"Event {event.sequence_number} type '{event.type}'", end="") if ( event.type == "response.output_item.added" or event.type == "response.output_item.done" - ) and event.item.type == ItemResourceType.WORKFLOW_ACTION: + ) and event.item is not None and event.item.type == "workflow_action": print( f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", end="",