Request Types¶
The Pydantic models in dyff.schema.requests
define the data schema for requests sent to the Dyff system. You will typically encounter these types as arguments to Dyff API functions.
Resource Creation¶
- pydantic model dyff.schema.requests.AnalysisCreateRequest¶
Bases:
DyffEntityCreateRequest
,AnalysisBase
An Analysis transforms Datasets, Evaluations, and Measurements into new Measurements or SafetyCases.
- field account: str [Required]¶
Account that owns the entity
- field arguments: list[AnalysisArgument] [Optional]¶
Arguments to pass to the Method implementation.
- field inputs: list[AnalysisInput] [Optional]¶
Mapping of keywords to data entities.
- field method: str [Required]¶
Method ID
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field scope: AnalysisScope [Optional]¶
The specific entities to which the analysis results apply. At a minimum, the field corresponding to method.scope must be set.
- pydantic model dyff.schema.requests.ConcernCreateRequest¶
Bases:
DyffEntityCreateRequest
,ConcernBase
- field account: str [Required]¶
Account that owns the entity
- field documentation: DocumentationBase [Optional]¶
Documentation of the resource. The content is used to populate various views in the web UI.
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- pydantic model dyff.schema.requests.DatasetCreateRequest¶
Bases:
DyffEntityCreateRequest
,DatasetBase
- field account: str [Required]¶
Account that owns the entity
- field artifacts: list[Artifact] [Required]¶
Artifacts that comprise the dataset
- Constraints:
minItems = 1
- field name: str [Required]¶
The name of the Dataset
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field schema_: DataSchema [Required] (alias 'schema')¶
Schema of the dataset
- pydantic model dyff.schema.requests.EvaluationCreateRequest¶
Bases:
DyffEntityCreateRequest
,EvaluationBase
A description of how to run an InferenceService on a Dataset to obtain a set of evaluation results.
- field account: str [Required]¶
Account that owns the entity
- field dataset: str [Required]¶
The Dataset to evaluate on.
- field inferenceSession: EvaluationInferenceSessionRequest | None = None¶
Specification of the InferenceSession that will perform inference for the evaluation.
- field inferenceSessionReference: str | None = None¶
The ID of a running inference session that will be used for the evaluation, instead of starting a new one.
- field replications: int = 1¶
Number of replications to run.
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field workersPerReplica: int | None = None¶
Number of data workers per inference service replica.
- validator check_session_exactly_one » all fields¶
- pydantic model dyff.schema.requests.InferenceServiceCreateRequest¶
Bases:
DyffEntityCreateRequest
,InferenceServiceBase
- field account: str [Required]¶
Account that owns the entity
- field builder: InferenceServiceBuilder | None = None¶
Configuration of the Builder used to build the service.
- field interface: InferenceInterface [Required]¶
How to move data in and out of the service.
- field model: str | None = None¶
ID of Model backing the service, if applicable
- field name: str [Required]¶
The name of the service.
- field runner: InferenceServiceRunner | None = None¶
Configuration of the Runner used to run the service.
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- validator validate_image_not_none » image¶
- pydantic model dyff.schema.requests.InferenceSessionCreateRequest¶
Bases:
DyffEntityCreateRequest
,InferenceSessionBase
- field accelerator: Accelerator | None = None¶
Accelerator hardware to use.
- field account: str [Required]¶
Account that owns the entity
- field expires: datetime | None = None¶
Expiration time for the session. Use of this field is recommended to avoid accidental compute costs.
- field inferenceService: str [Required]¶
InferenceService ID
- field replicas: int = 1¶
Number of model replicas
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field useSpotPods: bool = True¶
Use ‘spot pods’ for cheaper computation
- pydantic model dyff.schema.requests.MethodCreateRequest¶
Bases:
DyffEntityCreateRequest
,MethodBase
- field account: str [Required]¶
Account that owns the entity
- field description: str | None = None¶
Long-form description, interpreted as Markdown.
- field implementation: MethodImplementation [Required]¶
How the Method is implemented.
- field inputs: list[MethodInput] [Optional]¶
Input data entities consumed by the Method. Available at ctx.inputs(keyword)
- field modules: list[str] [Optional]¶
Modules to load into the analysis environment
- field name: str [Required]¶
Descriptive name of the Method.
- field output: MethodOutput [Required]¶
Specification of the Method output.
- field parameters: list[MethodParameter] [Optional]¶
Configuration parameters accepted by the Method. Values are available at ctx.args(keyword)
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field scope: MethodScope [Required]¶
The scope of the Method. The Method produces outputs that are specific to one entity of the type specified in the .scope field.
- pydantic model dyff.schema.requests.ModelCreateRequest¶
Bases:
DyffEntityCreateRequest
,ModelSpec
- field accelerators: list[Accelerator] | None = None¶
Accelerator hardware that is compatible with the model.
- field account: str [Required]¶
Account that owns the entity
- field artifact: ModelArtifact [Required]¶
How the model data is represented
- field name: str [Required]¶
The name of the Model.
- field resources: ModelResources [Required]¶
Resource requirements of the model.
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field source: ModelSource [Required]¶
Source from which the model artifact was obtained
- field storage: ModelStorage [Required]¶
How the model data is stored
- pydantic model dyff.schema.requests.ModuleCreateRequest¶
Bases:
DyffEntityCreateRequest
,ModuleBase
- field account: str [Required]¶
Account that owns the entity
- field artifacts: list[Artifact] [Required]¶
Artifacts that comprise the Module implementation
- Constraints:
minItems = 1
- field name: str [Required]¶
The name of the Module
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- pydantic model dyff.schema.requests.ReportCreateRequest¶
Bases:
DyffEntityCreateRequest
,ReportBase
A Report transforms raw model outputs into some useful statistics.
Deprecated since version 0.8.0: Report functionality has been refactored into the Method/Measurement/Analysis apparatus. Creation of new Reports is disabled.
- field account: str [Required]¶
Account that owns the entity
- field datasetView: str | DataView | None = None¶
View of the input dataset required by the report (e.g., ground-truth labels).
- field evaluation: str [Required]¶
The evaluation (and corresponding output data) to run the report on.
- field evaluationView: str | DataView | None = None¶
View of the evaluation output data required by the report.
- field modules: list[str] [Optional]¶
Additional modules to load into the report environment
- field rubric: str [Required]¶
The scoring rubric to apply (e.g., ‘classification.TopKAccuracy’).
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
Queries¶
- pydantic model dyff.schema.requests.DatasetQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field name: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.DocumentationQueryRequest¶
Bases:
QueryRequest
- field id: str | None = None¶
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- pydantic model dyff.schema.requests.EvaluationQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field dataset: str | None = None¶
- field id: str | None = None¶
- field inferenceService: str | None = None¶
- field inferenceServiceName: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field model: str | None = None¶
- field modelName: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.InferenceServiceQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field model: str | None = None¶
- field modelName: str | None = None¶
- field name: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.InferenceSessionQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field inferenceService: str | None = None¶
- field inferenceServiceName: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field model: str | None = None¶
- field modelName: str | None = None¶
- field name: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.MeasurementQueryRequest¶
Bases:
_AnalysisProductQueryRequest
- field account: str | None = None¶
- field dataset: str | None = None¶
- field evaluation: str | None = None¶
- field id: str | None = None¶
- field inferenceService: str | None = None¶
- field inputs: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field method: str | None = None¶
- field methodName: str | None = None¶
- field model: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.MethodQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field name: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field outputKind: str | None = None¶
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.ModelQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field name: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.ModuleQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field name: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.ReportQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field dataset: str | None = None¶
- field evaluation: str | None = None¶
- field id: str | None = None¶
- field inferenceService: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field model: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field report: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.SafetyCaseQueryRequest¶
Bases:
_AnalysisProductQueryRequest
- field account: str | None = None¶
- field dataset: str | None = None¶
- field evaluation: str | None = None¶
- field id: str | None = None¶
- field inferenceService: str | None = None¶
- field inputs: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field method: str | None = None¶
- field methodName: str | None = None¶
- field model: str | None = None¶
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
- pydantic model dyff.schema.requests.ScoreQueryRequest¶
Bases:
DyffRequestDefaultValidators
- field dataset: str | None = None¶
- field evaluation: str | None = None¶
- field id: str | None = None¶
- field inferenceService: str | None = None¶
- field method: str | None = None¶
- field methodName: str | None = None¶
- field model: str | None = None¶
- field name: str | None = None¶
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- pydantic model dyff.schema.requests.UseCaseQueryRequest¶
Bases:
DyffEntityQueryRequest
- field account: str | None = None¶
- field id: str | None = None¶
- field labels: str | None = None¶
Labels dict represented as a JSON string.
- field limit: int | None = None¶
Return at most this many results. The order of operations is query -> order -> limit.
- Constraints:
minimum = 1
- field order: Literal['ascending', 'descending'] | None = None¶
Sort the results in this order. Default: unsorted. Ignored unless ‘orderBy’ is also set. The order of operations is query -> order -> limit.
- field orderBy: str | None = None¶
Sort the results by the value of the specified field. The ‘order’ field must be set also. The order of operations is query -> order -> limit.
- field query: str | None = None¶
A JSON structure describing a query, encoded as a string. Valid keys are the same as the valid query keys for the corresponding endpoint. Values can be scalars or lists. Lists are treated as disjunctive queries (i.e., ‘value $in list’).
- field reason: str | None = None¶
- field status: str | None = None¶
Metadata¶
- pydantic model dyff.schema.requests.DocumentationEditRequest¶
Bases:
DyffRequestBase
,DocumentationBase
- field fullPage: str | None = None¶
Long-form documentation. Interpreted as Markdown. There are no length constraints, but be reasonable.
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.
- field summary: str | None = None¶
A brief summary, suitable for display in small UI elements. Interpreted as Markdown. Excessively long summaries may be truncated in the UI, especially on small displays.
- field title: str | None = None¶
A short plain string suitable as a title or “headline”.
- pydantic model dyff.schema.requests.LabelUpdateRequest¶
Bases:
DyffRequestBase
,Labeled
- field labels: dict[LabelKey, LabelValue] [Optional]¶
A set of key-value labels for the resource. Used to specify identifying attributes of resources that are meaningful to users but do not imply semantics in the dyff system.
The keys are DNS labels with an optional DNS domain prefix. For example: ‘my-key’, ‘your.com/key_0’. Keys prefixed with ‘dyff.io/’, ‘subdomain.dyff.io/’, etc. are reserved.
The label values are alphanumeric characters separated by ‘.’, ‘-’, or ‘_’.
We follow the kubernetes label conventions closely. See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
- field schemaVersion: Literal['0.1'] = '0.1'¶
The schema version.