dyff-schema 0.38.5__tar.gz → 0.38.12__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.5/dyff_schema.egg-info → dyff_schema-0.38.12}/PKG-INFO +1 -1
  2. dyff_schema-0.38.12/dyff/schema/_version.py +2 -0
  3. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/platform.py +78 -10
  4. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/requests.py +13 -0
  5. {dyff_schema-0.38.5 → dyff_schema-0.38.12/dyff_schema.egg-info}/PKG-INFO +1 -1
  6. dyff_schema-0.38.5/dyff/schema/_version.py +0 -2
  7. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.gitignore +0 -0
  8. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.gitlab-ci.yml +0 -0
  9. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.idea/dyff-schema.iml +0 -0
  10. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.licenserc.yaml +0 -0
  11. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.pre-commit-config.yaml +0 -0
  12. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.prettierignore +0 -0
  13. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/.secrets.baseline +0 -0
  14. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/CODE_OF_CONDUCT.md +0 -0
  15. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/LICENSE +0 -0
  16. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/NOTICE +0 -0
  17. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/README.md +0 -0
  18. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/__init__.py +0 -0
  19. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/adapters.py +0 -0
  20. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/annotations.py +0 -0
  21. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/base.py +0 -0
  22. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/commands.py +0 -0
  23. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/copydoc.py +0 -0
  24. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/__init__.py +0 -0
  25. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/arrow.py +0 -0
  26. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/binary.py +0 -0
  27. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/classification.py +0 -0
  28. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/embedding.py +0 -0
  29. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/text.py +0 -0
  30. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/dataset/vision.py +0 -0
  31. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/errors.py +0 -0
  32. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/ids.py +0 -0
  33. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/io/__init__.py +0 -0
  34. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/io/vllm.py +0 -0
  35. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/platform.py +0 -0
  36. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/py.typed +0 -0
  37. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/quantity.py +0 -0
  38. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/requests.py +0 -0
  39. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/responses.py +0 -0
  40. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/test.py +0 -0
  41. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/__init__.py +0 -0
  42. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/__init__.py +0 -0
  43. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/adapters.py +0 -0
  44. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/base.py +0 -0
  45. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/commands.py +0 -0
  46. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
  47. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
  48. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/binary.py +0 -0
  49. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/classification.py +0 -0
  50. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
  51. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/text.py +0 -0
  52. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/dataset/vision.py +0 -0
  53. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/io/__init__.py +0 -0
  54. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/io/vllm.py +0 -0
  55. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/oci.py +0 -0
  56. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/responses.py +0 -0
  57. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/test.py +0 -0
  58. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/v0/r1/version.py +0 -0
  59. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff/schema/version.py +0 -0
  60. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff_schema.egg-info/SOURCES.txt +0 -0
  61. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff_schema.egg-info/dependency_links.txt +0 -0
  62. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff_schema.egg-info/requires.txt +0 -0
  63. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/dyff_schema.egg-info/top_level.txt +0 -0
  64. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/makefile +0 -0
  65. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/pyproject.toml +0 -0
  66. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/setup.cfg +0 -0
  67. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/tests/test_adapters.py +0 -0
  68. {dyff_schema-0.38.5 → dyff_schema-0.38.12}/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.5
3
+ Version: 0.38.12
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.12"
2
+ __version_tuple__ = version_tuple = (0, 38, 12)
@@ -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,33 @@ class ChallengeSubmission(DyffEntity):
2765
2787
  class PipelineEvaluationRequest(EvaluationRequestBase):
2766
2788
  kind: Literal["PipelineEvaluationRequest"] = "PipelineEvaluationRequest"
2767
2789
 
2790
+ def dependencies(self) -> list[str]:
2791
+ if self.inferenceSession is None:
2792
+ raise AssertionError()
2793
+ return [self.dataset, self.inferenceSession.inferenceService]
2794
+
2795
+ @pydantic.model_validator(mode="after")
2796
+ def check_session_not_reference(self):
2797
+ if self.inferenceSession is None or self.inferenceSessionReference is not None:
2798
+ raise ValueError(
2799
+ "evaluations in pipelines must set inferenceSession, not inferenceSessionReference"
2800
+ )
2801
+ return self
2802
+
2768
2803
 
2769
2804
  class PipelineMeasurementRequest(AnalysisRequestBase):
2770
2805
  kind: Literal["PipelineMeasurementRequest"] = "PipelineMeasurementRequest"
2771
2806
 
2807
+ def dependencies(self) -> list[str]:
2808
+ return [self.method] + [x.entity for x in self.inputs]
2809
+
2772
2810
 
2773
2811
  class PipelineSafetyCaseRequest(AnalysisRequestBase):
2774
2812
  kind: Literal["PipelineSafetyCaseRequest"] = "PipelineSafetyCaseRequest"
2775
2813
 
2814
+ def dependencies(self) -> list[str]:
2815
+ return [self.method] + [x.entity for x in self.inputs]
2816
+
2776
2817
 
2777
2818
  PipelineNodeRequest = Union[
2778
2819
  PipelineEvaluationRequest,
@@ -2814,16 +2855,25 @@ class PipelineNode(DyffSchemaBaseModel):
2814
2855
 
2815
2856
  class PipelineParameter(DyffSchemaBaseModel):
2816
2857
  """Declares a parameter that can be passed to the pipeline to customize its
2817
- behavior."""
2858
+ behavior.
2818
2859
 
2819
- keyword: str = pydantic.Field(description="The keyword of the argument.")
2820
- destination: str = pydantic.Field(
2860
+ By default, the argument will be substituted for the placeholder value
2861
+ ``$(keyword)``, where ``keyword`` is the ``.keyword`` property of the
2862
+ parameter. In this case, the value of the argument must be a string.
2863
+
2864
+ If ``.destination`` is specified, the argument will instead overwrite
2865
+ the value at the specified JSON path.
2866
+ """
2867
+
2868
+ keyword: str = pydantic.Field(description="The keyword of the parameter.")
2869
+ destination: Optional[str] = pydantic.Field(
2870
+ default=None,
2821
2871
  description="The field in a pipeline node to substitute with the"
2822
- " parameter value. Should be a string like 'node_name.field1.field2'."
2872
+ " parameter value. Should be a string like 'node_name.field1.field2'.",
2823
2873
  )
2824
2874
  description: Optional[str] = pydantic.Field(
2825
2875
  default=None,
2826
- description="A description of the argument.",
2876
+ description="A description of the parameter.",
2827
2877
  max_length=summary_maxlen(),
2828
2878
  )
2829
2879
 
@@ -2834,6 +2884,10 @@ class PipelineBase(DyffSchemaBaseModel):
2834
2884
  description="The nodes in the pipeline graph.",
2835
2885
  min_length=1,
2836
2886
  )
2887
+ parameters: dict[str, PipelineParameter] = pydantic.Field(
2888
+ default_factory=dict,
2889
+ description="Input parameters used to customize the pipeline.",
2890
+ )
2837
2891
 
2838
2892
  @pydantic.field_validator("nodes", mode="after")
2839
2893
  def validate_node_names_match(cls, nodes: dict[str, PipelineNode]):
@@ -2842,6 +2896,15 @@ class PipelineBase(DyffSchemaBaseModel):
2842
2896
  raise ValueError(f"nodes[{k}]: dict key must match value.name")
2843
2897
  return nodes
2844
2898
 
2899
+ @pydantic.field_validator("parameters", mode="after")
2900
+ def validate_parameter_keywords_match(
2901
+ cls, parameters: dict[str, PipelineParameter]
2902
+ ):
2903
+ for k, v in parameters.items():
2904
+ if k != v.keyword:
2905
+ raise ValueError(f"parameters[{k}]: dict key must match value.keyword")
2906
+ return parameters
2907
+
2845
2908
 
2846
2909
  class Pipeline(DyffEntity, PipelineBase):
2847
2910
  """A set of Dyff workflows that can be executed as a group.
@@ -3144,6 +3207,7 @@ _DyffEntityTypeRevisable = Union[
3144
3207
  Audit,
3145
3208
  AuditProcedure,
3146
3209
  Challenge,
3210
+ ChallengeSubmission,
3147
3211
  DataSource,
3148
3212
  Dataset,
3149
3213
  Evaluation,
@@ -3239,6 +3303,7 @@ _ENTITY_CLASS: dict[Entities, type[DyffEntityType]] = {
3239
3303
  Entities.Report: Report,
3240
3304
  Entities.Revision: Revision,
3241
3305
  Entities.SafetyCase: SafetyCase,
3306
+ Entities.Submission: ChallengeSubmission,
3242
3307
  Entities.Team: Team,
3243
3308
  Entities.UseCase: UseCase,
3244
3309
  }
@@ -3254,6 +3319,7 @@ DyffEntityT = TypeVar(
3254
3319
  Audit,
3255
3320
  AuditProcedure,
3256
3321
  Challenge,
3322
+ ChallengeSubmission,
3257
3323
  DataSource,
3258
3324
  Dataset,
3259
3325
  Evaluation,
@@ -3304,6 +3370,8 @@ __all__ = [
3304
3370
  "ChallengeContent",
3305
3371
  "ChallengeContentPage",
3306
3372
  "ChallengeSubmission",
3373
+ "ChallengeSubmissionBase",
3374
+ "ChallengeSubmissionStructure",
3307
3375
  "ChallengeTask",
3308
3376
  "ChallengeTaskBase",
3309
3377
  "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
 
@@ -398,6 +405,10 @@ class AuditQueryRequest(DyffEntityQueryRequest):
398
405
  name: Optional[str] = pydantic.Field(default=None)
399
406
 
400
407
 
408
+ class ChallengeQueryRequest(DyffEntityQueryRequest):
409
+ pass
410
+
411
+
401
412
  class DatasetQueryRequest(DyffEntityQueryRequest):
402
413
  name: Optional[str] = pydantic.Field(default=None)
403
414
 
@@ -492,6 +503,8 @@ __all__ = [
492
503
  "AuditQueryRequest",
493
504
  "ChallengeContentEditRequest",
494
505
  "ChallengeCreateRequest",
506
+ "ChallengeQueryRequest",
507
+ "ChallengeSubmissionCreateRequest",
495
508
  "ChallengeTaskCreateRequest",
496
509
  "ChallengeTaskRulesEditRequest",
497
510
  "ChallengeTeamCreateRequest",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dyff-schema
3
- Version: 0.38.5
3
+ Version: 0.38.12
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.5"
2
- __version_tuple__ = version_tuple = (0, 38, 5)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes