Open EdenTanami opened 1 week ago
I believe you'll find this issue has been resolved as part of:
https://github.com/microsoft/semantic-kernel/pull/6956
We are publishing a new nuget package today. Can you please retry and verify the current result?
I do see the original root cause here:
It appears this logic was introduced a few weeks ago in this PR:
https://github.com/microsoft/semantic-kernel/pull/6449
Note: I plan bring the code you've highlighted into a consistent state as part of my active work stream...even though it should be effectively mitigated.
Describe the bug According to the code of the AgenGroupChat's base abstract class - AgentChat, the group chat InvokeAsync should add to the History all the messages yielded by the agent and return to its caler only the assistant response (not tools related messages). In practice, calling agentGroupChat.InvokeAsync returns both the final assistance response and the messages with tool role.
I reviewed the AgentChat code and saw that the condition of the returned messages is:
The if condition might be the problem - I saw that in my function response message there are 2 items, one isn't from the mentioned types-
![image](https://github.com/microsoft/semantic-kernel/assets/160887465/4adbff44-cda7-47aa-bff4-c93e78aa0f60)
To Reproduce Steps to reproduce the behavior:
Expected behavior Only final assistant response returns from the groupChat InvokeAsync.
Screenshots![image](https://github.com/microsoft/semantic-kernel/assets/160887465/51baeaa7-3a7a-402d-85e0-2a58309231c2)
Platform OS: Windows IDE: Visual Studio, Language: C# Source: SK NuGet package version 1.15.0