Language
.NET
Type of Issue
Bug
Microsoft.Agents.AI
dotnet-1.0.0-preview.251219.1
Microsoft.Agents.AI.Abstractions
No response
Microsoft.Agents.AI.OpenAI
No response
Microsoft.Agents.AI.AzureAI
No response
Microsoft.Agents.AI.Anthropic
No response
Microsoft.Agents.AI.Hosting
No response
Microsoft.Agents.AI.Workflows
No response
Other .NET Packages
No response
agent-framework-core
No response
agent-framework-azure-ai
No response
agent-framework-anthropic
No response
agent-framework-azurefunctions
No response
Other Python Packages
No response
Description
In non-streaming mode: When adding AdditionalProperties to the ChatResponse in the GetResponseAsync method of a IChatClient implementation, the AdditionalProperties are stored correctly in a message store.
In streaming mode: When adding AdditionalProperties to a ChatResponseUpdate in the GetStreamingResponseAsync method of a IChatClient implementation, the AdditionalProperties are not stored in the message store.
The reason is as follows:
- The list of
ChatResponseUpdates gets converted to a ChatResponse object (https://github.com/microsoft/agent-framework/blob/dotnet-1.0.0-preview.251219.1/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs#L268).
- However, the conversion method only adds the
AdditionalProperties to the ChatResponse and not the underlying list of ChatMessage objects (https://github.com/dotnet/extensions/blob/v10.0.0/src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseExtensions.cs#L581-L591).
- Then, these chat messages without the additional properties are sent to the message store (https://github.com/microsoft/agent-framework/blob/dotnet-1.0.0-preview.251219.1/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs#L275).
I wasn't entirely sure if I should create an issue directly in Microsoft.Extensions.AI.Abstractions, I wanted to at least leave a trace here to justify the need.
Let me know how to proceed.
Code Sample
Additional Context
No response
Language
.NET
Type of Issue
Bug
Microsoft.Agents.AI
dotnet-1.0.0-preview.251219.1
Microsoft.Agents.AI.Abstractions
No response
Microsoft.Agents.AI.OpenAI
No response
Microsoft.Agents.AI.AzureAI
No response
Microsoft.Agents.AI.Anthropic
No response
Microsoft.Agents.AI.Hosting
No response
Microsoft.Agents.AI.Workflows
No response
Other .NET Packages
No response
agent-framework-core
No response
agent-framework-azure-ai
No response
agent-framework-anthropic
No response
agent-framework-azurefunctions
No response
Other Python Packages
No response
Description
In non-streaming mode: When adding
AdditionalPropertiesto theChatResponsein theGetResponseAsyncmethod of aIChatClientimplementation, theAdditionalPropertiesare stored correctly in a message store.In streaming mode: When adding
AdditionalPropertiesto aChatResponseUpdatein theGetStreamingResponseAsyncmethod of aIChatClientimplementation, theAdditionalPropertiesare not stored in the message store.The reason is as follows:
ChatResponseUpdatesgets converted to aChatResponseobject (https://github.com/microsoft/agent-framework/blob/dotnet-1.0.0-preview.251219.1/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs#L268).AdditionalPropertiesto theChatResponseand not the underlying list ofChatMessageobjects (https://github.com/dotnet/extensions/blob/v10.0.0/src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseExtensions.cs#L581-L591).I wasn't entirely sure if I should create an issue directly in
Microsoft.Extensions.AI.Abstractions, I wanted to at least leave a trace here to justify the need.Let me know how to proceed.
Code Sample
Additional Context
No response