deepset-ai / haystack

:mag: AI orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
16.94k stars 1.85k forks source link

fix: Document object dict #8251 #8252

Closed jlonge4 closed 1 month ago

jlonge4 commented 1 month ago

Related Issues

Proposed Changes:

This PR addresses the TypeError that occurs when trying to insert DocX converted document objects into PGVector or when using json.dumps() on docs.to_dict() output. The issue is caused by datetime objects not being JSON serializable.

Changes made:

How did you test it?

Notes for the reviewer

My thoughts are to fix this in a two PR effort. This being the first and a separate PR in haystack-core-integrations to address the problem there. Potentially the default_to_dict() function.

Checklist

jlonge4 commented 1 month ago

@anakin87 There may be an entirely more efficient way of doing this as well

julian-risch commented 1 month ago

@jlonge4 Thank you for opening this pull request! @anakin87 May I ask you to take over this review please?