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 issues in IChatClient implementations #5549

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Oct 22, 2024

  • Avoid null arg exception when constructing system message with null text
  • Avoid empty exception when constructing user message with no parts
  • Use all parts rather than just first text part for system message
  • Handle assistant messages with both content and tools
  • Avoid unnecessarily trying to weed out duplicate call ids
Microsoft Reviewers: Open in CodeFlow

- Avoid null arg exception when constructing system message with null text
- Avoid empty exception when constructing user message with no parts
- Use all parts rather than just first text part for system message
- Handle assistant messages with both content and tools
- Avoid unnecessarily trying to weed out duplicate call ids
- Normalize null to string.Empty in TextContent
- Ensure GetContentParts always produces at least one part, even if empty text content
@stephentoub stephentoub merged commit 7cac12b into dotnet:main Oct 22, 2024
6 checks passed
@stephentoub stephentoub deleted the fixclients branch October 22, 2024 15:11
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants