@@ -73,7 +73,7 @@ def import_documents_bigquery_sample(
73
73
print (f"Waiting for operation to complete: { operation .operation .name } " )
74
74
response = operation .result ()
75
75
76
- # Once the operation is complete,
76
+ # After the operation is complete,
77
77
# get information from operation metadata
78
78
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
79
79
@@ -99,7 +99,15 @@ def import_documents_gcs_sample(
99
99
# project_id = "YOUR_PROJECT_ID"
100
100
# location = "YOUR_LOCATION" # Values: "global"
101
101
# data_store_id = "YOUR_DATA_STORE_ID"
102
- # Format: `gs://bucket/directory/object.json` or `gs://bucket/directory/*.json`
102
+
103
+ # Examples:
104
+ # - Unstructured documents
105
+ # - `gs://bucket/directory/file.pdf`
106
+ # - `gs://bucket/directory/*.pdf`
107
+ # - Unstructured documents with JSONL Metadata
108
+ # - `gs://bucket/directory/file.json`
109
+ # - Unstructured documents with CSV Metadata
110
+ # - `gs://bucket/directory/file.csv`
103
111
# gcs_uri = "YOUR_GCS_PATH"
104
112
105
113
# For more information, refer to:
@@ -125,8 +133,13 @@ def import_documents_gcs_sample(
125
133
request = discoveryengine .ImportDocumentsRequest (
126
134
parent = parent ,
127
135
gcs_source = discoveryengine .GcsSource (
136
+ # Multiple URIs are supported
128
137
input_uris = [gcs_uri ],
129
- data_schema = "custom" ,
138
+ # Options:
139
+ # - `content` - Unstructured documents (PDF, HTML, DOC, TXT, PPTX)
140
+ # - `custom` - Unstructured documents with JSONL metadata
141
+ # - `csv` - Unstructured documents with CSV metadata
142
+ data_schema = "content" ,
130
143
),
131
144
# Options: `FULL`, `INCREMENTAL`
132
145
reconciliation_mode = discoveryengine .ImportDocumentsRequest .ReconciliationMode .INCREMENTAL ,
@@ -138,7 +151,7 @@ def import_documents_gcs_sample(
138
151
print (f"Waiting for operation to complete: { operation .operation .name } " )
139
152
response = operation .result ()
140
153
141
- # Once the operation is complete,
154
+ # After the operation is complete,
142
155
# get information from operation metadata
143
156
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
144
157
@@ -213,7 +226,7 @@ def import_documents_cloud_sql_sample(
213
226
print (f"Waiting for operation to complete: { operation .operation .name } " )
214
227
response = operation .result ()
215
228
216
- # Once the operation is complete,
229
+ # After the operation is complete,
217
230
# get information from operation metadata
218
231
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
219
232
@@ -285,7 +298,7 @@ def import_documents_spanner_sample(
285
298
print (f"Waiting for operation to complete: { operation .operation .name } " )
286
299
response = operation .result ()
287
300
288
- # Once the operation is complete,
301
+ # After the operation is complete,
289
302
# get information from operation metadata
290
303
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
291
304
@@ -354,7 +367,7 @@ def import_documents_firestore_sample(
354
367
print (f"Waiting for operation to complete: { operation .operation .name } " )
355
368
response = operation .result ()
356
369
357
- # Once the operation is complete,
370
+ # After the operation is complete,
358
371
# get information from operation metadata
359
372
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
360
373
@@ -443,7 +456,7 @@ def import_documents_bigtable_sample(
443
456
print (f"Waiting for operation to complete: { operation .operation .name } " )
444
457
response = operation .result ()
445
458
446
- # Once the operation is complete,
459
+ # After the operation is complete,
447
460
# get information from operation metadata
448
461
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
449
462
@@ -518,7 +531,7 @@ def import_documents_alloy_db_sample(
518
531
print (f"Waiting for operation to complete: { operation .operation .name } " )
519
532
response = operation .result ()
520
533
521
- # Once the operation is complete,
534
+ # After the operation is complete,
522
535
# get information from operation metadata
523
536
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
524
537
@@ -592,7 +605,7 @@ def import_documents_healthcare_fhir_sample(
592
605
print (f"Waiting for operation to complete: { operation .operation .name } " )
593
606
response = operation .result ()
594
607
595
- # Once the operation is complete,
608
+ # After the operation is complete,
596
609
# get information from operation metadata
597
610
metadata = discoveryengine .ImportDocumentsMetadata (operation .metadata )
598
611
0 commit comments