truefoundry 0.5.0rc5__py3-none-any.whl → 0.5.0rc7__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 truefoundry might be problematic. Click here for more details.

Files changed (59) hide show
  1. truefoundry/ml/__init__.py +2 -1
  2. truefoundry/ml/artifact/truefoundry_artifact_repo.py +8 -3
  3. truefoundry/ml/autogen/client/__init__.py +6 -4
  4. truefoundry/ml/autogen/client/api/deprecated_api.py +340 -7
  5. truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +0 -322
  6. truefoundry/ml/autogen/client/api_client.py +8 -1
  7. truefoundry/ml/autogen/client/models/__init__.py +6 -4
  8. truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +3 -17
  9. truefoundry/ml/autogen/client/models/agent.py +1 -1
  10. truefoundry/ml/autogen/client/models/agent_app.py +1 -1
  11. truefoundry/ml/autogen/client/models/agent_open_api_tool.py +1 -1
  12. truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +1 -1
  13. truefoundry/ml/autogen/client/models/agent_with_fqn.py +1 -1
  14. truefoundry/ml/autogen/client/models/artifact_version_manifest.py +1 -1
  15. truefoundry/ml/autogen/client/models/assistant_message.py +1 -1
  16. truefoundry/ml/autogen/client/models/blob_storage_reference.py +1 -1
  17. truefoundry/ml/autogen/client/models/chat_prompt.py +1 -1
  18. truefoundry/ml/autogen/client/models/external_artifact_source.py +1 -1
  19. truefoundry/ml/autogen/client/models/fast_ai_framework.py +1 -1
  20. truefoundry/ml/autogen/client/models/gluon_framework.py +1 -1
  21. truefoundry/ml/autogen/client/models/h2_o_framework.py +1 -1
  22. truefoundry/ml/autogen/client/models/image_content_part.py +1 -1
  23. truefoundry/ml/autogen/client/models/keras_framework.py +1 -1
  24. truefoundry/ml/autogen/client/models/light_gbm_framework.py +1 -1
  25. truefoundry/ml/autogen/client/models/model_version_dto.py +7 -8
  26. truefoundry/ml/autogen/client/models/model_version_environment.py +97 -0
  27. truefoundry/ml/autogen/client/models/model_version_manifest.py +12 -1
  28. truefoundry/ml/autogen/client/models/onnx_framework.py +1 -1
  29. truefoundry/ml/autogen/client/models/paddle_framework.py +1 -1
  30. truefoundry/ml/autogen/client/models/py_torch_framework.py +1 -1
  31. truefoundry/ml/autogen/client/models/{feature_value_type.py → serialization_format.py} +8 -8
  32. truefoundry/ml/autogen/client/models/sklearn_framework.py +16 -3
  33. truefoundry/ml/autogen/client/models/spa_cy_framework.py +1 -1
  34. truefoundry/ml/autogen/client/models/stats_models_framework.py +1 -1
  35. truefoundry/ml/autogen/client/models/system_message.py +1 -1
  36. truefoundry/ml/autogen/client/models/tensor_flow_framework.py +1 -1
  37. truefoundry/ml/autogen/client/models/text_content_part.py +1 -1
  38. truefoundry/ml/autogen/client/models/transformers_framework.py +1 -1
  39. truefoundry/ml/autogen/client/models/true_foundry_artifact_source.py +1 -1
  40. truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +1 -13
  41. truefoundry/ml/autogen/client/models/user_message.py +1 -1
  42. truefoundry/ml/autogen/client/models/xg_boost_framework.py +16 -3
  43. truefoundry/ml/autogen/client_README.md +6 -8
  44. truefoundry/ml/autogen/entities/artifacts.py +38 -1
  45. truefoundry/ml/autogen/models/__init__.py +4 -0
  46. truefoundry/ml/autogen/models/exceptions.py +30 -0
  47. truefoundry/ml/autogen/models/schema.py +1547 -0
  48. truefoundry/ml/autogen/models/signature.py +139 -0
  49. truefoundry/ml/autogen/models/utils.py +699 -0
  50. truefoundry/ml/log_types/artifacts/model.py +3 -0
  51. truefoundry/ml/mlfoundry_api.py +3 -1
  52. truefoundry/ml/mlfoundry_run.py +3 -1
  53. {truefoundry-0.5.0rc5.dist-info → truefoundry-0.5.0rc7.dist-info}/METADATA +2 -2
  54. {truefoundry-0.5.0rc5.dist-info → truefoundry-0.5.0rc7.dist-info}/RECORD +56 -53
  55. truefoundry/ml/autogen/client/models/feature_dto.py +0 -68
  56. truefoundry/ml/autogen/client/models/model_schema_dto.py +0 -85
  57. truefoundry/ml/autogen/client/models/prediction_type.py +0 -34
  58. {truefoundry-0.5.0rc5.dist-info → truefoundry-0.5.0rc7.dist-info}/WHEEL +0 -0
  59. {truefoundry-0.5.0rc5.dist-info → truefoundry-0.5.0rc7.dist-info}/entry_points.txt +0 -0
