dyff-schema 0.38.6__tar.gz → 0.38.9__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.

Potentially problematic release.


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

Files changed (68) hide show
  1. {dyff_schema-0.38.6/dyff_schema.egg-info → dyff_schema-0.38.9}/PKG-INFO +1 -1
  2. dyff_schema-0.38.9/dyff/schema/_version.py +2 -0
  3. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/platform.py +73 -10
  4. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/requests.py +8 -0
  5. {dyff_schema-0.38.6 → dyff_schema-0.38.9/dyff_schema.egg-info}/PKG-INFO +1 -1
  6. dyff_schema-0.38.6/dyff/schema/_version.py +0 -2
  7. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.gitignore +0 -0
  8. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.gitlab-ci.yml +0 -0
  9. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.idea/dyff-schema.iml +0 -0
  10. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.licenserc.yaml +0 -0
  11. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.pre-commit-config.yaml +0 -0
  12. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.prettierignore +0 -0
  13. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/.secrets.baseline +0 -0
  14. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/CODE_OF_CONDUCT.md +0 -0
  15. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/LICENSE +0 -0
  16. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/NOTICE +0 -0
  17. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/README.md +0 -0
  18. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/__init__.py +0 -0
  19. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/adapters.py +0 -0
  20. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/annotations.py +0 -0
  21. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/base.py +0 -0
  22. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/commands.py +0 -0
  23. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/copydoc.py +0 -0
  24. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/__init__.py +0 -0
  25. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/arrow.py +0 -0
  26. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/binary.py +0 -0
  27. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/classification.py +0 -0
  28. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/embedding.py +0 -0
  29. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/text.py +0 -0
  30. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/dataset/vision.py +0 -0
  31. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/errors.py +0 -0
  32. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/ids.py +0 -0
  33. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/io/__init__.py +0 -0
  34. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/io/vllm.py +0 -0
  35. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/platform.py +0 -0
  36. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/py.typed +0 -0
  37. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/quantity.py +0 -0
  38. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/requests.py +0 -0
  39. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/responses.py +0 -0
  40. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/test.py +0 -0
  41. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/__init__.py +0 -0
  42. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/__init__.py +0 -0
  43. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/adapters.py +0 -0
  44. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/base.py +0 -0
  45. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/commands.py +0 -0
  46. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
  47. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
  48. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/binary.py +0 -0
  49. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/classification.py +0 -0
  50. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
  51. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/text.py +0 -0
  52. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/dataset/vision.py +0 -0
  53. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/io/__init__.py +0 -0
  54. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/io/vllm.py +0 -0
  55. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/oci.py +0 -0
  56. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/responses.py +0 -0
  57. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/test.py +0 -0
  58. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/v0/r1/version.py +0 -0
  59. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff/schema/version.py +0 -0
  60. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff_schema.egg-info/SOURCES.txt +0 -0
  61. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff_schema.egg-info/dependency_links.txt +0 -0
  62. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff_schema.egg-info/requires.txt +0 -0
  63. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/dyff_schema.egg-info/top_level.txt +0 -0
  64. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/makefile +0 -0
  65. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/pyproject.toml +0 -0
  66. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/setup.cfg +0 -0
  67. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/tests/test_adapters.py +0 -0
  68. {dyff_schema-0.38.6 → dyff_schema-0.38.9}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dyff-schema
3
- Version: 0.38.6
3
+ Version: 0.38.9
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
@@ -0,0 +1,2 @@
1
+ __version__ = version = "0.38.9"
2
+ __version_tuple__ = version_tuple = (0, 38, 9)
@@ -2656,6 +2656,18 @@ class ChallengeTaskContent(DyffSchemaBaseModel):
2656
2656
  )
2657
2657
 
2658
2658
 
2659
+ class ChallengeSubmissionStructure(DyffSchemaBaseModel):
2660
+ submissionKind: EntityKindLiteral = pydantic.Field(
2661
+ default=Entities.InferenceService.value,
2662
+ description="The kind of entity that you can submit to this task.",
2663
+ )
2664
+ pipelineKeyword: str = pydantic.Field(
2665
+ default="submission",
2666
+ description="The keyword parameter where the submitted entity ID"
2667
+ " should be passed to the assessment Pipeline.",
2668
+ )
2669
+
2670
+
2659
2671
  class ChallengeTaskBase(DyffSchemaBaseModel):
2660
2672
  """The part of the ChallengeTask spec that is not system-populated."""
2661
2673
 
@@ -2669,7 +2681,11 @@ class ChallengeTaskBase(DyffSchemaBaseModel):
2669
2681
  pattern=r"[a-z0-9-]*",
2670
2682
  )
2671
2683
  assessment: str = pydantic.Field(
2672
- description="ID of the Assessment that the task runs."
2684
+ description="ID of the Pipeline used to assess the submission."
2685
+ )
2686
+ submissionStructure: ChallengeSubmissionStructure = pydantic.Field(
2687
+ default_factory=ChallengeSubmissionStructure,
2688
+ description="How to run the assessment pipeline on a new submission.",
2673
2689
  )
2674
2690
  rules: ChallengeTaskRules = pydantic.Field(description="The rules for submissions.")
2675
2691
  content: ChallengeTaskContent = pydantic.Field(
@@ -2729,7 +2745,14 @@ class Challenge(DyffEntity):
2729
2745
  return None
2730
2746
 
2731
2747
 
2732
- class ChallengeSubmission(DyffEntity):
2748
+ class ChallengeSubmissionBase(DyffSchemaBaseModel):
2749
+ team: str = pydantic.Field(description="The ID of the team making the submission.")
2750
+ submission: EntityIdentifier = pydantic.Field(
2751
+ description="The resource being submitted for assessment."
2752
+ )
2753
+
2754
+
2755
+ class ChallengeSubmission(DyffEntity, ChallengeSubmissionBase):
2733
2756
  """A submission of an inference system to a challenge by a team.
2734
2757
 
2735
2758
  All of the constituent resources must already exist. Creating a Submission simply
@@ -2746,9 +2769,8 @@ class ChallengeSubmission(DyffEntity):
2746
2769
  task: str = pydantic.Field(
2747
2770
  description="The key of the task within the challenge being submitted to."
2748
2771
  )
2749
- team: str = pydantic.Field(description="The ID of the team making the submission.")
2750
- inferenceService: str = pydantic.Field(
2751
- description="The ID of the inference service being submitted."
2772
+ pipelineRun: str = pydantic.Field(
2773
+ description="The ID of the PipelineRun for this submission."
2752
2774
  )
2753
2775
 
2754
2776
  def dependencies(self) -> list[str]:
@@ -2765,14 +2787,29 @@ class ChallengeSubmission(DyffEntity):
2765
2787
  class PipelineEvaluationRequest(EvaluationRequestBase):
2766
2788
  kind: Literal["PipelineEvaluationRequest"] = "PipelineEvaluationRequest"
2767
2789
 
2790
+ def dependencies(self) -> list[str]:
2791
+ # This is a dirty hack that works because the types are structurally
2792
+ # equivalent as far as .dependencies() cares
2793
+ return Evaluation.dependencies(self) # type: ignore[arg-type]
2794
+
2768
2795
 
2769
2796
  class PipelineMeasurementRequest(AnalysisRequestBase):
2770
2797
  kind: Literal["PipelineMeasurementRequest"] = "PipelineMeasurementRequest"
2771
2798
 
2799
+ def dependencies(self) -> list[str]:
2800
+ # This is a dirty hack that works because the types are structurally
2801
+ # equivalent as far as .dependencies() cares
2802
+ return Measurement.dependencies(self) # type: ignore[arg-type]
2803
+
2772
2804
 
2773
2805
  class PipelineSafetyCaseRequest(AnalysisRequestBase):
2774
2806
  kind: Literal["PipelineSafetyCaseRequest"] = "PipelineSafetyCaseRequest"
2775
2807
 
2808
+ def dependencies(self) -> list[str]:
2809
+ # This is a dirty hack that works because the types are structurally
2810
+ # equivalent as far as .dependencies() cares
2811
+ return SafetyCase.dependencies(self) # type: ignore[arg-type]
2812
+
2776
2813
 
2777
2814
  PipelineNodeRequest = Union[
2778
2815
  PipelineEvaluationRequest,
@@ -2814,16 +2851,25 @@ class PipelineNode(DyffSchemaBaseModel):
2814
2851
 
2815
2852
  class PipelineParameter(DyffSchemaBaseModel):
2816
2853
  """Declares a parameter that can be passed to the pipeline to customize its
2817
- behavior."""
2854
+ behavior.
2855
+
2856
+ By default, the argument will be substituted for the placeholder value
2857
+ ``$(keyword)``, where ``keyword`` is the ``.keyword`` property of the
2858
+ parameter. In this case, the value of the argument must be a string.
2818
2859
 
2819
- keyword: str = pydantic.Field(description="The keyword of the argument.")
2820
- destination: str = pydantic.Field(
2860
+ If ``.destination`` is specified, the argument will instead overwrite
2861
+ the value at the specified JSON path.
2862
+ """
2863
+
2864
+ keyword: str = pydantic.Field(description="The keyword of the parameter.")
2865
+ destination: Optional[str] = pydantic.Field(
2866
+ default=None,
2821
2867
  description="The field in a pipeline node to substitute with the"
2822
- " parameter value. Should be a string like 'node_name.field1.field2'."
2868
+ " parameter value. Should be a string like 'node_name.field1.field2'.",
2823
2869
  )
2824
2870
  description: Optional[str] = pydantic.Field(
2825
2871
  default=None,
2826
- description="A description of the argument.",
2872
+ description="A description of the parameter.",
2827
2873
  max_length=summary_maxlen(),
2828
2874
  )
2829
2875
 
@@ -2834,6 +2880,10 @@ class PipelineBase(DyffSchemaBaseModel):
2834
2880
  description="The nodes in the pipeline graph.",
2835
2881
  min_length=1,
2836
2882
  )
2883
+ parameters: dict[str, PipelineParameter] = pydantic.Field(
2884
+ default_factory=dict,
2885
+ description="Input parameters used to customize the pipeline.",
2886
+ )
2837
2887
 
2838
2888
  @pydantic.field_validator("nodes", mode="after")
2839
2889
  def validate_node_names_match(cls, nodes: dict[str, PipelineNode]):
@@ -2842,6 +2892,15 @@ class PipelineBase(DyffSchemaBaseModel):
2842
2892
  raise ValueError(f"nodes[{k}]: dict key must match value.name")
2843
2893
  return nodes
2844
2894
 
2895
+ @pydantic.field_validator("parameters", mode="after")
2896
+ def validate_parameter_keywords_match(
2897
+ cls, parameters: dict[str, PipelineParameter]
2898
+ ):
2899
+ for k, v in parameters.items():
2900
+ if k != v.keyword:
2901
+ raise ValueError(f"parameters[{k}]: dict key must match value.keyword")
2902
+ return parameters
2903
+
2845
2904
 
2846
2905
  class Pipeline(DyffEntity, PipelineBase):
2847
2906
  """A set of Dyff workflows that can be executed as a group.
@@ -3144,6 +3203,7 @@ _DyffEntityTypeRevisable = Union[
3144
3203
  Audit,
3145
3204
  AuditProcedure,
3146
3205
  Challenge,
3206
+ ChallengeSubmission,
3147
3207
  DataSource,
3148
3208
  Dataset,
3149
3209
  Evaluation,
@@ -3239,6 +3299,7 @@ _ENTITY_CLASS: dict[Entities, type[DyffEntityType]] = {
3239
3299
  Entities.Report: Report,
3240
3300
  Entities.Revision: Revision,
3241
3301
  Entities.SafetyCase: SafetyCase,
3302
+ Entities.Submission: ChallengeSubmission,
3242
3303
  Entities.Team: Team,
3243
3304
  Entities.UseCase: UseCase,
3244
3305
  }
@@ -3254,6 +3315,7 @@ DyffEntityT = TypeVar(
3254
3315
  Audit,
3255
3316
  AuditProcedure,
3256
3317
  Challenge,
3318
+ ChallengeSubmission,
3257
3319
  DataSource,
3258
3320
  Dataset,
3259
3321
  Evaluation,
@@ -3304,6 +3366,7 @@ __all__ = [
3304
3366
  "ChallengeContent",
3305
3367
  "ChallengeContentPage",
3306
3368
  "ChallengeSubmission",
3369
+ "ChallengeSubmissionBase",
3307
3370
  "ChallengeTask",
3308
3371
  "ChallengeTaskBase",
3309
3372
  "ChallengeTaskContent",
@@ -27,6 +27,7 @@ from .platform import (
27
27
  AnalysisRequestBase,
28
28
  AnalysisScope,
29
29
  ChallengeContent,
30
+ ChallengeSubmissionBase,
30
31
  ChallengeTaskBase,
31
32
  ConcernBase,
32
33
  DatasetBase,
@@ -148,6 +149,12 @@ class ChallengeCreateRequest(DyffEntityCreateRequest):
148
149
  )
149
150
 
150
151
 
152
+ class ChallengeSubmissionCreateRequest(
153
+ DyffEntityCreateRequest, ChallengeSubmissionBase
154
+ ):
155
+ pass
156
+
157
+
151
158
  class ChallengeTaskCreateRequest(DyffEntityCreateRequest, ChallengeTaskBase):
152
159
  pass
153
160
 
@@ -497,6 +504,7 @@ __all__ = [
497
504
  "ChallengeContentEditRequest",
498
505
  "ChallengeCreateRequest",
499
506
  "ChallengeQueryRequest",
507
+ "ChallengeSubmissionCreateRequest",
500
508
  "ChallengeTaskCreateRequest",
501
509
  "ChallengeTaskRulesEditRequest",
502
510
  "ChallengeTeamCreateRequest",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dyff-schema
3
- Version: 0.38.6
3
+ Version: 0.38.9
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,2 +0,0 @@
1
- __version__ = version = "0.38.6"
2
- __version_tuple__ = version_tuple = (0, 38, 6)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes