Closed blakerosenthal closed 3 months ago
@pmeier Mypy points out that you can't construct a ragna.core.Document
from a schema.Document
because it's missing the metadata
field. I see a couple ways around that:
metadata
field to schema.Document
, although it seems like that might interact weirdly with the multi-document code that's strewn around that keeps the documents and metadata separate. It would create some redundancies to clean up, but I think it could be nice to just have metadata on the schema object.schema_to_core_chat
kind of like the functions found in database.py
.I'm leaning toward option 1 unless there's a simpler way.
Ah yeah, I'm hitting the same on a another branch as well. I agree we should go with option 1 especially in the light of #256.
No need to duplicate work here. Just set metadata={}
and add a comment that this will be resolved later.
Basic prereq for passing chat history down the pipeline. History is already present in the
schema.Chat
object loaded from the database, so we just need to make sure it also gets loaded into theragna.core.Chat
object inside schema_to_core_chat.https://github.com/Quansight/ragna/blob/647a61e3103cb2e54b7c5bc2da5df1e2906b059b/ragna/deploy/_api/core.py#L290-L297