@@ -290,10 +290,14 @@ def import_files(
290
290
```
291
291
import vertexai
292
292
from vertexai.preview import rag
293
+ from google.protobuf import timestamp_pb2
293
294
294
295
vertexai.init(project="my-project")
295
296
# Google Drive example
296
- paths = ["https://drive.google.com/file/123", "https://drive.google.com/file/456"]
297
+ paths = [
298
+ "https://drive.google.com/file/d/123",
299
+ "https://drive.google.com/drive/folders/456"
300
+ ]
297
301
# Google Cloud Storage example
298
302
paths = ["gs://my_bucket/my_files_dir", ...]
299
303
@@ -305,9 +309,9 @@ def import_files(
305
309
)
306
310
307
311
# Slack example
308
- start_time = protobuf. timestamp_pb2.Timestamp()
309
- start_time.GetCurrentTime( )
310
- end_time = protobuf. timestamp_pb2.Timestamp()
312
+ start_time = timestamp_pb2.Timestamp()
313
+ start_time.FromJsonString('2020-12-31T21:33:44Z' )
314
+ end_time = timestamp_pb2.Timestamp()
311
315
end_time.GetCurrentTime()
312
316
source = rag.SlackChannelsSource(
313
317
channels = [
@@ -342,7 +346,7 @@ def import_files(
342
346
corpus_name: The name of the RagCorpus resource into which to import files.
343
347
Format: ``projects/{project}/locations/{location}/ragCorpora/{rag_corpus}``
344
348
or ``{rag_corpus}``.
345
- paths: A list of uris. Elligible uris will be Google Cloud Storage
349
+ paths: A list of uris. Eligible uris will be Google Cloud Storage
346
350
directory ("gs://my-bucket/my_dir") or a Google Drive url for file
347
351
(https://drive.google.com/file/... or folder
348
352
"https://drive.google.com/corp/drive/folders/...").
@@ -401,11 +405,15 @@ async def import_files_async(
401
405
```
402
406
import vertexai
403
407
from vertexai.preview import rag
408
+ from google.protobuf import timestamp_pb2
404
409
405
410
vertexai.init(project="my-project")
406
411
407
412
# Google Drive example
408
- paths = ["https://drive.google.com/file/123", "https://drive.google.com/file/456"]
413
+ paths = [
414
+ "https://drive.google.com/file/d/123",
415
+ "https://drive.google.com/drive/folders/456"
416
+ ]
409
417
# Google Cloud Storage example
410
418
paths = ["gs://my_bucket/my_files_dir", ...]
411
419
@@ -417,9 +425,9 @@ async def import_files_async(
417
425
)
418
426
419
427
# Slack example
420
- start_time = protobuf. timestamp_pb2.Timestamp()
421
- start_time.GetCurrentTime( )
422
- end_time = protobuf. timestamp_pb2.Timestamp()
428
+ start_time = timestamp_pb2.Timestamp()
429
+ start_time.FromJsonString('2020-12-31T21:33:44Z' )
430
+ end_time = timestamp_pb2.Timestamp()
423
431
end_time.GetCurrentTime()
424
432
source = rag.SlackChannelsSource(
425
433
channels = [
@@ -454,7 +462,7 @@ async def import_files_async(
454
462
corpus_name: The name of the RagCorpus resource into which to import files.
455
463
Format: ``projects/{project}/locations/{location}/ragCorpora/{rag_corpus}``
456
464
or ``{rag_corpus}``.
457
- paths: A list of uris. Elligible uris will be Google Cloud Storage
465
+ paths: A list of uris. Eligible uris will be Google Cloud Storage
458
466
directory ("gs://my-bucket/my_dir") or a Google Drive url for file
459
467
(https://drive.google.com/file/... or folder
460
468
"https://drive.google.com/corp/drive/folders/...").
0 commit comments