mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-12 22:23:01 +02:00
Fix service accounts + shared drives (#490)
This commit is contained in:
@ -75,6 +75,7 @@ def _run_drive_file_query(
|
|||||||
results = (
|
results = (
|
||||||
service.files()
|
service.files()
|
||||||
.list(
|
.list(
|
||||||
|
corpora="allDrives", # needed to search through shared drives
|
||||||
pageSize=batch_size,
|
pageSize=batch_size,
|
||||||
supportsAllDrives=include_shared,
|
supportsAllDrives=include_shared,
|
||||||
includeItemsFromAllDrives=include_shared,
|
includeItemsFromAllDrives=include_shared,
|
||||||
@ -124,6 +125,7 @@ def _get_folder_id(
|
|||||||
else:
|
else:
|
||||||
query += f"mimeType='{DRIVE_FOLDER_TYPE}'"
|
query += f"mimeType='{DRIVE_FOLDER_TYPE}'"
|
||||||
|
|
||||||
|
# TODO: support specifying folder path in shared drive rather than just `My Drive`
|
||||||
results = (
|
results = (
|
||||||
service.files()
|
service.files()
|
||||||
.list(
|
.list(
|
||||||
@ -248,7 +250,7 @@ def get_all_files_batched(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
if traverse_subfolders:
|
if traverse_subfolders and folder_id is not None:
|
||||||
folder_ids_traversed = folder_ids_traversed or []
|
folder_ids_traversed = folder_ids_traversed or []
|
||||||
subfolders = _get_folders(
|
subfolders = _get_folders(
|
||||||
service=service,
|
service=service,
|
||||||
|
@ -203,9 +203,9 @@ const GoogleDriveConnectorManagement = ({
|
|||||||
})(values)}
|
})(values)}
|
||||||
<BooleanFormField
|
<BooleanFormField
|
||||||
name="include_shared"
|
name="include_shared"
|
||||||
label="Include Shared Files"
|
label="Include Shared Files + Shared Drives"
|
||||||
subtext={
|
subtext={
|
||||||
"If checked, then we will also index all documents shared with you. " +
|
"If checked, then we will also index all documents + drives shared with you. " +
|
||||||
"If this is combined with folder paths, then we will only index documents " +
|
"If this is combined with folder paths, then we will only index documents " +
|
||||||
"that match both criteria."
|
"that match both criteria."
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user