-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeagentsbugSomething isn't workingSomething isn't working
Description
Describe the bug
When using the InvokeStreamingAsync method of ChatCompletionAgent, and receiving multi-turn conversation responses in the OnIntermediateMessage, it was found that the final assistant message included previous assistant messages. It appears that the last message accumulates all previous assistant messages. I am not sure if this is a bug, but it has caused confusion during usage.
To Reproduce
Steps to reproduce the behavior:
Define a ChatAgent with provided tools.
ChatCompletionAgent agent = new()
{
Instructions = processRequest.AgentRequest.Instructions,
Kernel = processRequest.Kernel,
HistoryReducer = new ChatHistoryTruncationReducer(6, 4),
Arguments = new KernelArguments(new OpenAIPromptExecutionSettings
{
Temperature = 0,
FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(functions: processRequest.AgentRequest.Functions, autoInvoke: processRequest.AgentRequest.Functions?.Count > 0, options: new() { RetainArgumentTypes = true })
})
};
Receive messages in OnIntermediateMessage and notice overlapping data.
Expected behavior
Each message should be independent and non-repetitive.
Platform
Language: C#
Source: 1.56.0
IDE: Visual Studio
OS: Windows
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeagentsbugSomething isn't workingSomething isn't working
Type
Projects
Status
No status