@@ -26,7 +26,6 @@ from truefoundry.ml.autogen.client.models.artifact_version_status import (
26
26
  ArtifactVersionStatus,
27
27
  )
28
28
  from truefoundry.ml.autogen.client.models.metric_dto import MetricDto
29
- from truefoundry.ml.autogen.client.models.model_schema_dto import ModelSchemaDto
30
29
  from truefoundry.ml.autogen.client.models.model_version_manifest import (
31
30
  ModelVersionManifest,
32
31
  )
@@ -58,7 +57,7 @@ class ModelVersionDto(BaseModel):
58
57
  step: Optional[StrictInt] = 0
59
58
  created_by: Optional[StrictStr] = None
60
59
  created_by_subject: Subject = Field(...)
61
- model_schema: Optional[ModelSchemaDto] = None
60
+ model_schema: Optional[Dict[str, Any]] = None
62
61
  custom_metrics: Optional[conlist(Dict[str, Any])] = None
63
62
  created_at: Optional[datetime] = None
64
63
  updated_at: Optional[datetime] = None
@@ -73,6 +72,7 @@ class ModelVersionDto(BaseModel):
73
72
  artifact_size: Optional[StrictInt] = None
74
73
  manifest: Optional[ModelVersionManifest] = None
75
74
  serialization_format: ArtifactVersionSerializationFormat = Field(...)
75
+ deployable: Optional[StrictBool] = False
76
76
  __properties = [
77
77
  "id",
78
78
  "model_id",
@@ -101,6 +101,7 @@ class ModelVersionDto(BaseModel):
101
101
  "artifact_size",
102
102
  "manifest",
103
103
  "serialization_format",
104
+ "deployable",
104
105
  ]
105
106
 
106
107
  class Config:
@@ -128,9 +129,6 @@ class ModelVersionDto(BaseModel):
128
129
  # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of created_by_subject
129
130
  if self.created_by_subject:
130
131
  _dict["created_by_subject"] = self.created_by_subject.to_dict()
131
- # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
132
- if self.model_schema:
133
- _dict["model_schema"] = self.model_schema.to_dict()
134
132
  # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in metrics (list)
135
133
  _items = []
136
134
  if self.metrics:
@@ -168,9 +166,7 @@ class ModelVersionDto(BaseModel):
168
166
  "created_by_subject": Subject.from_dict(obj.get("created_by_subject"))
169
167
  if obj.get("created_by_subject") is not None
170
168
  else None,
171
- "model_schema": ModelSchemaDto.from_dict(obj.get("model_schema"))
172
- if obj.get("model_schema") is not None
173
- else None,
169
+ "model_schema": obj.get("model_schema"),
174
170
  "custom_metrics": obj.get("custom_metrics"),
175
171
  "created_at": obj.get("created_at"),
176
172
  "updated_at": obj.get("updated_at"),
@@ -191,6 +187,9 @@ class ModelVersionDto(BaseModel):
191
187
  if obj.get("manifest") is not None
192
188
  else None,
193
189
  "serialization_format": obj.get("serialization_format"),
190
+ "deployable": obj.get("deployable")
191
+ if obj.get("deployable") is not None
192
+ else False,
194
193
  }
195
194
  )
