cohere-compass-sdk 2.2.2__tar.gz → 2.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/PKG-INFO +1 -1
  2. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/clients/compass.py +12 -1
  3. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/clients/compass_async.py +12 -1
  4. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/documents.py +2 -0
  5. cohere_compass_sdk-2.3.3/cohere_compass/utils/__init__.py +1 -0
  6. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/pyproject.toml +1 -1
  7. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/LICENSE +0 -0
  8. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/README.md +0 -0
  9. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/__init__.py +0 -0
  10. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/clients/__init__.py +0 -0
  11. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/clients/access_control.py +0 -0
  12. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/clients/parser.py +0 -0
  13. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/clients/parser_async.py +0 -0
  14. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/constants.py +0 -0
  15. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/exceptions.py +0 -0
  16. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/__init__.py +0 -0
  17. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/access_control.py +0 -0
  18. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/config.py +0 -0
  19. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/datasources.py +0 -0
  20. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/indexes.py +0 -0
  21. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/models/search.py +0 -0
  22. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/py.typed +0 -0
  23. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/utils/asyn.py +0 -0
  24. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/utils/documents.py +0 -0
  25. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/utils/fs.py +0 -0
  26. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/utils/iter.py +0 -0
  27. {cohere_compass_sdk-2.2.2 → cohere_compass_sdk-2.3.3}/cohere_compass/utils/retry.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cohere-compass-sdk
3
- Version: 2.2.2
3
+ Version: 2.3.3
4
4
  Summary: Cohere Compass SDK
5
5
  Requires-Python: >=3.11,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -635,6 +635,8 @@ class CompassClient:
635
635
  attributes: DocumentAttributes = DocumentAttributes(),
636
636
  config: ParseableDocumentConfig = ParseableDocumentConfig(),
637
637
  content_type: ContentTypeEnum | None = None,
638
+ authorized_groups: list[str] | None = None,
639
+ merge_groups_on_conflict: bool = False,
638
640
  max_retries: int | None = None,
639
641
  retry_wait: timedelta | None = None,
640
642
  timeout: timedelta | None = None,
@@ -650,6 +652,11 @@ class CompassClient:
650
652
  :param document_id: The ID to assign to the document.
651
653
  :param attributes: Additional attributes to add to the document.
652
654
  :param config: Configuration for the document parsing.
655
+ :param authorized_groups: When Document-level Security is enabled,
656
+ Set authorized user groups to access the document.
657
+ These groups should exist in RBAC. Default will make the document public.
658
+ :param merge_groups_on_conflict: When Document-level Security is enabled,
659
+ allows merging authorized groups if document already exists.
653
660
  :param max_retries: Maximum number of retries for failed requests. If not
654
661
  provided, the default from the client will be used.
655
662
  :param retry_wait: Time to wait between retries. If not provided, the default
@@ -674,7 +681,11 @@ class CompassClient:
674
681
 
675
682
  result = self._send_request(
676
683
  api_name="upload_documents",
677
- data=UploadDocumentsInput(documents=[doc]),
684
+ data=UploadDocumentsInput(
685
+ documents=[doc],
686
+ authorized_groups=authorized_groups,
687
+ merge_groups_on_conflict=merge_groups_on_conflict,
688
+ ),
678
689
  index_name=index_name,
679
690
  max_retries=max_retries,
680
691
  retry_wait=retry_wait,
@@ -494,6 +494,8 @@ class CompassAsyncClient:
494
494
  attributes: DocumentAttributes = DocumentAttributes(),
495
495
  config: ParseableDocumentConfig = ParseableDocumentConfig(),
496
496
  content_type: ContentTypeEnum | None = None,
497
+ authorized_groups: list[str] | None = None,
498
+ merge_groups_on_conflict: bool = False,
497
499
  max_retries: int | None = None,
498
500
  retry_wait: timedelta | None = None,
499
501
  timeout: timedelta | None = None,
@@ -509,6 +511,11 @@ class CompassAsyncClient:
509
511
  :param document_id: the id of the document (optional)
510
512
  :param attributes: Additional attributes to add to the document.
511
513
  :param config: Configuration for the document parsing.
514
+ :param authorized_groups: The groups that are authorized to access the
515
+ document. These groups should exist in RBAC. None passed will make the
516
+ document public.
517
+ :param merge_groups_on_conflict: Allows combining authorized group field
518
+ when document already exists, and Document Level Security is enabled.
512
519
  :param max_retries: Maximum number of retries for failed requests. If not
513
520
  provided, the default from the client will be used.
514
521
  :param retry_wait: Time to wait between retries. If not provided, the default
@@ -533,7 +540,11 @@ class CompassAsyncClient:
533
540
 
534
541
  result = await self._send_request(
535
542
  api_name="upload_documents",
536
- data=UploadDocumentsInput(documents=[doc]),
543
+ data=UploadDocumentsInput(
544
+ documents=[doc],
545
+ authorized_groups=authorized_groups,
546
+ merge_groups_on_conflict=merge_groups_on_conflict,
547
+ ),
537
548
  index_name=index_name,
538
549
  max_retries=max_retries,
539
550
  retry_wait=retry_wait,
@@ -311,6 +311,8 @@ class UploadDocumentsInput(BaseModel):
311
311
  """A model for the input of a call to upload_documents API."""
312
312
 
313
313
  documents: list[ParseableDocument]
314
+ authorized_groups: list[str] | None = None
315
+ merge_groups_on_conflict: bool = False
314
316
 
315
317
 
316
318
  class UploadDocumentsResult(BaseModel):
@@ -0,0 +1 @@
1
+ """Utility functions for the Cohere Compass SDK."""
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cohere-compass-sdk"
3
- version = "2.2.2"
3
+ version = "2.3.3"
4
4
  authors = []
5
5
  description = "Cohere Compass SDK"
6
6
  readme = "README.md"