Skip to content

Python: AzureAIClient fails within GroupChatBuilder #2976

@LazaUK

Description

@LazaUK

AzureAIClient works perfectly when you build Agents. However, not all classes in Workflow area support it properly. Below are the findings:

Summary

AzureAIClient works with WorkflowBuilder but fails with GroupChatBuilder on the second round.

Error

Error code: 400 - {'error': {'code': 'invalid_payload', 'details': [  {'message': 'required: Required properties ["annotations"] are not present', 'param': '/input/1/content/0'}]}}

Root Cause

Azure AI Foundry Responses API requires annotations field in agent messages. When GroupChatBuilder rebuilds conversation history, it somehow omits that field:

Plain Text

// Sent (missing "annotations"): {"role": "assistant", "content": [{"type": "output_text", "text": "..."}]}
// Required: {"role": "assistant", "content": [{"type": "output_text", "text": "...", "annotations": []}]}

First round succeeds (user message only). Second round fails (includes assistant history).

Workaround

Using AzureOpenAIChatClient instead of AzureAIClient for Group Chat workflows.

Suggested Fix

Ensure AzureAIClient adds empty annotations: [] to agent messages when formatting conversation history in Workflows.

Metadata

Metadata

Assignees

Labels

pythonv1.0Features being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-framework

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions