dyff-schema 0.38.0__py3-none-any.whl → 0.38.2__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.

dyff/schema/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = version = "0.38.0"
2
- __version_tuple__ = version_tuple = (0, 38, 0)
1
+ __version__ = version = "0.38.2"
2
+ __version_tuple__ = version_tuple = (0, 38, 2)
@@ -1732,8 +1732,6 @@ class EvaluationRequestBase(EvaluationBase):
1732
1732
  """A description of how to run an InferenceService on a Dataset to obtain a set of
1733
1733
  evaluation results."""
1734
1734
 
1735
- kind: Literal["EvaluationRequest"] = "EvaluationRequest"
1736
-
1737
1735
  inferenceSession: Optional[EvaluationInferenceSessionRequest] = pydantic.Field(
1738
1736
  default=None,
1739
1737
  description="Specification of the InferenceSession that will perform inference for the evaluation.",
@@ -2255,8 +2253,6 @@ class AnalysisBase(DyffSchemaBaseModel):
2255
2253
 
2256
2254
 
2257
2255
  class AnalysisRequestBase(AnalysisBase):
2258
- kind: Literal["AnalysisRequest"] = "AnalysisRequest"
2259
-
2260
2256
  method: EntityIDField = pydantic.Field(description="Method ID")
2261
2257
 
2262
2258
 
@@ -2765,13 +2761,34 @@ class ChallengeSubmission(DyffEntity):
2765
2761
  # ---------------------------------------------------------------------------
2766
2762
  # Pipelines
2767
2763
 
2764
+
2765
+ class PipelineEvaluationRequest(EvaluationRequestBase):
2766
+ kind: Literal["PipelineEvaluationRequest"] = "PipelineEvaluationRequest"
2767
+
2768
+
2769
+ class PipelineMeasurementRequest(AnalysisRequestBase):
2770
+ kind: Literal["PipelineMeasurementRequest"] = "PipelineMeasurementRequest"
2771
+
2772
+
2773
+ class PipelineSafetyCaseRequest(AnalysisRequestBase):
2774
+ kind: Literal["PipelineSafetyCaseRequest"] = "PipelineSafetyCaseRequest"
2775
+
2776
+
2768
2777
  PipelineNodeRequest: TypeAlias = Union[
2769
- AnalysisRequestBase,
2770
- EvaluationRequestBase,
2778
+ PipelineEvaluationRequest,
2779
+ PipelineMeasurementRequest,
2780
+ PipelineSafetyCaseRequest,
2771
2781
  ]
2772
2782
 
2773
2783
 
2774
2784
  class PipelineNode(DyffSchemaBaseModel):
2785
+ """A node in the graph that defines the pipeline.
2786
+
2787
+ Each node contains a Dyff API request that might depend on the outcome of other
2788
+ requests in the pipeline graph. When the pipeline runs, the requests are executed in
2789
+ an order that respects these dependencies.
2790
+ """
2791
+
2775
2792
  name: str = pydantic.Field(
2776
2793
  description="The name of the node. Must be unique in the context of the pipeline."
2777
2794
  )
@@ -2779,7 +2796,7 @@ class PipelineNode(DyffSchemaBaseModel):
2779
2796
  request: PipelineNodeRequest = pydantic.Field( # type: ignore[valid-type]
2780
2797
  discriminator="kind",
2781
2798
  description="The request template that will be executed when this node"
2782
- ' executes. You can use the syntax ``"$(node_name)"`` in request fields'
2799
+ ' executes. You can use the syntax "$(node_name)" in request fields'
2783
2800
  " that reference another entity to indicate that the request depends"
2784
2801
  " on another node in the pipeline. The placeholder will be substituted"
2785
2802
  " with the ID of the created entity once it is known. Dyff infers the"
@@ -2797,7 +2814,9 @@ class PipelineParameter(DyffSchemaBaseModel):
2797
2814
  " parameter value. Should be a string like 'node_name.field1.field2'."
2798
2815
  )
2799
2816
  description: Optional[str] = pydantic.Field(
2800
- default=None, description="A description of the argument."
2817
+ default=None,
2818
+ description="A description of the argument.",
2819
+ max_length=summary_maxlen(),
2801
2820
  )
2802
2821
 
2803
2822
 
@@ -2818,11 +2837,16 @@ class PipelineBase(DyffSchemaBaseModel):
2818
2837
  class Pipeline(DyffEntity, PipelineBase):
2819
2838
  """A set of Dyff workflows that can be executed as a group.
2820
2839
 
2821
- The pipeline
2822
- is a directed acyclic graph representing data dependencies between
2823
- workflows. For example, a simple pipeline might run an Evaluation and
2824
- then create a SafetyCase from the evaluation output. This pipeline would
2840
+ The pipeline is a directed acyclic graph representing data dependencies
2841
+ between workflows. For example, a simple pipeline might run an Evaluation
2842
+ and then create a SafetyCase from the evaluation output. This pipeline would
2825
2843
  have a graph structure like ``evaluation -> safetycase``.
2844
+
2845
+ Each node in the pipeline contains the specification of a Dyff API request.
2846
+ The request specifications may contain placeholders that reference other
2847
+ nodes in the pipeline graph. When the pipeline is run, the nodes execute
2848
+ in an order that respects their dependencies, and the placeholders are
2849
+ replaced with concrete values once they are known.
2826
2850
  """
2827
2851
 
2828
2852
  kind: Literal["Pipeline"] = Entities.Pipeline.value
@@ -2859,6 +2883,12 @@ class PipelineRun(DyffEntity, PipelineRunBase):
2859
2883
  return None
2860
2884
 
2861
2885
 
2886
+ class PipelineRunStatus(Status):
2887
+ nodes: dict[str, Status] = pydantic.Field(
2888
+ default_factory=dict, description="The status of each pipeline node."
2889
+ )
2890
+
2891
+
2862
2892
  # ---------------------------------------------------------------------------
2863
2893
  # Status enumerations
2864
2894
 
@@ -3099,34 +3129,6 @@ def is_status_success(status: str) -> bool:
3099
3129
  return status in [EntityStatus.complete, EntityStatus.ready]
3100
3130
 
3101
3131
 
3102
- _ENTITY_CLASS = {
3103
- Entities.Analysis: Analysis,
3104
- Entities.Artifact: OCIArtifact,
3105
- Entities.Audit: Audit,
3106
- Entities.AuditProcedure: AuditProcedure,
3107
- Entities.Challenge: Challenge,
3108
- Entities.Dataset: Dataset,
3109
- Entities.DataSource: DataSource,
3110
- Entities.Evaluation: Evaluation,
3111
- Entities.Family: Family,
3112
- Entities.Hazard: Hazard,
3113
- Entities.InferenceService: InferenceService,
3114
- Entities.InferenceSession: InferenceSession,
3115
- Entities.Measurement: Measurement,
3116
- Entities.Method: Method,
3117
- Entities.Model: Model,
3118
- Entities.Module: Module,
3119
- Entities.Report: Report,
3120
- Entities.SafetyCase: SafetyCase,
3121
- Entities.Team: Team,
3122
- Entities.UseCase: UseCase,
3123
- }
3124
-
3125
-
3126
- def entity_class(kind: Entities):
3127
- return _ENTITY_CLASS[kind]
3128
-
3129
-
3130
3132
  # A Union type containing all Dyff top-level schema types, except the ones that
3131
3133
  # should not have Revisions generated for them when they change
3132
3134
  _DyffEntityTypeRevisable = Union[
@@ -3206,6 +3208,37 @@ class Revision(DyffEntity, RevisionMetadata):
3206
3208
  DyffEntityType = Union[_DyffEntityTypeRevisable, History, Revision]
3207
3209
 
3208
3210
 
3211
+ _ENTITY_CLASS: dict[Entities, type[DyffEntityType]] = {
3212
+ Entities.Artifact: OCIArtifact,
3213
+ Entities.Audit: Audit,
3214
+ Entities.AuditProcedure: AuditProcedure,
3215
+ Entities.Challenge: Challenge,
3216
+ Entities.Dataset: Dataset,
3217
+ Entities.DataSource: DataSource,
3218
+ Entities.Evaluation: Evaluation,
3219
+ Entities.Family: Family,
3220
+ Entities.Hazard: Hazard,
3221
+ Entities.History: History,
3222
+ Entities.InferenceService: InferenceService,
3223
+ Entities.InferenceSession: InferenceSession,
3224
+ Entities.Measurement: Measurement,
3225
+ Entities.Method: Method,
3226
+ Entities.Model: Model,
3227
+ Entities.Module: Module,
3228
+ Entities.Pipeline: Pipeline,
3229
+ Entities.PipelineRun: PipelineRun,
3230
+ Entities.Report: Report,
3231
+ Entities.Revision: Revision,
3232
+ Entities.SafetyCase: SafetyCase,
3233
+ Entities.Team: Team,
3234
+ Entities.UseCase: UseCase,
3235
+ }
3236
+
3237
+
3238
+ def entity_class(kind: Entities) -> type[DyffEntityType]:
3239
+ return _ENTITY_CLASS[kind]
3240
+
3241
+
3209
3242
  # A TypeVar that matches any Dyff top-level schema type
3210
3243
  DyffEntityT = TypeVar(
3211
3244
  "DyffEntityT",
@@ -3371,10 +3404,14 @@ __all__ = [
3371
3404
  "OCIArtifact",
3372
3405
  "Pipeline",
3373
3406
  "PipelineBase",
3407
+ "PipelineEvaluationRequest",
3408
+ "PipelineMeasurementRequest",
3374
3409
  "PipelineNode",
3375
3410
  "PipelineParameter",
3376
3411
  "PipelineRun",
3377
3412
  "PipelineRunBase",
3413
+ "PipelineRunStatus",
3414
+ "PipelineSafetyCaseRequest",
3378
3415
  "QueryableDyffEntity",
3379
3416
  "Report",
3380
3417
  "ReportBase",
@@ -19,11 +19,10 @@ from datetime import datetime
19
19
  from typing import Any, Literal, Optional, Union
20
20
 
21
21
  import pydantic
22
- from typing_extensions import TypeAlias
23
22
 
24
23
  from ... import upcast
25
24
  from . import commands
26
- from .base import DyffBaseModel, DyffSchemaBaseModel, JsonMergePatchSemantics
25
+ from .base import DyffBaseModel, JsonMergePatchSemantics
27
26
  from .platform import (
28
27
  AnalysisRequestBase,
29
28
  AnalysisScope,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dyff-schema
3
- Version: 0.38.0
3
+ Version: 0.38.2
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
@@ -1,5 +1,5 @@
1
1
  dyff/schema/__init__.py,sha256=w7OWDFuyGKd6xt_yllNtKzHahPgywrfU4Ue02psYaMA,2244
2
- dyff/schema/_version.py,sha256=c6iSoBC38zb_RKO51qx5EpHTYKsovdOH6wTmfXhQoZs,80
2
+ dyff/schema/_version.py,sha256=vzg_BxADQGKoiaI8AUhHfE78RbKIhGvRvLFeN3aEmoc,80
3
3
  dyff/schema/adapters.py,sha256=YMTHv_2VlLGFp-Kqwa6H51hjffHmk8gXjZilHysIF5Q,123
4
4
  dyff/schema/annotations.py,sha256=nE6Jk1PLqlShj8uqjE_EzZC9zYnTDW5AVtQcjysiK8M,10018
5
5
  dyff/schema/base.py,sha256=jvaNtsSZyFfsdUZTcY_U-yfLY5_GyrMxSXhON2R9XR0,119
@@ -29,8 +29,8 @@ dyff/schema/v0/r1/adapters.py,sha256=hpwCSW8lkMkUKCLe0zaMUDu-VS_caSxJvPsECEi_XRA
29
29
  dyff/schema/v0/r1/base.py,sha256=1VJXVLKldOq3aH2HdVgxXXk4DJTZEIiaTa4GzMKzziU,20228
30
30
  dyff/schema/v0/r1/commands.py,sha256=jqbEvDRLpcVGWXqlbniuSKg3UIjlrpKt6_0hiwUpPfQ,20153
31
31
  dyff/schema/v0/r1/oci.py,sha256=YjHDVBJ2IIxqijll70OK6pM-qT6pq8tvU7D3YB9vGM0,6700
32
- dyff/schema/v0/r1/platform.py,sha256=QuZXp_PSI7hlXPiAn0TJwevHYIq_z4w3QQTB4PGm2s8,109389
33
- dyff/schema/v0/r1/requests.py,sha256=06ah2sDYzcLdokSrlqQyTCUoT4NKoqFvvjlfUU1DR8s,18382
32
+ dyff/schema/v0/r1/platform.py,sha256=jWZXCnf0MaZb7k3pWUSVJ9rf8833AFSCZXU99Ddyyec,110859
33
+ dyff/schema/v0/r1/requests.py,sha256=JMpdx9WBlUpePshacG85XMmlGPBkkaK5453VaK3kH9s,18321
34
34
  dyff/schema/v0/r1/responses.py,sha256=nxy7FPtfw2B_bljz5UGGuSE79HTkDQxKH56AJVmd4Qo,1287
35
35
  dyff/schema/v0/r1/test.py,sha256=X6dUyVd5svcPCI-PBMOAqEfK9jv3bRDvkQTJzwS96c0,10720
36
36
  dyff/schema/v0/r1/version.py,sha256=NONebgcv5Thsw_ymud6PacZdGjV6ndBrmLnap-obcpo,428
@@ -43,9 +43,9 @@ dyff/schema/v0/r1/dataset/text.py,sha256=MYG5seGODDryRSCy-g0Unh5dD0HCytmZ3FeElC-
43
43
  dyff/schema/v0/r1/dataset/vision.py,sha256=tJFF4dkhHX0UXTj1sPW-G22xTSI40gbYO465FuvmvAU,443
44
44
  dyff/schema/v0/r1/io/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
45
45
  dyff/schema/v0/r1/io/vllm.py,sha256=vWyLg-susbg0JDfv6VExBpgFdU2GHP2a14ChOdbckvs,5321
46
- dyff_schema-0.38.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
- dyff_schema-0.38.0.dist-info/licenses/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
48
- dyff_schema-0.38.0.dist-info/METADATA,sha256=WHoFpnO42oCa4VlL90M85Rw2l_ZmY0VDLN3P3nP5Kqc,3734
49
- dyff_schema-0.38.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
50
- dyff_schema-0.38.0.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
51
- dyff_schema-0.38.0.dist-info/RECORD,,
46
+ dyff_schema-0.38.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
+ dyff_schema-0.38.2.dist-info/licenses/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
48
+ dyff_schema-0.38.2.dist-info/METADATA,sha256=Npn-CVL-k0hByX8LQ5crFv23EDtLnsUDX0FQHvePF4s,3734
49
+ dyff_schema-0.38.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
50
+ dyff_schema-0.38.2.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
51
+ dyff_schema-0.38.2.dist-info/RECORD,,