mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
community[patch]: Add support for authorized identities in PebbloSafeLoader. (#20055)
Description: Add support for authorized identities in PebbloSafeLoader. Now with this change, PebbloSafeLoader will extract authorized_identities from metadata and send it to pebblo server Dependencies: None Documentation: None Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com> Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
This commit is contained in:
parent
475892ca0e
commit
2cbfc94bcb
@ -132,6 +132,9 @@ class PebbloSafeLoader(BaseLoader):
|
|||||||
doc_content = [doc.dict() for doc in self.docs]
|
doc_content = [doc.dict() for doc in self.docs]
|
||||||
docs = []
|
docs = []
|
||||||
for doc in doc_content:
|
for doc in doc_content:
|
||||||
|
doc_authorized_identities = doc.get("metadata", {}).get(
|
||||||
|
"authorized_identities", []
|
||||||
|
)
|
||||||
doc_source_path = get_full_path(
|
doc_source_path = get_full_path(
|
||||||
doc.get("metadata", {}).get("source", self.source_path)
|
doc.get("metadata", {}).get("source", self.source_path)
|
||||||
)
|
)
|
||||||
@ -148,6 +151,11 @@ class PebbloSafeLoader(BaseLoader):
|
|||||||
"source_path": doc_source_path,
|
"source_path": doc_source_path,
|
||||||
"last_modified": doc.get("metadata", {}).get("last_modified"),
|
"last_modified": doc.get("metadata", {}).get("last_modified"),
|
||||||
"file_owner": doc_source_owner,
|
"file_owner": doc_source_owner,
|
||||||
|
**(
|
||||||
|
{"authorized_identities": doc_authorized_identities}
|
||||||
|
if doc_authorized_identities
|
||||||
|
else {}
|
||||||
|
),
|
||||||
**(
|
**(
|
||||||
{"source_path_size": doc_source_size}
|
{"source_path_size": doc_source_size}
|
||||||
if doc_source_size is not None
|
if doc_source_size is not None
|
||||||
|
Loading…
Reference in New Issue
Block a user