Skip to content

.Net: Bug: ChatCompletionAgent does not add FunctionResults to chat history when streaming #13254

@westey-m

Description

@westey-m

Describe the bug
When using ChatCompletionAgent for streaming, FunctionResultContent is not getting added to the chat history.

To Reproduce
Steps to reproduce the behavior:

  1. Create a ChatCompletionAgent that uses a ChatClientChatCompletionService that uses a IChatClient decorated with the FuncionInvokingChatClient
  2. Make a streaming request with function tools.
  3. Inspect the produced chat history.
  4. The chat history contains the input message, result message, the function call content, but no function result content.

Expected behavior
The chat history also contains the function result content.

Screenshots

Platform

  • Language: C#
  • AI model: Azure OpenAI ChatCompletion

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't working

Type

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions