deepset-ai / haystack-experimental

🧪 Experimental features for Haystack
https://haystack.deepset.ai
Apache License 2.0
23 stars 9 forks source link

fix: OpenAI Chat Generator - do not create `TextContent` if `content` is `None`; make Anthropic Chat Generator more robust #129

Closed anakin87 closed 1 week ago

anakin87 commented 2 weeks ago

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 commented 2 weeks ago

Pull Request Test Coverage Report for Build 11663103763

Details


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

💛 - Coveralls
vblagoje commented 2 weeks ago

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

anakin87 commented 2 weeks ago

We don't have Reno in this repository.

vblagoje commented 2 weeks ago

We don't have Reno in this repository.

Sorry, too many context switches for me 🤦

anakin87 commented 2 weeks ago

I put this on draft...

After more experimentation, I think we should also make Anthropic more robust.

UPDATE: done