|
24 | 24 | RagCorpus,
|
25 | 25 | RagFile,
|
26 | 26 | RagResource,
|
| 27 | + SharePointSource, |
| 28 | + SharePointSources, |
27 | 29 | SlackChannelsSource,
|
28 | 30 | SlackChannel,
|
29 | 31 | JiraSource,
|
|
42 | 44 | JiraSource as GapicJiraSource,
|
43 | 45 | RagCorpus as GapicRagCorpus,
|
44 | 46 | RagFile as GapicRagFile,
|
| 47 | + SharePointSources as GapicSharePointSources, |
45 | 48 | SlackSource as GapicSlackSource,
|
46 | 49 | RagContexts,
|
47 | 50 | RetrieveContextsResponse,
|
|
390 | 393 | import_rag_files_config=TEST_IMPORT_FILES_CONFIG_JIRA_SOURCE,
|
391 | 394 | )
|
392 | 395 |
|
| 396 | +# SharePoint sources |
| 397 | +TEST_SHARE_POINT_SOURCE = SharePointSources( |
| 398 | + share_point_sources=[ |
| 399 | + SharePointSource( |
| 400 | + sharepoint_folder_path="test-sharepoint-folder-path", |
| 401 | + drive_name="test-drive-name", |
| 402 | + client_id="test-client-id", |
| 403 | + client_secret="test-client-secret", |
| 404 | + tenant_id="test-tenant-id", |
| 405 | + sharepoint_site_name="test-sharepoint-site-name", |
| 406 | + ) |
| 407 | + ], |
| 408 | +) |
| 409 | +TEST_IMPORT_FILES_CONFIG_SHARE_POINT_SOURCE = ImportRagFilesConfig( |
| 410 | + rag_file_chunking_config=RagFileChunkingConfig( |
| 411 | + chunk_size=TEST_CHUNK_SIZE, |
| 412 | + chunk_overlap=TEST_CHUNK_OVERLAP, |
| 413 | + ), |
| 414 | + share_point_sources=GapicSharePointSources( |
| 415 | + share_point_sources=[ |
| 416 | + GapicSharePointSources.SharePointSource( |
| 417 | + sharepoint_folder_path="test-sharepoint-folder-path", |
| 418 | + drive_name="test-drive-name", |
| 419 | + client_id="test-client-id", |
| 420 | + client_secret=api_auth.ApiAuth.ApiKeyConfig( |
| 421 | + api_key_secret_version="test-client-secret" |
| 422 | + ), |
| 423 | + tenant_id="test-tenant-id", |
| 424 | + sharepoint_site_name="test-sharepoint-site-name", |
| 425 | + ) |
| 426 | + ] |
| 427 | + ), |
| 428 | +) |
| 429 | + |
| 430 | +TEST_IMPORT_REQUEST_SHARE_POINT_SOURCE = ImportRagFilesRequest( |
| 431 | + parent=TEST_RAG_CORPUS_RESOURCE_NAME, |
| 432 | + import_rag_files_config=TEST_IMPORT_FILES_CONFIG_SHARE_POINT_SOURCE, |
| 433 | +) |
| 434 | + |
| 435 | +TEST_SHARE_POINT_SOURCE_2_DRIVES = SharePointSources( |
| 436 | + share_point_sources=[ |
| 437 | + SharePointSource( |
| 438 | + sharepoint_folder_path="test-sharepoint-folder-path", |
| 439 | + drive_name="test-drive-name", |
| 440 | + drive_id="test-drive-id", |
| 441 | + client_id="test-client-id", |
| 442 | + client_secret="test-client-secret", |
| 443 | + tenant_id="test-tenant-id", |
| 444 | + sharepoint_site_name="test-sharepoint-site-name", |
| 445 | + ) |
| 446 | + ], |
| 447 | +) |
| 448 | + |
| 449 | +TEST_SHARE_POINT_SOURCE_NO_DRIVES = SharePointSources( |
| 450 | + share_point_sources=[ |
| 451 | + SharePointSource( |
| 452 | + sharepoint_folder_path="test-sharepoint-folder-path", |
| 453 | + client_id="test-client-id", |
| 454 | + client_secret="test-client-secret", |
| 455 | + tenant_id="test-tenant-id", |
| 456 | + sharepoint_site_name="test-sharepoint-site-name", |
| 457 | + ) |
| 458 | + ], |
| 459 | +) |
| 460 | + |
| 461 | +TEST_SHARE_POINT_SOURCE_2_FOLDERS = SharePointSources( |
| 462 | + share_point_sources=[ |
| 463 | + SharePointSource( |
| 464 | + sharepoint_folder_path="test-sharepoint-folder-path", |
| 465 | + sharepoint_folder_id="test-sharepoint-folder-id", |
| 466 | + drive_name="test-drive-name", |
| 467 | + client_id="test-client-id", |
| 468 | + client_secret="test-client-secret", |
| 469 | + tenant_id="test-tenant-id", |
| 470 | + sharepoint_site_name="test-sharepoint-site-name", |
| 471 | + ) |
| 472 | + ], |
| 473 | +) |
| 474 | + |
| 475 | +TEST_SHARE_POINT_SOURCE_NO_FOLDERS = SharePointSources( |
| 476 | + share_point_sources=[ |
| 477 | + SharePointSource( |
| 478 | + drive_name="test-drive-name", |
| 479 | + client_id="test-client-id", |
| 480 | + client_secret="test-client-secret", |
| 481 | + tenant_id="test-tenant-id", |
| 482 | + sharepoint_site_name="test-sharepoint-site-name", |
| 483 | + ) |
| 484 | + ], |
| 485 | +) |
| 486 | + |
| 487 | +TEST_IMPORT_FILES_CONFIG_SHARE_POINT_SOURCE_NO_FOLDERS = ImportRagFilesConfig( |
| 488 | + rag_file_chunking_config=RagFileChunkingConfig( |
| 489 | + chunk_size=TEST_CHUNK_SIZE, |
| 490 | + chunk_overlap=TEST_CHUNK_OVERLAP, |
| 491 | + ), |
| 492 | + share_point_sources=GapicSharePointSources( |
| 493 | + share_point_sources=[ |
| 494 | + GapicSharePointSources.SharePointSource( |
| 495 | + drive_name="test-drive-name", |
| 496 | + client_id="test-client-id", |
| 497 | + client_secret=api_auth.ApiAuth.ApiKeyConfig( |
| 498 | + api_key_secret_version="test-client-secret" |
| 499 | + ), |
| 500 | + tenant_id="test-tenant-id", |
| 501 | + sharepoint_site_name="test-sharepoint-site-name", |
| 502 | + ) |
| 503 | + ] |
| 504 | + ), |
| 505 | +) |
| 506 | + |
| 507 | +TEST_IMPORT_REQUEST_SHARE_POINT_SOURCE_NO_FOLDERS = ImportRagFilesRequest( |
| 508 | + parent=TEST_RAG_CORPUS_RESOURCE_NAME, |
| 509 | + import_rag_files_config=TEST_IMPORT_FILES_CONFIG_SHARE_POINT_SOURCE, |
| 510 | +) |
| 511 | + |
393 | 512 | # Retrieval
|
394 | 513 | TEST_QUERY_TEXT = "What happen to the fox and the dog?"
|
395 | 514 | TEST_CONTEXTS = RagContexts(
|
|
0 commit comments