[community] [Bugfix] base_o365 document loader metadata needs to be JSON serializable (#26322)

In order for indexer to work, all metadata in the documents need to be
JSON serializable. Timestamps are not.

See here:

https://github.com/langchain-ai/langchain/blob/master/libs/core/langchain_core/indexing/api.py#L83-L89

@eyurtsev could you please review? It's a tiny PR :-)
This commit is contained in:
Martin Triska 2024-10-14 18:48:31 +02:00 committed by GitHub
parent de62d02102
commit 8dc4bec947
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,8 +118,8 @@ class O365BaseLoader(BaseLoader, BaseModel):
metadata_dict[file.name] = {
"source": file.web_url,
"mime_type": file.mime_type,
"created": file.created,
"modified": file.modified,
"created": str(file.created),
"modified": str(file.modified),
"created_by": str(file.created_by),
"modified_by": str(file.modified_by),
"description": file.description,