196
195
  return _obj
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ import re # noqa: F401
19
+ from typing import Optional
20
+
21
+ from truefoundry.pydantic_v1 import (
22
+ BaseModel,
23
+ Field,
24
+ StrictStr,
25
+ conlist,
26
+ constr,
27
+ validator,
28
+ )
29
+
30
+
31
+ class ModelVersionEnvironment(BaseModel):
32
+ """
33
+ +label=ModelVersionEnvironment # noqa: E501
34
+ """
35
+
36
+ python_version: Optional[constr(strict=True)] = Field(
37
+ default=None,
38
+ description="+label=Python Version +usage=Python version for the model version",
39
+ )
40
+ pip_packages: Optional[conlist(StrictStr)] = Field(
41
+ default=None,
42
+ description="+label=PIP Packages +usage=PIP packages for the model version",
43
+ )
44
+ __properties = ["python_version", "pip_packages"]
45
+
46
+ @validator("python_version")
47
+ def python_version_validate_regular_expression(cls, value):
48
+ """Validates the regular expression"""
49
+ if value is None:
50
+ return value
51
+
52
+ if not re.match(r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$", value):
53
+ raise ValueError(
54
+ r"must validate the regular expression /^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$/"
55
+ )
56
+ return value
57
+
58
+ class Config:
59
+ """Pydantic configuration"""
60
+
61
+ allow_population_by_field_name = True
62
+ validate_assignment = True
63
+
64
+ def to_str(self) -> str:
65
+ """Returns the string representation of the model using alias"""
66
+ return pprint.pformat(self.dict(by_alias=True))
67
+
68
+ def to_json(self) -> str:
69
+ """Returns the JSON representation of the model using alias"""
70
+ return json.dumps(self.to_dict())
71
+
72
+ @classmethod
73
+ def from_json(cls, json_str: str) -> ModelVersionEnvironment:
74
+ """Create an instance of ModelVersionEnvironment from a JSON string"""
75
+ return cls.from_dict(json.loads(json_str))
76
+
77
+ def to_dict(self):
78
+ """Returns the dictionary representation of the model using alias"""
79
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: dict) -> ModelVersionEnvironment:
84
+ """Create an instance of ModelVersionEnvironment from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return ModelVersionEnvironment.parse_obj(obj)
90
+
91
+ _obj = ModelVersionEnvironment.parse_obj(
92
+ {
93
+ "python_version": obj.get("python_version"),
94
+ "pip_packages": obj.get("pip_packages"),
95
+ }
96
+ )
97
+ return _obj
@@ -19,6 +19,9 @@ import re # noqa: F401
19
19
  from typing import Any, Dict, Optional
20
20
 
21
21
  from truefoundry.ml.autogen.client.models.framework import Framework
22
+ from truefoundry.ml.autogen.client.models.model_version_environment import (
23
+ ModelVersionEnvironment,
24
+ )
22
25
  from truefoundry.ml.autogen.client.models.source1 import Source1
23
26
  from truefoundry.pydantic_v1 import (
24
27
  BaseModel,
@@ -46,6 +49,7 @@ class ModelVersionManifest(BaseModel):
46
49
  type: Optional[StrictStr] = "model-version"
47
50
  source: Source1 = Field(...)
48
51
  framework: Optional[Framework] = None
52
+ environment: Optional[ModelVersionEnvironment] = None
49
53
  step: Optional[conint(strict=True, ge=0)] = Field(
50
54
  default=0, description="+label=Step"
51
55
  )
@@ -59,6 +63,7 @@ class ModelVersionManifest(BaseModel):
59
63
  "type",
60
64
  "source",
61
65
  "framework",
66
+ "environment",
62
67
  "step",
63
68
  "model_schema",
64
69
  ]
@@ -69,7 +74,7 @@ class ModelVersionManifest(BaseModel):
69
74
  if value is None:
70
75
  return value
71
76
 
72
- if value not in ("model-version"):
77
+ if value not in ("model-version",):
73
78
  raise ValueError("must be one of enum values ('model-version')")
74
79
  return value
75
80
 
@@ -101,6 +106,9 @@ class ModelVersionManifest(BaseModel):
101
106
  # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of framework
102
107
  if self.framework:
103
108
  _dict["framework"] = self.framework.to_dict()
109
+ # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of environment
110
+ if self.environment:
111
+ _dict["environment"] = self.environment.to_dict()
104
112
  return _dict
105
113
 
106
114
  @classmethod
@@ -125,6 +133,9 @@ class ModelVersionManifest(BaseModel):
125
133
  "framework": Framework.from_dict(obj.get("framework"))
126
134
  if obj.get("framework") is not None
127
135
  else None,
136
+ "environment": ModelVersionEnvironment.from_dict(obj.get("environment"))
137
+ if obj.get("environment") is not None
138
+ else None,
128
139
  "step": obj.get("step") if obj.get("step") is not None else 0,
129
140
  "model_schema": obj.get("model_schema"),
130
141
  }
@@ -33,7 +33,7 @@ class ONNXFramework(BaseModel):
33
33
  @validator("type")
34
34
  def type_validate_enum(cls, value):
35
35
  """Validates the enum"""
36
- if value not in ("onnx"):
36
+ if value not in ("onnx",):
37
37
  raise ValueError("must be one of enum values ('onnx')")
38
38
  return value
39
39
 
@@ -34,7 +34,7 @@ class PaddleFramework(BaseModel):
34
34
  @validator("type")
35
35
  def type_validate_enum(cls, value):
36
36
  """Validates the enum"""
37
- if value not in ("paddle"):
37
+ if value not in ("paddle",):
38
38
  raise ValueError("must be one of enum values ('paddle')")
39
39
  return value
40
40
 
@@ -34,7 +34,7 @@ class PyTorchFramework(BaseModel):
34
34
  @validator("type")
35
35
  def type_validate_enum(cls, value):
36
36
  """Validates the enum"""
37
- if value not in ("pytorch"):
37
+ if value not in ("pytorch",):
38
38
  raise ValueError("must be one of enum values ('pytorch')")
39
39
  return value
40
40
 
@@ -17,19 +17,19 @@ import re # noqa: F401
17
17
  from aenum import Enum
18
18
 
19
19
 
20
- class FeatureValueType(str, Enum):
20
+ class SerializationFormat(str, Enum):
21
21
  """
22
- An enumeration.
22
+ +label=Serialization format +usage=Serialization format used for the model
23
23
  """
24
24
 
25
25
  """
26
26
  allowed enum values
27
27
  """
28
- INT = "int"
29
- FLOAT = "float"
30
- STRING = "string"
28
+ CLOUDPICKLE = "cloudpickle"
29
+ JOBLIB = "joblib"
30
+ PICKLE = "pickle"
31
31
 
32
32
  @classmethod
33
- def from_json(cls, json_str: str) -> FeatureValueType:
34
- """Create an instance of FeatureValueType from a JSON string"""
35
- return FeatureValueType(json.loads(json_str))
33
+ def from_json(cls, json_str: str) -> SerializationFormat:
34
+ """Create an instance of SerializationFormat from a JSON string"""
35
+ return SerializationFormat(json.loads(json_str))
@@ -16,7 +16,11 @@ from __future__ import annotations
16
16
  import json
17
17
  import pprint
18
18
  import re # noqa: F401
19
+ from typing import Optional
19
20
 
21
+ from truefoundry.ml.autogen.client.models.serialization_format import (
22
+ SerializationFormat,
23
+ )
20
24
  from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
21
25
 
22
26
 
@@ -29,12 +33,16 @@ class SklearnFramework(BaseModel):
29
33
  default=...,
30
34
  description="+label=Type +usage=Type of the framework +value=sklearn",
31
35
  )
32
- __properties = ["type"]
36
+ serialization_format: Optional[SerializationFormat] = Field(
37
+ default=None,
38
+ description="+label=Serialization format +usage=Serialization format used for the model",
39
+ )
40
+ __properties = ["type", "serialization_format"]
33
41
 
34
42
  @validator("type")
35
43
  def type_validate_enum(cls, value):
36
44
  """Validates the enum"""
37
- if value not in ("sklearn"):
45
+ if value not in ("sklearn",):
38
46
  raise ValueError("must be one of enum values ('sklearn')")
39
47
  return value
40
48
 
@@ -71,5 +79,10 @@ class SklearnFramework(BaseModel):
71
79
  if not isinstance(obj, dict):
72
80
  return SklearnFramework.parse_obj(obj)
73
81
 
74
- _obj = SklearnFramework.parse_obj({"type": obj.get("type")})
82
+ _obj = SklearnFramework.parse_obj(
83
+ {
84
+ "type": obj.get("type"),
85
+ "serialization_format": obj.get("serialization_format"),
86
+ }
87
+ )
75
88
  return _obj
@@ -33,7 +33,7 @@ class SpaCyFramework(BaseModel):
33
33
  @validator("type")
34
34
  def type_validate_enum(cls, value):
35
35
  """Validates the enum"""
36
- if value not in ("spacy"):
36
+ if value not in ("spacy",):
37
37
  raise ValueError("must be one of enum values ('spacy')")
38
38
  return value
39
39
 
@@ -34,7 +34,7 @@ class StatsModelsFramework(BaseModel):
34
34
  @validator("type")
35
35
  def type_validate_enum(cls, value):
36
36
  """Validates the enum"""
37
- if value not in ("statsmodels"):
37
+ if value not in ("statsmodels",):
38
38
  raise ValueError("must be one of enum values ('statsmodels')")
39
39
  return value
40
40
 
@@ -37,7 +37,7 @@ class SystemMessage(BaseModel):
37
37
  @validator("role")
38
38
  def role_validate_enum(cls, value):
39
39
  """Validates the enum"""
40
- if value not in ("system"):
40
+ if value not in ("system",):
41
41
  raise ValueError("must be one of enum values ('system')")
42
42
  return value
43
43
 
@@ -34,7 +34,7 @@ class TensorFlowFramework(BaseModel):
34
34
  @validator("type")
35
35
  def type_validate_enum(cls, value):
36
36
  """Validates the enum"""
37
- if value not in ("tensorflow"):
37
+ if value not in ("tensorflow",):
38
38
  raise ValueError("must be one of enum values ('tensorflow')")
39
39
  return value
40
40
 
@@ -33,7 +33,7 @@ class TextContentPart(BaseModel):
33
33
  @validator("type")
34
34
  def type_validate_enum(cls, value):
35
35
  """Validates the enum"""
36
- if value not in ("text"):
36
+ if value not in ("text",):
37
37
  raise ValueError("must be one of enum values ('text')")
38
38
  return value
39
39
 
@@ -48,7 +48,7 @@ class TransformersFramework(BaseModel):
48
48
  @validator("type")
49
49
  def type_validate_enum(cls, value):
50
50
  """Validates the enum"""
51
- if value not in ("transformers"):
51
+ if value not in ("transformers",):
52
52
  raise ValueError("must be one of enum values ('transformers')")
53
53
  return value
54
54
 
@@ -38,7 +38,7 @@ class TrueFoundryArtifactSource(BaseModel):
38
38
  @validator("type")
39
39
  def type_validate_enum(cls, value):
40
40
  """Validates the enum"""
41
- if value not in ("truefoundry"):
41
+ if value not in ("truefoundry",):
42
42
  raise ValueError("must be one of enum values ('truefoundry')")
43
43
  return value
44
44
 
@@ -18,11 +18,10 @@ import pprint
18
18
  import re # noqa: F401
19
19
  from typing import Any, Dict, Optional
20
20
 
21
- from truefoundry.ml.autogen.client.models.model_schema_dto import ModelSchemaDto
22
21
  from truefoundry.ml.autogen.client.models.model_version_manifest import (
23
22
  ModelVersionManifest,
24
23
  )
25
- from truefoundry.pydantic_v1 import BaseModel, Field, StrictBool, StrictStr
24
+ from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr
26
25
 
27
26
 
28
27
  class UpdateModelVersionRequestDto(BaseModel):
@@ -33,16 +32,12 @@ class UpdateModelVersionRequestDto(BaseModel):
33
32
  id: StrictStr = Field(...)
34
33
  description: Optional[StrictStr] = None
35
34
  artifact_metadata: Optional[Dict[str, Any]] = None
36
- model_schema: Optional[ModelSchemaDto] = None
37
- monitoring_enabled: Optional[StrictBool] = None
38
35
  model_framework: Optional[StrictStr] = None
39
36
  manifest: Optional[ModelVersionManifest] = None
40
37
  __properties = [
41
38
  "id",
42
39
  "description",
43
40
  "artifact_metadata",
44
- "model_schema",
45
- "monitoring_enabled",
46
41
  "model_framework",
47
42
  "manifest",
48
43
  ]
@@ -69,9 +64,6 @@ class UpdateModelVersionRequestDto(BaseModel):
69
64
  def to_dict(self):
70
65
  """Returns the dictionary representation of the model using alias"""
71
66
  _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
72
- # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
73
- if self.model_schema:
74
- _dict["model_schema"] = self.model_schema.to_dict()
75
67
  # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of manifest
76
68
  if self.manifest:
77
69
  _dict["manifest"] = self.manifest.to_dict()
@@ -91,10 +83,6 @@ class UpdateModelVersionRequestDto(BaseModel):
91
83
  "id": obj.get("id"),
92
84
  "description": obj.get("description"),
93
85
  "artifact_metadata": obj.get("artifact_metadata"),
94
- "model_schema": ModelSchemaDto.from_dict(obj.get("model_schema"))
95
- if obj.get("model_schema") is not None
96
- else None,
97
- "monitoring_enabled": obj.get("monitoring_enabled"),
98
86
  "model_framework": obj.get("model_framework"),
99
87
  "manifest": ModelVersionManifest.from_dict(obj.get("manifest"))
100
88
  if obj.get("manifest") is not None
@@ -37,7 +37,7 @@ class UserMessage(BaseModel):
37
37
  @validator("role")
38
38
  def role_validate_enum(cls, value):
39
39
  """Validates the enum"""
40
- if value not in ("user"):
40
+ if value not in ("user",):
41
41
  raise ValueError("must be one of enum values ('user')")
42
42
  return value
43
43
 
@@ -16,7 +16,11 @@ from __future__ import annotations
16
16
  import json
17
17
  import pprint
18
18
  import re # noqa: F401
19
+ from typing import Optional
19
20
 
21
+ from truefoundry.ml.autogen.client.models.serialization_format import (
22
+ SerializationFormat,
23
+ )
20
24
  from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
21
25
 
22
26
 
@@ -29,12 +33,16 @@ class XGBoostFramework(BaseModel):
29
33
  default=...,
30
34
  description="+label=Type +usage=Type of the framework +value=xgboost",
31
35
  )
32
- __properties = ["type"]
36
+ serialization_format: Optional[SerializationFormat] = Field(
37
+ default=None,
38
+ description="+label=Serialization format +usage=Serialization format used for the model",
39
+ )
40
+ __properties = ["type", "serialization_format"]
33
41
 
34
42
  @validator("type")
35
43
  def type_validate_enum(cls, value):
36
44
  """Validates the enum"""
37
- if value not in ("xgboost"):
45
+ if value not in ("xgboost",):
38
46
  raise ValueError("must be one of enum values ('xgboost')")
39
47
  return value
40
48
 
@@ -71,5 +79,10 @@ class XGBoostFramework(BaseModel):
71
79
  if not isinstance(obj, dict):
72
80
  return XGBoostFramework.parse_obj(obj)
73
81
 
74
- _obj = XGBoostFramework.parse_obj({"type": obj.get("type")})
82
+ _obj = XGBoostFramework.parse_obj(
83
+ {
84
+ "type": obj.get("type"),
85
+ "serialization_format": obj.get("serialization_format"),
86
+ }
87
+ )
75
88
  return _obj
@@ -5,7 +5,7 @@ The `truefoundry.ml.autogen.client` package is automatically generated by the [O
5
5
 
6
6
  - API version: 0.1.0
7
7
  - Package version: 0.1.0
8
- - Generator version: 7.9.0
8
+ - Generator version: 7.10.0
9
9
  - Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
10
10
 
11
11
  ## Requirements.
@@ -66,7 +66,9 @@ All URIs are relative to *http://localhost*
66
66
  Class | Method | HTTP request | Description
67
67
  ------------ | ------------- | ------------- | -------------
68
68
  *AuthApi* | [**get_tenant_id_get**](truefoundry/ml/autogen/client/docs/AuthApi.md#get_tenant_id_get) | **GET** /api/2.0/mlflow/tenant-id | Get Tenant Id
69
- *DeprecatedApi* | [**get_run_by_name_get_0**](truefoundry/ml/autogen/client/docs/DeprecatedApi.md#get_run_by_name_get_0) | **GET** /api/2.0mlflow/runs/get-by-name | Get Run By Name
69
+ *DeprecatedApi* | [**add_custom_metrics_to_model_version_post**](truefoundry/ml/autogen/client/docs/DeprecatedApi.md#add_custom_metrics_to_model_version_post) | **POST** /model-versions/custom-metrics/add | Add Custom Metrics To Model Version
70
+ *DeprecatedApi* | [**add_features_to_model_version_post**](truefoundry/ml/autogen/client/docs/DeprecatedApi.md#add_features_to_model_version_post) | **POST** /model-versions/features/add | Add Features To Model Version
71
+ *DeprecatedApi* | [**get_run_by_name_get**](truefoundry/ml/autogen/client/docs/DeprecatedApi.md#get_run_by_name_get) | **GET** /api/2.0mlflow/runs/get-by-name | Get Run By Name
70
72
  *DeprecatedApi* | [**get_search_runs_get**](truefoundry/ml/autogen/client/docs/DeprecatedApi.md#get_search_runs_get) | **GET** /api/2.0/preview/mlflow/runs/search | Get Search Runs
71
73
  *DeprecatedApi* | [**get_signed_urls_for_dataset_write_deprecated_get**](truefoundry/ml/autogen/client/docs/DeprecatedApi.md#get_signed_urls_for_dataset_write_deprecated_get) | **GET** /api/2.0/mlflow/mlfoundry-artifacts/datasets/get-signed-urls-for-write | Get Signed Urls For Dataset Write Deprecated
72
74
  *ExperimentsApi* | [**create_experiment_post**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#create_experiment_post) | **POST** /api/2.0/mlflow/experiments/create | Create Experiment
@@ -87,8 +89,6 @@ Class | Method | HTTP request | Description
87
89
  *HealthApi* | [**serve_get**](truefoundry/ml/autogen/client/docs/HealthApi.md#serve_get) | **GET** / | Serve
88
90
  *MetricsApi* | [**get_metric_history_get**](truefoundry/ml/autogen/client/docs/MetricsApi.md#get_metric_history_get) | **GET** /api/2.0/mlflow/metrics/get-history | Get Metric History
89
91
  *MetricsApi* | [**list_metric_history_post**](truefoundry/ml/autogen/client/docs/MetricsApi.md#list_metric_history_post) | **POST** /api/2.0/mlflow/metrics/list-history | List Metric History
90
- *MlfoundryArtifactsApi* | [**add_custom_metrics_to_model_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#add_custom_metrics_to_model_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/model-versions/custom-metrics/add | Add Custom Metrics To Model Version
91
- *MlfoundryArtifactsApi* | [**add_features_to_model_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#add_features_to_model_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/model-versions/features/add | Add Features To Model Version
92
92
  *MlfoundryArtifactsApi* | [**authorize_user_for_model_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#authorize_user_for_model_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/models/authorize | Authorize User For Model
93
93
  *MlfoundryArtifactsApi* | [**authorize_user_for_model_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#authorize_user_for_model_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/model-versions/authorize | Authorize User For Model Version
94
94
  *MlfoundryArtifactsApi* | [**create_artifact_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#create_artifact_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifacts/create | Create Artifact
@@ -213,8 +213,6 @@ Class | Method | HTTP request | Description
213
213
  - [ExperimentTagDto](truefoundry/ml/autogen/client/docs/ExperimentTagDto.md)
214
214
  - [ExternalArtifactSource](truefoundry/ml/autogen/client/docs/ExternalArtifactSource.md)
215
215
  - [FastAIFramework](truefoundry/ml/autogen/client/docs/FastAIFramework.md)
216
- - [FeatureDto](truefoundry/ml/autogen/client/docs/FeatureDto.md)
217
- - [FeatureValueType](truefoundry/ml/autogen/client/docs/FeatureValueType.md)
218
216
  - [FileInfoDto](truefoundry/ml/autogen/client/docs/FileInfoDto.md)
219
217
  - [FinalizeArtifactVersionRequestDto](truefoundry/ml/autogen/client/docs/FinalizeArtifactVersionRequestDto.md)
220
218
  - [Framework](truefoundry/ml/autogen/client/docs/Framework.md)
@@ -272,8 +270,8 @@ Class | Method | HTTP request | Description
272
270
  - [ModelConfiguration](truefoundry/ml/autogen/client/docs/ModelConfiguration.md)
273
271
  - [ModelDto](truefoundry/ml/autogen/client/docs/ModelDto.md)
274
272
  - [ModelResponseDto](truefoundry/ml/autogen/client/docs/ModelResponseDto.md)
275
- - [ModelSchemaDto](truefoundry/ml/autogen/client/docs/ModelSchemaDto.md)
276
273
  - [ModelVersionDto](truefoundry/ml/autogen/client/docs/ModelVersionDto.md)
274
+ - [ModelVersionEnvironment](truefoundry/ml/autogen/client/docs/ModelVersionEnvironment.md)
277
275
  - [ModelVersionManifest](truefoundry/ml/autogen/client/docs/ModelVersionManifest.md)
278
276
  - [ModelVersionResponseDto](truefoundry/ml/autogen/client/docs/ModelVersionResponseDto.md)
279
277
  - [MultiPartUploadDto](truefoundry/ml/autogen/client/docs/MultiPartUploadDto.md)
@@ -285,7 +283,6 @@ Class | Method | HTTP request | Description
285
283
  - [PaddleFramework](truefoundry/ml/autogen/client/docs/PaddleFramework.md)
286
284
  - [ParamDto](truefoundry/ml/autogen/client/docs/ParamDto.md)
287
285
  - [Parameters](truefoundry/ml/autogen/client/docs/Parameters.md)
288
- - [PredictionType](truefoundry/ml/autogen/client/docs/PredictionType.md)
289
286
  - [PyTorchFramework](truefoundry/ml/autogen/client/docs/PyTorchFramework.md)
290
287
  - [ResolveAgentAppResponseDto](truefoundry/ml/autogen/client/docs/ResolveAgentAppResponseDto.md)
291
288
  - [RestoreRunRequestDto](truefoundry/ml/autogen/client/docs/RestoreRunRequestDto.md)
@@ -298,6 +295,7 @@ Class | Method | HTTP request | Description
298
295
  - [RunTagDto](truefoundry/ml/autogen/client/docs/RunTagDto.md)
299
296
  - [SearchRunsRequestDto](truefoundry/ml/autogen/client/docs/SearchRunsRequestDto.md)
300
297
  - [SearchRunsResponseDto](truefoundry/ml/autogen/client/docs/SearchRunsResponseDto.md)
298
+ - [SerializationFormat](truefoundry/ml/autogen/client/docs/SerializationFormat.md)
301
299
  - [SetExperimentTagRequestDto](truefoundry/ml/autogen/client/docs/SetExperimentTagRequestDto.md)
302
300
  - [SetTagRequestDto](truefoundry/ml/autogen/client/docs/SetTagRequestDto.md)
303
301
  - [SignedURLDto](truefoundry/ml/autogen/client/docs/SignedURLDto.md)
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: artifacts.json
3
- # timestamp: 2024-11-22T19:31:48+00:00
3
+ # timestamp: 2024-11-28T08:27:16+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -226,6 +226,23 @@ class ModelConfiguration(BaseModel):
226
226
  )
227
227
 
228
228
 
229
+ class ModelVersionEnvironment(BaseModel):
230
+ """
231
+ +label=ModelVersionEnvironment
232
+ """
233
+
234
+ python_version: Optional[constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$")] = (
235
+ Field(
236
+ None,
237
+ description="+label=Python Version\n+usage=Python version for the model version",
238
+ )
239
+ )
240
+ pip_packages: Optional[List[str]] = Field(
241
+ None,
242
+ description="+label=PIP Packages\n+usage=PIP packages for the model version",
243
+ )
244
+
245
+
229
246
  class ONNXFramework(BaseModel):
230
247
  """
231
248
  +docs=ONNX framework for the model version
@@ -259,6 +276,17 @@ class PyTorchFramework(BaseModel):
259
276
  )
260
277
 
261
278
 
279
+ class SerializationFormat(str, Enum):
280
+ """
281
+ +label=Serialization format
282
+ +usage=Serialization format used for the model
283
+ """
284
+
285
+ cloudpickle = "cloudpickle"
286
+ joblib = "joblib"
287
+ pickle = "pickle"
288
+
289
+
262
290
  class SklearnFramework(BaseModel):
263
291
  """
264
292
  +docs=Scikit-learn framework for the model version
@@ -268,6 +296,10 @@ class SklearnFramework(BaseModel):
268
296
  type: Literal["sklearn"] = Field(
269
297
  ..., description="+label=Type\n+usage=Type of the framework\n+value=sklearn"
270
298
  )
299
+ serialization_format: Optional[SerializationFormat] = Field(
300
+ None,
301
+ description="+label=Serialization format\n+usage=Serialization format used for the model",
302
+ )
271
303
 
272
304
 
273
305
  class SpaCyFramework(BaseModel):
@@ -410,6 +442,10 @@ class XGBoostFramework(BaseModel):
410
442
  type: Literal["xgboost"] = Field(
411
443
  ..., description="+label=Type\n+usage=Type of the framework\n+value=xgboost"
412
444
  )
445
+ serialization_format: Optional[SerializationFormat] = Field(
446
+ None,
447
+ description="+label=Serialization format\n+usage=Serialization format used for the model",
448
+ )
413
449
 
414
450
 
415
451
  class AgentOpenAPITool(BaseModel):
@@ -533,6 +569,7 @@ class ModelVersion(BaseArtifactVersion):
533
569
  ] = Field(
534
570
  None, description="+label=Framework\n+usage=Framework for the model version"
535
571
  )
572
+ environment: Optional[ModelVersionEnvironment] = None
536
573
  step: conint(ge=0) = Field(0, description="+label=Step")
537
574
  model_schema: Optional[Dict[str, Any]] = Field(
538
575
  None,
@@ -0,0 +1,4 @@
1
+ from .schema import ColSpec, TensorSpec
2
+ from .signature import ModelSignature, Schema, infer_signature
3
+
4
+ __all__ = ["infer_signature", "ModelSignature", "Schema", "TensorSpec", "ColSpec"]