Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few FunctionInvocationChatClient streaming issues #5680

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Nov 20, 2024

  • The non-streaming path explicitly throws if the response contains multiple choices. The streaming path wasn't doing the same and was instead silently producing bad results.
  • The streaming path was yielding function call content and adding them to the chat history. It should only have been doing the latter.

This fixes both issues. We also had close to zero test coverage in our FunctionInvocationChatClient tests for streaming, only for non-streaming. This also fixes that.

Microsoft Reviewers: Open in CodeFlow

- The non-streaming path explicitly throws if the response contains multiple choices. The streaming path wasn't doing the same and was instead silently producing bad results.
- The streaming path was yielding function call content _and_ adding them to the chat history. It should only have been doing the latter.

This fixes both issues. We also had close to zero test coverage in our FunctionInvocationChatClient tests for streaming, only for non-streaming. This also fixes that.
@stephentoub stephentoub merged commit 1a4a54f into dotnet:main Nov 20, 2024
6 checks passed
@stephentoub stephentoub deleted the fixficcstreaming branch November 20, 2024 19:06
stephentoub added a commit to stephentoub/extensions that referenced this pull request Nov 20, 2024
- The non-streaming path explicitly throws if the response contains multiple choices. The streaming path wasn't doing the same and was instead silently producing bad results.
- The streaming path was yielding function call content _and_ adding them to the chat history. It should only have been doing the latter.

This fixes both issues. We also had close to zero test coverage in our FunctionInvocationChatClient tests for streaming, only for non-streaming. This also fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants