dyff-schema 0.12.0__tar.gz → 0.14.0__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 (57) hide show
  1. {dyff_schema-0.12.0/dyff_schema.egg-info → dyff_schema-0.14.0}/PKG-INFO +1 -1
  2. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/platform.py +39 -7
  3. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/requests.py +13 -0
  4. {dyff_schema-0.12.0 → dyff_schema-0.14.0/dyff_schema.egg-info}/PKG-INFO +1 -1
  5. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/.gitignore +0 -0
  6. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/.gitlab-ci.yml +0 -0
  7. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/.licenserc.yaml +0 -0
  8. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/.pre-commit-config.yaml +0 -0
  9. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/.prettierignore +0 -0
  10. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/.secrets.baseline +0 -0
  11. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/CODE_OF_CONDUCT.md +0 -0
  12. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/LICENSE +0 -0
  13. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/NOTICE +0 -0
  14. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/README.md +0 -0
  15. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/__init__.py +0 -0
  16. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/adapters.py +0 -0
  17. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/annotations.py +0 -0
  18. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/base.py +0 -0
  19. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/copydoc.py +0 -0
  20. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/dataset/__init__.py +0 -0
  21. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/dataset/arrow.py +0 -0
  22. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/dataset/binary.py +0 -0
  23. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/dataset/classification.py +0 -0
  24. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/dataset/text.py +0 -0
  25. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/dataset/vision.py +0 -0
  26. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/errors.py +0 -0
  27. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/ids.py +0 -0
  28. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/io/__init__.py +0 -0
  29. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/io/vllm.py +0 -0
  30. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/platform.py +0 -0
  31. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/py.typed +0 -0
  32. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/quantity.py +0 -0
  33. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/requests.py +0 -0
  34. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/test.py +0 -0
  35. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/__init__.py +0 -0
  36. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/__init__.py +0 -0
  37. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/adapters.py +0 -0
  38. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/base.py +0 -0
  39. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
  40. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
  41. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/dataset/binary.py +0 -0
  42. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/dataset/classification.py +0 -0
  43. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/dataset/text.py +0 -0
  44. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/dataset/vision.py +0 -0
  45. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/io/__init__.py +0 -0
  46. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/io/vllm.py +0 -0
  47. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/test.py +0 -0
  48. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/v0/r1/version.py +0 -0
  49. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff/schema/version.py +0 -0
  50. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff_schema.egg-info/SOURCES.txt +0 -0
  51. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff_schema.egg-info/dependency_links.txt +0 -0
  52. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff_schema.egg-info/requires.txt +0 -0
  53. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/dyff_schema.egg-info/top_level.txt +0 -0
  54. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/makefile +0 -0
  55. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/pyproject.toml +0 -0
  56. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/setup.cfg +0 -0
  57. {dyff_schema-0.12.0 → dyff_schema-0.14.0}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.12.0
3
+ Version: 0.14.0
4
4
  Summary: Data models for the Dyff AI auditing platform.
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
@@ -345,7 +345,11 @@ class DocumentationBase(DyffSchemaBaseModel):
345
345
 
346
346
 
347
347
  class Documentation(SchemaVersion, DocumentationBase):
348
- pass
348
+ entity: Optional[str] = pydantic.Field(
349
+ default=None,
350
+ description="The ID of the documented entity. This is Optional for"
351
+ " backward compatibility but it will always be populated in API responses.",
352
+ )
349
353
 
350
354
 
351
355
  class Documented(DyffSchemaBaseModel):
@@ -500,9 +504,17 @@ class AccessGrant(DyffSchemaBaseModel):
500
504
  )
501
505
 
502
506
 
503
- class APIKey(DyffSchemaBaseModel):
504
- """A description of a set of permissions granted to a single subject (either an
505
- account or a workload).
507
+ class Role(DyffSchemaBaseModel):
508
+ """A set of permissions."""
509
+
510
+ grants: list[AccessGrant] = pydantic.Field(
511
+ default_factory=list, description="The permissions granted to the role."
512
+ )
513
+
514
+
515
+ class APIKey(Role):
516
+ """A description of a Role (a set of permissions) granted to a single subject
517
+ (either an account or a workload).
506
518
 
507
519
  Dyff API clients authenticate with a *token* that contains a cryptographically
508
520
  signed APIKey.
@@ -525,9 +537,6 @@ class APIKey(DyffSchemaBaseModel):
525
537
  default=None,
526
538
  description="For account keys: a secret value to check when verifying the APIKey",
527
539
  )
528
- grants: list[AccessGrant] = pydantic.Field(
529
- default_factory=list, description="AccessGrants associated with the APIKey"
530
- )
531
540
 
532
541
 
533
542
  class Identity(DyffSchemaBaseModel):
@@ -1650,11 +1659,32 @@ class AnalysisBase(DyffSchemaBaseModel):
1650
1659
  )
1651
1660
 
1652
1661
 
1662
+ class AnalysisData(DyffSchemaBaseModel):
1663
+ """Arbitrary additional data for the Analysis, specified as a key-value pair where
1664
+ the value is the data encoded in base64."""
1665
+
1666
+ key: str = pydantic.Field(
1667
+ description="Key identifying the data. For data about a Dyff entity,"
1668
+ " this should be the entity's ID."
1669
+ )
1670
+
1671
+ value: str = pydantic.Field(
1672
+ # Canonical base64 encoding
1673
+ # https://stackoverflow.com/a/64467300/3709935
1674
+ regex=r"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/][AQgw]==|[A-Za-z0-9+/]{2}[AEIMQUYcgkosw048]=)?$",
1675
+ description="Arbitrary data encoded in base64.",
1676
+ )
1677
+
1678
+
1653
1679
  class Analysis(AnalysisBase):
1654
1680
  method: ForeignMethod = pydantic.Field(
1655
1681
  description="The analysis Method to run.",
1656
1682
  )
1657
1683
 
1684
+ data: list[AnalysisData] = pydantic.Field(
1685
+ default_factory=list, description="Additional data to supply to the analysis."
1686
+ )
1687
+
1658
1688
 
1659
1689
  class Measurement(DyffEntity, MeasurementSpec, Analysis):
1660
1690
  kind: Literal["Measurement"] = Entities.Measurement.value
@@ -2015,6 +2045,7 @@ __all__ = [
2015
2045
  "Analysis",
2016
2046
  "AnalysisArgument",
2017
2047
  "AnalysisBase",
2048
+ "AnalysisData",
2018
2049
  "AnalysisInput",
2019
2050
  "AnalysisOutputQueryFields",
2020
2051
  "AnalysisScope",
@@ -2113,6 +2144,7 @@ __all__ = [
2113
2144
  "Resources",
2114
2145
  "Revision",
2115
2146
  "RevisionMetadata",
2147
+ "Role",
2116
2148
  "SafetyCase",
2117
2149
  "SafetyCaseSpec",
2118
2150
  "SchemaAdapter",
@@ -205,6 +205,18 @@ class DyffEntityQueryRequest(DyffRequestDefaultValidators):
205
205
  )
206
206
 
207
207
 
208
+ class DocumentationQueryRequest(DyffRequestDefaultValidators):
209
+ query: Optional[str] = pydantic.Field(
210
+ default=None,
211
+ description="A JSON structure describing a query, encoded as a string."
212
+ " Valid keys are the same as the valid query keys for the corresponding"
213
+ " endpoint. Values can be scalars or lists. Lists are treated as"
214
+ " disjunctive queries (i.e., 'value $in list').",
215
+ )
216
+
217
+ id: Optional[str] = pydantic.Field(default=None)
218
+
219
+
208
220
  class _AnalysisProductQueryRequest(DyffEntityQueryRequest):
209
221
  method: Optional[str] = pydantic.Field(default=None)
210
222
  methodName: Optional[str] = pydantic.Field(default=None)
@@ -288,6 +300,7 @@ __all__ = [
288
300
  "DatasetCreateRequest",
289
301
  "DatasetQueryRequest",
290
302
  "DocumentationEditRequest",
303
+ "DocumentationQueryRequest",
291
304
  "EvaluationCreateRequest",
292
305
  "EvaluationQueryRequest",
293
306
  "EvaluationInferenceSessionRequest",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.12.0
3
+ Version: 0.14.0
4
4
  Summary: Data models for the Dyff AI auditing platform.
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes