dyff-schema 0.3.8__py3-none-any.whl → 0.4.0__py3-none-any.whl

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.

Potentially problematic release.


This version of dyff-schema might be problematic. Click here for more details.

@@ -139,15 +139,6 @@ def _k8s_label_value_maxlen():
139
139
  return _k8s_label_maxlen()
140
140
 
141
141
 
142
- class StorageSignedURL(DyffSchemaBaseModel):
143
- url: str = pydantic.Field(description="The signed URL")
144
- method: str = pydantic.Field(description="The HTTP method applicable to the URL")
145
- headers: dict[str, str] = pydantic.Field(
146
- default_factory=dict,
147
- description="Mandatory headers that must be passed with the request",
148
- )
149
-
150
-
151
142
  class Entities(str, enum.Enum):
152
143
  """The kinds of entities in the dyff system."""
153
144
 
@@ -471,6 +462,43 @@ class APIKey(DyffSchemaBaseModel):
471
462
  )
472
463
 
473
464
 
465
+ # ----------------------------------------------------------------------------
466
+
467
+
468
+ class Digest(DyffSchemaBaseModel):
469
+ md5: Optional[str] = pydantic.Field(
470
+ default=None, description="md5 digest of artifact data"
471
+ )
472
+
473
+
474
+ class Artifact(DyffSchemaBaseModel):
475
+ # TODO: In v1, rename this to 'contentType' or something and commit to making it the MIME type
476
+ kind: Optional[str] = pydantic.Field(
477
+ default=None, description="The kind of artifact"
478
+ )
479
+ path: str = pydantic.Field(
480
+ description="The relative path of the artifact within the tree"
481
+ )
482
+ digest: Digest = pydantic.Field(
483
+ default_factory=Digest,
484
+ description="One or more message digests (hashes) of the artifact data",
485
+ )
486
+
487
+
488
+ class StorageSignedURL(DyffSchemaBaseModel):
489
+ url: str = pydantic.Field(description="The signed URL")
490
+ method: str = pydantic.Field(description="The HTTP method applicable to the URL")
491
+ headers: dict[str, str] = pydantic.Field(
492
+ default_factory=dict,
493
+ description="Mandatory headers that must be passed with the request",
494
+ )
495
+
496
+
497
+ class ArtifactURL(DyffSchemaBaseModel):
498
+ artifact: Artifact
499
+ signedURL: StorageSignedURL
500
+
501
+
474
502
  class AuditRequirement(DyffSchemaBaseModel):
475
503
  """An evaluation report that must exist in order to apply an AuditProcedure."""
476
504
 
@@ -543,21 +571,6 @@ class ExtractorStep(DyffSchemaBaseModel):
543
571
  type: Optional[str] = None
544
572
 
545
573
 
546
- class Digest(DyffSchemaBaseModel):
547
- md5: Optional[str] = pydantic.Field(None)
548
-
549
-
550
- class Artifact(DyffSchemaBaseModel):
551
- # TODO: Enumerate the available kinds
552
- kind: str = pydantic.Field(description="The kind of artifact")
553
- path: str = pydantic.Field(
554
- description="The relative path of the artifact within the dataset"
555
- )
556
- digest: Digest = pydantic.Field(
557
- description="One or more message digests (hashes) of the artifact data"
558
- )
559
-
560
-
561
574
  class DyffDataSchema(DyffSchemaBaseModel):
562
575
  components: list[str] = pydantic.Field(
563
576
  min_items=1,
@@ -1332,16 +1345,34 @@ class ForeignMethod(DyffModelWithID, MethodBase):
1332
1345
 
1333
1346
 
1334
1347
  class AnalysisScope(DyffSchemaBaseModel):
1335
- dataset: Optional[str]
1336
- inferenceService: Optional[str]
1337
- evaluation: Optional[str]
1338
- model: Optional[str]
1348
+ """The specific entities to which the analysis applies.
1349
+
1350
+ When applying an InferenceService-scoped Method, at least
1351
+ ``.inferenceService`` must be set.
1352
+
1353
+ When applying an Evaluation-scoped Method, at least ``.evaluation``,
1354
+ ``.inferenceService``, and ``.dataset`` must be set.
1355
+ """
1356
+
1357
+ dataset: Optional[str] = pydantic.Field(
1358
+ default=None, description="The Dataset to which the analysis applies."
1359
+ )
1360
+ inferenceService: Optional[str] = pydantic.Field(
1361
+ default=None, description="The InferenceService to which the analysis applies."
1362
+ )
1363
+ evaluation: Optional[str] = pydantic.Field(
1364
+ default=None, description="The Evaluation to which the analysis applies."
1365
+ )
1366
+ model: Optional[str] = pydantic.Field(
1367
+ default=None, description="The Model to which the analysis applies."
1368
+ )
1339
1369
 
1340
1370
 
1341
1371
  class AnalysisBase(DyffSchemaBaseModel):
1342
1372
  scope: AnalysisScope = pydantic.Field(
1373
+ default_factory=AnalysisScope,
1343
1374
  description="The specific entities to which the analysis results apply."
1344
- " At a minimum, the field corresponding to method.scope must be set."
1375
+ " At a minimum, the field corresponding to method.scope must be set.",
1345
1376
  )
1346
1377
 
1347
1378
  arguments: list[AnalysisArgument] = pydantic.Field(
@@ -1695,6 +1726,7 @@ __all__ = [
1695
1726
  "APIKey",
1696
1727
  "ArchiveFormat",
1697
1728
  "Artifact",
1729
+ "ArtifactURL",
1698
1730
  "Audit",
1699
1731
  "AuditProcedure",
1700
1732
  "AuditRequirement",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.3.8
3
+ Version: 0.4.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
@@ -21,7 +21,7 @@ dyff/schema/v0/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
21
21
  dyff/schema/v0/r1/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
22
22
  dyff/schema/v0/r1/adapters.py,sha256=2t2oxsnGfSEDKKDIEYw4qqLXMH7qlFIwPVuLyUmbsHs,23552
23
23
  dyff/schema/v0/r1/base.py,sha256=g_wqh4OU_9ftMHovVxPtdeup4O5MZi422v3eZH99ZQI,17139
24
- dyff/schema/v0/r1/platform.py,sha256=s29alLQ5wyRKFbw-oGawF1RNT-IsLi_iEEtMxgTn1PM,55483
24
+ dyff/schema/v0/r1/platform.py,sha256=pu6N3Gh94V1-7fdwGuXTqDzlzTCFkp7Ne3lqxN41u9Q,56634
25
25
  dyff/schema/v0/r1/requests.py,sha256=ZD31iDNyJQFDzJlFrSsDBorS7TXyhRBk-R6oG7PI3kE,7762
26
26
  dyff/schema/v0/r1/test.py,sha256=X6dUyVd5svcPCI-PBMOAqEfK9jv3bRDvkQTJzwS96c0,10720
27
27
  dyff/schema/v0/r1/version.py,sha256=SG9ds8afHgdrqOA4CEY8-MM3lKfAE9G0rxsG4uyeglE,363
@@ -33,9 +33,9 @@ dyff/schema/v0/r1/dataset/text.py,sha256=nLIn91Zlt0tNdXUklSgjJ-kEDxoPX32ISLkiv2D
33
33
  dyff/schema/v0/r1/dataset/vision.py,sha256=aIe0fbfM_g3DsrDTdg2K803YKLjZBpurM_VJcJFuZLc,369
34
34
  dyff/schema/v0/r1/io/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
35
35
  dyff/schema/v0/r1/io/vllm.py,sha256=CUE9y8KthtUI7sD49S875rDmPvKotSXVIRaBS79aBZs,5320
36
- dyff_schema-0.3.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
37
- dyff_schema-0.3.8.dist-info/METADATA,sha256=8zEv_sAGEh6IdpqJT1HzmpbDT9dMiwEn_634S4J_pYw,3459
38
- dyff_schema-0.3.8.dist-info/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
39
- dyff_schema-0.3.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
40
- dyff_schema-0.3.8.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
41
- dyff_schema-0.3.8.dist-info/RECORD,,
36
+ dyff_schema-0.4.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
37
+ dyff_schema-0.4.0.dist-info/METADATA,sha256=uActriu3gclgkQfUz4B0D4RMhpYdMVATwjjBVx1aHmM,3459
38
+ dyff_schema-0.4.0.dist-info/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
39
+ dyff_schema-0.4.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
40
+ dyff_schema-0.4.0.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
41
+ dyff_schema-0.4.0.dist-info/RECORD,,