Describe the bug
In the current implementation, the ChatCompletionAgent returns only the final assistant response, the functions messages are appended to the channel's chat history.
So the ChatHistoryChannel returns to the AgentChat (and broadcast to the other channels) only the final assistant response.
Therefor the user, that creates the AgentChat, doesn't have access to the functions invocation.
Expected behavior
- All the messages that the ChatCompletionAgent creates during its invocation should be appended to the AgentChat's history.
- The ChatHistoryChannel shouldn't broadcast the function messages to the other channel as they aren't relevant to them and also not necessarily valid to them.
- Might need to filter the function messages when creating a new channel.
Additional context
Another thing that should be considered -
IAutoFunctionFilterInvocation enables terminating the function calling loop. In such cases the ChatCompletion returns to the caller the last function response (this response is also appended to the channel history).
Therefor the response's role should be checked before:
- Adding the chat completion response to the channel chat history (to avoid duplication).
- Broadcasting the chat completion response to the other channels (to not send them function response).
Platform
OS: Windows
IDE: Visual Studio,
Language: C#
Source: SK NuGet package version 1.15.1
Describe the bug
In the current implementation, the ChatCompletionAgent returns only the final assistant response, the functions messages are appended to the channel's chat history.
So the ChatHistoryChannel returns to the AgentChat (and broadcast to the other channels) only the final assistant response.
Therefor the user, that creates the AgentChat, doesn't have access to the functions invocation.
Expected behavior
Additional context
Another thing that should be considered -
IAutoFunctionFilterInvocation enables terminating the function calling loop. In such cases the ChatCompletion returns to the caller the last function response (this response is also appended to the channel history).
Therefor the response's role should be checked before:
Platform
OS: Windows
IDE: Visual Studio,
Language: C#
Source: SK NuGet package version 1.15.1