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: OpenAI Chat Generator - do not create TextContent if content is None #129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anakin87
Copy link
Member

Related Issues

While experimenting in an application with several Chat Generators,
I encountered some errors passing ChatMessages generated by OpenAI to Anthropic.

Our implementation of OpenAI always creates a TextContent. Anthropic fails with empty text blocks.
I think we should not create a "" TextContent if content is None. We should simply avoid creating it

Proposed Changes:

Do not create TextContent if content is None.

How did you test it?

CI, enriched existing tests

Checklist

@coveralls
Copy link

coveralls commented Oct 31, 2024

Pull Request Test Coverage Report for Build 11615813337

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.461%

Totals Coverage Status
Change from base Build 11594818625: 0.0%
Covered Lines: 1859
Relevant Lines: 2078

💛 - Coveralls

@anakin87 anakin87 marked this pull request as ready for review October 31, 2024 16:21
@anakin87 anakin87 requested a review from a team as a code owner October 31, 2024 16:21
@anakin87 anakin87 requested review from shadeMe and vblagoje and removed request for a team October 31, 2024 16:21
@vblagoje
Copy link
Member

@anakin87 reno note so we remember and communicate this decision?

@anakin87
Copy link
Member Author

We don't have Reno in this repository.

@vblagoje
Copy link
Member

We don't have Reno in this repository.

Sorry, too many context switches for me 🤦

Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, let's see what @shadeMe says

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants