Skip to content

The agent engineering platform.

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

Martin Triska8dc4bec9477e
diff --git a/libs/community/langchain_community/document_loaders/base_o365.py b/libs/community/langchain_community/document_loaders/base_o365.py
index b0d44e7724..44002842bf 100644
--- a/libs/community/langchain_community/document_loaders/base_o365.py
+++ b/libs/community/langchain_community/document_loaders/base_o365.py
@@ -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,