truefoundry 0.5.5rc1__py3-none-any.whl → 0.5.6__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 (35) hide show
  1. truefoundry/deploy/__init__.py +9 -2
  2. truefoundry/deploy/auto_gen/models.py +177 -57
  3. truefoundry/deploy/cli/commands/__init__.py +0 -1
  4. truefoundry/deploy/lib/clients/servicefoundry_client.py +20 -16
  5. truefoundry/deploy/v2/lib/deploy.py +23 -15
  6. truefoundry/deploy/v2/lib/deploy_workflow.py +9 -4
  7. truefoundry/deploy/v2/lib/deployable_patched_models.py +10 -0
  8. truefoundry/deploy/v2/lib/patched_models.py +9 -1
  9. truefoundry/ml/autogen/client/__init__.py +4 -4
  10. truefoundry/ml/autogen/client/api/experiments_api.py +0 -156
  11. truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +49 -305
  12. truefoundry/ml/autogen/client/models/__init__.py +4 -4
  13. truefoundry/ml/autogen/client/models/agent.py +64 -13
  14. truefoundry/ml/autogen/client/models/agent_open_api_tool.py +63 -17
  15. truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +63 -17
  16. truefoundry/ml/autogen/client/models/agent_with_fqn.py +64 -12
  17. truefoundry/ml/autogen/client/models/artifact_version_manifest.py +39 -4
  18. truefoundry/ml/autogen/client/models/chat_prompt.py +60 -22
  19. truefoundry/ml/autogen/client/models/{external_artifact_source.py → external_blob_storage_source.py} +10 -11
  20. truefoundry/ml/autogen/client/models/model_version_manifest.py +39 -4
  21. truefoundry/ml/autogen/client/models/source.py +22 -22
  22. truefoundry/ml/autogen/client/models/source1.py +22 -22
  23. truefoundry/ml/autogen/client/models/{true_foundry_artifact_source.py → true_foundry_managed_source.py} +12 -11
  24. truefoundry/ml/autogen/client_README.md +2 -3
  25. truefoundry/ml/autogen/entities/artifacts.py +87 -69
  26. truefoundry/ml/log_types/artifacts/artifact.py +26 -18
  27. truefoundry/ml/log_types/artifacts/general_artifact.py +4 -13
  28. truefoundry/ml/log_types/artifacts/model.py +28 -21
  29. truefoundry/ml/mlfoundry_api.py +2 -6
  30. truefoundry/workflow/task.py +1 -1
  31. {truefoundry-0.5.5rc1.dist-info → truefoundry-0.5.6.dist-info}/METADATA +2 -2
  32. {truefoundry-0.5.5rc1.dist-info → truefoundry-0.5.6.dist-info}/RECORD +34 -35
  33. truefoundry/deploy/cli/commands/build_logs_command.py +0 -89
  34. {truefoundry-0.5.5rc1.dist-info → truefoundry-0.5.6.dist-info}/WHEEL +0 -0
  35. {truefoundry-0.5.5rc1.dist-info → truefoundry-0.5.6.dist-info}/entry_points.txt +0 -0
@@ -16,7 +16,7 @@ from __future__ import annotations
16
16
  import json
17
17
  import pprint
18
18
  import re # noqa: F401
19
- from typing import Dict, Optional
19
+ from typing import Any, Dict, Optional
20
20
 
21
21
  from truefoundry.ml.autogen.client.models.chat_prompt_messages_inner import (
22
22
  ChatPromptMessagesInner,
@@ -37,18 +37,24 @@ class ChatPrompt(BaseModel):
37
37
  Chat Prompt artifact. # noqa: E501
38
38
  """
39
39
 
40
- name: constr(strict=True) = Field(
40
+ description: Optional[constr(strict=True, max_length=512)] = Field(
41
+ default=None, description="+sort=2 +label=Description"
42
+ )
43
+ metadata: Dict[str, Any] = Field(
41
44
  default=...,
42
- description="+label=Prompt Name +icon=fa-desktop:#326ce5 +message=Alphanumeric word, may contain '-' with a maximum length of 256 characters +sort=1000 +usage=Name of the Prompt. This uniquely identifies it in the workspace. +docs=The unique name for the prompt, consisting of alphanumeric characters and dashes, max length 100.",
45
+ description="+label=Metadata +docs=Key value pairs to store additional metadata +usage=Key value pairs to store additional metadata +uiType=JsonInput",
43
46
  )
44
- description: Optional[constr(strict=True, max_length=512, min_length=1)] = Field(
47
+ version_alias: Optional[constr(strict=True, max_length=128)] = Field(
45
48
  default=None,
46
- description="+label=Description +icon=fa-desktop:#326ce5 +message=Description in a maximum of 512 characters +sort=2000 +usage=Description of the prompt +docs=An optional description for the prompt, with a maximum length of 512 characters. +optional",
49
+ description="+label=Version Alias +usage=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc) +docs=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc) +message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc)",
47
50
  )
48
- model_configuration: ModelConfiguration = Field(...)
49
- metadata: Dict[str, StrictStr] = Field(
50
- default=...,
51
- description="+label=Metadata +icon=fa-info-circle:#326ce5 +message=Additional metadata for the prompt +sort=7000 +usage=Define additional metadata for the prompt +docs=Key-value pairs to store additional metadata related to the prompt.",
51
+ name: Optional[constr(strict=True, max_length=256)] = Field(
52
+ default=None,
53
+ description="+sort=1 +label=Name +message=The name should start with lowercase alphabets and can contain alphanumeric and can include '-' in between",
54
+ )
55
+ ml_repo: Optional[constr(strict=True)] = Field(
56
+ default=None,
57
+ description="+label=ML Repo +usage=name of the ML Repo +docs=name of the ML Repo +uiType=Hidden",
52
58
  )
53
59
  type: Optional[StrictStr] = "chat_prompt"
54
60
  messages: conlist(ChatPromptMessagesInner) = Field(
@@ -59,22 +65,52 @@ class ChatPrompt(BaseModel):
59
65
  default=None,
60
66
  description="+label=Variables +usage=Variables for the chat completion messages to be used in the prompt messages +sort=5000",
61
67
  )
68
+ model_configuration: ModelConfiguration = Field(...)
62
69
  __properties = [
63
- "name",
64
70
  "description",
65
- "model_configuration",
66
71
  "metadata",
72
+ "version_alias",
73
+ "name",
74
+ "ml_repo",
67
75
  "type",
68
76
  "messages",
69
77
  "variables",
78
+ "model_configuration",
70
79
  ]
71
80
 
81
+ @validator("version_alias")
82
+ def version_alias_validate_regular_expression(cls, value):
83
+ """Validates the regular expression"""
84
+ if value is None:
85
+ return value
86
+
87
+ if not re.match(r"^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$", value):
88
+ raise ValueError(
89
+ r"must validate the regular expression /^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$/"
90
+ )
91
+ return value
92
+
72
93
  @validator("name")
73
94
  def name_validate_regular_expression(cls, value):
74
95
  """Validates the regular expression"""
75
- if not re.match(r"^[a-zA-Z][a-zA-Z0-9-_]{0,254}[a-zA-Z0-9]$", value):
96
+ if value is None:
97
+ return value
98
+
99
+ if not re.match(r"^[A-Za-z0-9_\-]+$", value):
100
+ raise ValueError(
101
+ r"must validate the regular expression /^[A-Za-z0-9_\-]+$/"
102
+ )
103
+ return value
104
+
105
+ @validator("ml_repo")
106
+ def ml_repo_validate_regular_expression(cls, value):
107
+ """Validates the regular expression"""
108
+ if value is None:
109
+ return value
110
+
111
+ if not re.match(r"^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$", value):
76
112
  raise ValueError(
77
- r"must validate the regular expression /^[a-zA-Z][a-zA-Z0-9-_]{0,254}[a-zA-Z0-9]$/"
113
+ r"must validate the regular expression /^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$/"
78
114
  )
79
115
  return value
80
116
 
@@ -110,9 +146,6 @@ class ChatPrompt(BaseModel):
110
146
  def to_dict(self):
111
147
  """Returns the dictionary representation of the model using alias"""
112
148
  _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
113
- # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_configuration
114
- if self.model_configuration:
115
- _dict["model_configuration"] = self.model_configuration.to_dict()
116
149
  # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in messages (list)
117
150
  _items = []
118
151
  if self.messages:
@@ -120,6 +153,9 @@ class ChatPrompt(BaseModel):
120
153
  if _item:
121
154
  _items.append(_item.to_dict())
122
155
  _dict["messages"] = _items
156
+ # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_configuration
157
+ if self.model_configuration:
158
+ _dict["model_configuration"] = self.model_configuration.to_dict()
123
159
  return _dict
124
160
 
125
161
  @classmethod
@@ -133,14 +169,11 @@ class ChatPrompt(BaseModel):
133
169
 
134
170
  _obj = ChatPrompt.parse_obj(
135
171
  {
136
- "name": obj.get("name"),
137
172
  "description": obj.get("description"),
138
- "model_configuration": ModelConfiguration.from_dict(
139
- obj.get("model_configuration")
140
- )
141
- if obj.get("model_configuration") is not None
142
- else None,
143
173
  "metadata": obj.get("metadata"),
174
+ "version_alias": obj.get("version_alias"),
175
+ "name": obj.get("name"),
176
+ "ml_repo": obj.get("ml_repo"),
144
177
  "type": obj.get("type")
145
178
  if obj.get("type") is not None
146
179
  else "chat_prompt",
@@ -151,6 +184,11 @@ class ChatPrompt(BaseModel):
151
184
  if obj.get("messages") is not None
152
185
  else None,
153
186
  "variables": obj.get("variables"),
187
+ "model_configuration": ModelConfiguration.from_dict(
188
+ obj.get("model_configuration")
189
+ )
190
+ if obj.get("model_configuration") is not None
191
+ else None,
154
192
  }
155
193
  )
156
194
  return _obj
@@ -20,17 +20,16 @@ import re # noqa: F401
20
20
  from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
21
21
 
22
22
 
23
- class ExternalArtifactSource(BaseModel):
23
+ class ExternalBlobStorageSource(BaseModel):
24
24
  """
25
- +label=External # noqa: E501
25
+ +label=External Blob Storage # noqa: E501
26
26
  """
27
27
 
28
28
  type: StrictStr = Field(
29
- default=...,
30
- description="+label=Type +usage=Type of the source +value=external +type=External",
29
+ default=..., description="+label=Type +usage=Type of the source +value=external"
31
30
  )
32
31
  uri: StrictStr = Field(
33
- default=..., description="+label=URI +usage=URI of the Artifact source"
32
+ default=..., description="+label=URI +usage=URI of the Blob Storage source"
34
33
  )
35
34
  __properties = ["type", "uri"]
36
35
 
@@ -56,8 +55,8 @@ class ExternalArtifactSource(BaseModel):
56
55
  return json.dumps(self.to_dict())
57
56
 
58
57
  @classmethod
59
- def from_json(cls, json_str: str) -> ExternalArtifactSource:
60
- """Create an instance of ExternalArtifactSource from a JSON string"""
58
+ def from_json(cls, json_str: str) -> ExternalBlobStorageSource:
59
+ """Create an instance of ExternalBlobStorageSource from a JSON string"""
61
60
  return cls.from_dict(json.loads(json_str))
62
61
 
63
62
  def to_dict(self):
@@ -66,15 +65,15 @@ class ExternalArtifactSource(BaseModel):
66
65
  return _dict
67
66
 
68
67
  @classmethod
69
- def from_dict(cls, obj: dict) -> ExternalArtifactSource:
70
- """Create an instance of ExternalArtifactSource from a dict"""
68
+ def from_dict(cls, obj: dict) -> ExternalBlobStorageSource:
69
+ """Create an instance of ExternalBlobStorageSource from a dict"""
71
70
  if obj is None:
72
71
  return None
73
72
 
74
73
  if not isinstance(obj, dict):
75
- return ExternalArtifactSource.parse_obj(obj)
74
+ return ExternalBlobStorageSource.parse_obj(obj)
76
75
 
77
- _obj = ExternalArtifactSource.parse_obj(
76
+ _obj = ExternalBlobStorageSource.parse_obj(
78
77
  {"type": obj.get("type"), "uri": obj.get("uri")}
79
78
  )
80
79
  return _obj
@@ -39,16 +39,23 @@ class ModelVersionManifest(BaseModel):
39
39
  """
40
40
 
41
41
  description: Optional[constr(strict=True, max_length=512)] = Field(
42
- default=None,
43
- description="+label=Description +usage=Description of the artifact or model version +docs=Description of the artifact or model version",
42
+ default=None, description="+sort=2 +label=Description"
44
43
  )
45
44
  metadata: Dict[str, Any] = Field(
46
45
  default=...,
47
- description="+label=Metadata +docs=Metadata for the artifact or model version +usage=Metadata for the artifact or model version +uiType=JsonInput",
46
+ description="+label=Metadata +docs=Key value pairs to store additional metadata +usage=Key value pairs to store additional metadata +uiType=JsonInput",
48
47
  )
49
48
  version_alias: Optional[constr(strict=True, max_length=128)] = Field(
50
49
  default=None,
51
- description="+label=Version Alias +usage=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc) +docs=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc) +message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc)",
50
+ description="+label=Version Alias +usage=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc) +docs=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc) +message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc)",
51
+ )
52
+ name: Optional[constr(strict=True, max_length=256)] = Field(
53
+ default=None,
54
+ description="+sort=1 +label=Name +message=The name should start with lowercase alphabets and can contain alphanumeric and can include '-' in between",
55
+ )
56
+ ml_repo: Optional[constr(strict=True)] = Field(
57
+ default=None,
58
+ description="+label=ML Repo +usage=name of the ML Repo +docs=name of the ML Repo +uiType=Hidden",
52
59
  )
53
60
  type: Optional[StrictStr] = "model-version"
54
61
  source: Source1 = Field(...)
@@ -61,6 +68,8 @@ class ModelVersionManifest(BaseModel):
61
68
  "description",
62
69
  "metadata",
63
70
  "version_alias",
71
+ "name",
72
+ "ml_repo",
64
73
  "type",
65
74
  "source",
66
75
  "framework",
@@ -80,6 +89,30 @@ class ModelVersionManifest(BaseModel):
80
89
  )
81
90
  return value
82
91
 
92
+ @validator("name")
93
+ def name_validate_regular_expression(cls, value):
94
+ """Validates the regular expression"""
95
+ if value is None:
96
+ return value
97
+
98
+ if not re.match(r"^[A-Za-z0-9_\-]+$", value):
99
+ raise ValueError(
100
+ r"must validate the regular expression /^[A-Za-z0-9_\-]+$/"
101
+ )
102
+ return value
103
+
104
+ @validator("ml_repo")
105
+ def ml_repo_validate_regular_expression(cls, value):
106
+ """Validates the regular expression"""
107
+ if value is None:
108
+ return value
109
+
110
+ if not re.match(r"^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$", value):
111
+ raise ValueError(
112
+ r"must validate the regular expression /^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$/"
113
+ )
114
+ return value
115
+
83
116
  @validator("type")
84
117
  def type_validate_enum(cls, value):
85
118
  """Validates the enum"""
@@ -137,6 +170,8 @@ class ModelVersionManifest(BaseModel):
137
170
  "description": obj.get("description"),
138
171
  "metadata": obj.get("metadata"),
139
172
  "version_alias": obj.get("version_alias"),
173
+ "name": obj.get("name"),
174
+ "ml_repo": obj.get("ml_repo"),
140
175
  "type": obj.get("type")
141
176
  if obj.get("type") is not None
142
177
  else "model-version",
@@ -18,11 +18,11 @@ import pprint
18
18
  import re # noqa: F401
19
19
  from typing import TYPE_CHECKING, Any, List, Optional, Union
20
20
 
21
- from truefoundry.ml.autogen.client.models.external_artifact_source import (
22
- ExternalArtifactSource,
21
+ from truefoundry.ml.autogen.client.models.external_blob_storage_source import (
22
+ ExternalBlobStorageSource,
23
23
  )
24
- from truefoundry.ml.autogen.client.models.true_foundry_artifact_source import (
25
- TrueFoundryArtifactSource,
24
+ from truefoundry.ml.autogen.client.models.true_foundry_managed_source import (
25
+ TrueFoundryManagedSource,
26
26
  )
27
27
  from truefoundry.pydantic_v1 import (
28
28
  BaseModel,
@@ -31,7 +31,7 @@ from truefoundry.pydantic_v1 import (
31
31
  validator,
32
32
  )
33
33
 
34
- SOURCE_ANY_OF_SCHEMAS = ["ExternalArtifactSource", "TrueFoundryArtifactSource"]
34
+ SOURCE_ANY_OF_SCHEMAS = ["ExternalBlobStorageSource", "TrueFoundryManagedSource"]
35
35
 
36
36
 
37
37
  class Source(BaseModel):
@@ -39,12 +39,12 @@ class Source(BaseModel):
39
39
  +label=Artifact Source +usage=Source for the Artifact version +uiType=Group
40
40
  """
41
41
 
42
- # data type: TrueFoundryArtifactSource
43
- anyof_schema_1_validator: Optional[TrueFoundryArtifactSource] = None
44
- # data type: ExternalArtifactSource
45
- anyof_schema_2_validator: Optional[ExternalArtifactSource] = None
42
+ # data type: TrueFoundryManagedSource
43
+ anyof_schema_1_validator: Optional[TrueFoundryManagedSource] = None
44
+ # data type: ExternalBlobStorageSource
45
+ anyof_schema_2_validator: Optional[ExternalBlobStorageSource] = None
46
46
  if TYPE_CHECKING:
47
- actual_instance: Union[ExternalArtifactSource, TrueFoundryArtifactSource]
47
+ actual_instance: Union[ExternalBlobStorageSource, TrueFoundryManagedSource]
48
48
  else:
49
49
  actual_instance: Any
50
50
  any_of_schemas: List[str] = Field(SOURCE_ANY_OF_SCHEMAS, const=True)
@@ -70,18 +70,18 @@ class Source(BaseModel):
70
70
  def actual_instance_must_validate_anyof(cls, v):
71
71
  instance = Source.construct()
72
72
  error_messages = []
73
- # validate data type: TrueFoundryArtifactSource
74
- if not isinstance(v, TrueFoundryArtifactSource):
73
+ # validate data type: TrueFoundryManagedSource
74
+ if not isinstance(v, TrueFoundryManagedSource):
75
75
  error_messages.append(
76
- f"Error! Input type `{type(v)}` is not `TrueFoundryArtifactSource`"
76
+ f"Error! Input type `{type(v)}` is not `TrueFoundryManagedSource`"
77
77
  )
78
78
  else:
79
79
  return v
80
80
 
81
- # validate data type: ExternalArtifactSource
82
- if not isinstance(v, ExternalArtifactSource):
81
+ # validate data type: ExternalBlobStorageSource
82
+ if not isinstance(v, ExternalBlobStorageSource):
83
83
  error_messages.append(
84
- f"Error! Input type `{type(v)}` is not `ExternalArtifactSource`"
84
+ f"Error! Input type `{type(v)}` is not `ExternalBlobStorageSource`"
85
85
  )
86
86
  else:
87
87
  return v
@@ -89,7 +89,7 @@ class Source(BaseModel):
89
89
  if error_messages:
90
90
  # no match
91
91
  raise ValueError(
92
- "No match found when setting the actual_instance in Source with anyOf schemas: ExternalArtifactSource, TrueFoundryArtifactSource. Details: "
92
+ "No match found when setting the actual_instance in Source with anyOf schemas: ExternalBlobStorageSource, TrueFoundryManagedSource. Details: "
93
93
  + ", ".join(error_messages)
94
94
  )
95
95
  else:
@@ -104,15 +104,15 @@ class Source(BaseModel):
104
104
  """Returns the object represented by the json string"""
105
105
  instance = Source.construct()
106
106
  error_messages = []
107
- # anyof_schema_1_validator: Optional[TrueFoundryArtifactSource] = None
107
+ # anyof_schema_1_validator: Optional[TrueFoundryManagedSource] = None
108
108
  try:
109
- instance.actual_instance = TrueFoundryArtifactSource.from_json(json_str)
109
+ instance.actual_instance = TrueFoundryManagedSource.from_json(json_str)
110
110
  return instance
111
111
  except (ValidationError, ValueError) as e:
112
112
  error_messages.append(str(e))
113
- # anyof_schema_2_validator: Optional[ExternalArtifactSource] = None
113
+ # anyof_schema_2_validator: Optional[ExternalBlobStorageSource] = None
114
114
  try:
115
- instance.actual_instance = ExternalArtifactSource.from_json(json_str)
115
+ instance.actual_instance = ExternalBlobStorageSource.from_json(json_str)
116
116
  return instance
117
117
  except (ValidationError, ValueError) as e:
118
118
  error_messages.append(str(e))
@@ -120,7 +120,7 @@ class Source(BaseModel):
120
120
  if error_messages:
121
121
  # no match
122
122
  raise ValueError(
123
- "No match found when deserializing the JSON string into Source with anyOf schemas: ExternalArtifactSource, TrueFoundryArtifactSource. Details: "
123
+ "No match found when deserializing the JSON string into Source with anyOf schemas: ExternalBlobStorageSource, TrueFoundryManagedSource. Details: "
124
124
  + ", ".join(error_messages)
125
125
  )
126
126
  else:
@@ -18,11 +18,11 @@ import pprint
18
18
  import re # noqa: F401
19
19
  from typing import TYPE_CHECKING, Any, List, Optional, Union
20
20
 
21
- from truefoundry.ml.autogen.client.models.external_artifact_source import (
22
- ExternalArtifactSource,
21
+ from truefoundry.ml.autogen.client.models.external_blob_storage_source import (
22
+ ExternalBlobStorageSource,
23
23
  )
24
- from truefoundry.ml.autogen.client.models.true_foundry_artifact_source import (
25
- TrueFoundryArtifactSource,
24
+ from truefoundry.ml.autogen.client.models.true_foundry_managed_source import (
25
+ TrueFoundryManagedSource,
26
26
  )
27
27
  from truefoundry.pydantic_v1 import (
28
28
  BaseModel,
@@ -31,7 +31,7 @@ from truefoundry.pydantic_v1 import (
31
31
  validator,
32
32
  )
33
33
 
34
- SOURCE1_ANY_OF_SCHEMAS = ["ExternalArtifactSource", "TrueFoundryArtifactSource"]
34
+ SOURCE1_ANY_OF_SCHEMAS = ["ExternalBlobStorageSource", "TrueFoundryManagedSource"]
35
35
 
36
36
 
37
37
  class Source1(BaseModel):
@@ -39,12 +39,12 @@ class Source1(BaseModel):
39
39
  +label=Model Source +usage=Source for the model version +uiType=Group
40
40
  """
41
41
 
42
- # data type: TrueFoundryArtifactSource
43
- anyof_schema_1_validator: Optional[TrueFoundryArtifactSource] = None
44
- # data type: ExternalArtifactSource
45
- anyof_schema_2_validator: Optional[ExternalArtifactSource] = None
42
+ # data type: TrueFoundryManagedSource
43
+ anyof_schema_1_validator: Optional[TrueFoundryManagedSource] = None
44
+ # data type: ExternalBlobStorageSource
45
+ anyof_schema_2_validator: Optional[ExternalBlobStorageSource] = None
46
46
  if TYPE_CHECKING:
47
- actual_instance: Union[ExternalArtifactSource, TrueFoundryArtifactSource]
47
+ actual_instance: Union[ExternalBlobStorageSource, TrueFoundryManagedSource]
48
48
  else:
49
49
  actual_instance: Any
50
50
  any_of_schemas: List[str] = Field(SOURCE1_ANY_OF_SCHEMAS, const=True)
@@ -70,18 +70,18 @@ class Source1(BaseModel):
70
70
  def actual_instance_must_validate_anyof(cls, v):
71
71
  instance = Source1.construct()
72
72
  error_messages = []
73
- # validate data type: TrueFoundryArtifactSource
74
- if not isinstance(v, TrueFoundryArtifactSource):
73
+ # validate data type: TrueFoundryManagedSource
74
+ if not isinstance(v, TrueFoundryManagedSource):
75
75
  error_messages.append(
76
- f"Error! Input type `{type(v)}` is not `TrueFoundryArtifactSource`"
76
+ f"Error! Input type `{type(v)}` is not `TrueFoundryManagedSource`"
77
77
  )
78
78
  else:
79
79
  return v
80
80
 
81
- # validate data type: ExternalArtifactSource
82
- if not isinstance(v, ExternalArtifactSource):
81
+ # validate data type: ExternalBlobStorageSource
82
+ if not isinstance(v, ExternalBlobStorageSource):
83
83
  error_messages.append(
84
- f"Error! Input type `{type(v)}` is not `ExternalArtifactSource`"
84
+ f"Error! Input type `{type(v)}` is not `ExternalBlobStorageSource`"
85
85
  )
86
86
  else:
87
87
  return v
@@ -89,7 +89,7 @@ class Source1(BaseModel):
89
89
  if error_messages:
90
90
  # no match
91
91
  raise ValueError(
92
- "No match found when setting the actual_instance in Source1 with anyOf schemas: ExternalArtifactSource, TrueFoundryArtifactSource. Details: "
92
+ "No match found when setting the actual_instance in Source1 with anyOf schemas: ExternalBlobStorageSource, TrueFoundryManagedSource. Details: "
93
93
  + ", ".join(error_messages)
94
94
  )
95
95
  else:
@@ -104,15 +104,15 @@ class Source1(BaseModel):
104
104
  """Returns the object represented by the json string"""
105
105
  instance = Source1.construct()
106
106
  error_messages = []
107
- # anyof_schema_1_validator: Optional[TrueFoundryArtifactSource] = None
107
+ # anyof_schema_1_validator: Optional[TrueFoundryManagedSource] = None
108
108
  try:
109
- instance.actual_instance = TrueFoundryArtifactSource.from_json(json_str)
109
+ instance.actual_instance = TrueFoundryManagedSource.from_json(json_str)
110
110
  return instance
111
111
  except (ValidationError, ValueError) as e:
112
112
  error_messages.append(str(e))
113
- # anyof_schema_2_validator: Optional[ExternalArtifactSource] = None
113
+ # anyof_schema_2_validator: Optional[ExternalBlobStorageSource] = None
114
114
  try:
115
- instance.actual_instance = ExternalArtifactSource.from_json(json_str)
115
+ instance.actual_instance = ExternalBlobStorageSource.from_json(json_str)
116
116
  return instance
117
117
  except (ValidationError, ValueError) as e:
118
118
  error_messages.append(str(e))
@@ -120,7 +120,7 @@ class Source1(BaseModel):
120
120
  if error_messages:
121
121
  # no match
122
122
  raise ValueError(
123
- "No match found when deserializing the JSON string into Source1 with anyOf schemas: ExternalArtifactSource, TrueFoundryArtifactSource. Details: "
123
+ "No match found when deserializing the JSON string into Source1 with anyOf schemas: ExternalBlobStorageSource, TrueFoundryManagedSource. Details: "
124
124
  + ", ".join(error_messages)
125
125
  )
126
126
  else:
@@ -16,21 +16,22 @@ 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
 
20
21
  from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
21
22
 
22
23
 
23
- class TrueFoundryArtifactSource(BaseModel):
24
+ class TrueFoundryManagedSource(BaseModel):
24
25
  """
25
- +usage=Source for the Artifact or Model +label=Upload # noqa: E501
26
+ +usage=Source for the entity +label=Upload # noqa: E501
26
27
  """
27
28
 
28
29
  type: StrictStr = Field(
29
30
  default=...,
30
- description="+usage=Type of the source +type=Upload +value=truefoundry +label=Upload",
31
+ description="+label=Type +usage=Type of the source +value=truefoundry",
31
32
  )
32
- uri: StrictStr = Field(
33
- default=...,
33
+ uri: Optional[StrictStr] = Field(
34
+ default=None,
34
35
  description='+label=URI +uiType=ModelUploadInput +uiProps={"hideClear":true}',
35
36
  )
36
37
  __properties = ["type", "uri"]
@@ -57,8 +58,8 @@ class TrueFoundryArtifactSource(BaseModel):
57
58
  return json.dumps(self.to_dict())
58
59
 
59
60
  @classmethod
60
- def from_json(cls, json_str: str) -> TrueFoundryArtifactSource:
61
- """Create an instance of TrueFoundryArtifactSource from a JSON string"""
61
+ def from_json(cls, json_str: str) -> TrueFoundryManagedSource:
62
+ """Create an instance of TrueFoundryManagedSource from a JSON string"""
62
63
  return cls.from_dict(json.loads(json_str))
63
64
 
64
65
  def to_dict(self):
@@ -67,15 +68,15 @@ class TrueFoundryArtifactSource(BaseModel):
67
68
  return _dict
68
69
 
69
70
  @classmethod
70
- def from_dict(cls, obj: dict) -> TrueFoundryArtifactSource:
71
- """Create an instance of TrueFoundryArtifactSource from a dict"""
71
+ def from_dict(cls, obj: dict) -> TrueFoundryManagedSource:
72
+ """Create an instance of TrueFoundryManagedSource from a dict"""
72
73
  if obj is None:
73
74
  return None
74
75
 
75
76
  if not isinstance(obj, dict):
76
- return TrueFoundryArtifactSource.parse_obj(obj)
77
+ return TrueFoundryManagedSource.parse_obj(obj)
77
78
 
78
- _obj = TrueFoundryArtifactSource.parse_obj(
79
+ _obj = TrueFoundryManagedSource.parse_obj(
79
80
  {"type": obj.get("type"), "uri": obj.get("uri")}
80
81
  )
81
82
  return _obj
@@ -78,7 +78,6 @@ Class | Method | HTTP request | Description
78
78
  *ExperimentsApi* | [**hard_delete_experiment_post**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#hard_delete_experiment_post) | **POST** /api/2.0/mlflow/experiments/hard-delete | Hard Delete Experiment
79
79
  *ExperimentsApi* | [**list_experiment_columns_get**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#list_experiment_columns_get) | **GET** /api/2.0/mlflow/experiments/columns | List Experiment Columns
80
80
  *ExperimentsApi* | [**list_experiments_get**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#list_experiments_get) | **GET** /api/2.0/mlflow/experiments/list | List Experiments
81
- *ExperimentsApi* | [**put_privacy_type_put**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#put_privacy_type_put) | **PUT** /api/2.0/mlflow/experiments/privacy-type | Put Privacy Type
82
81
  *ExperimentsApi* | [**restore_experiment_post**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#restore_experiment_post) | **POST** /api/2.0/mlflow/experiments/restore | Restore Experiment
83
82
  *ExperimentsApi* | [**set_experiment_tag_post**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#set_experiment_tag_post) | **POST** /api/2.0/mlflow/experiments/set-experiment-tag | Set Experiment Tag
84
83
  *ExperimentsApi* | [**update_experiment_post**](truefoundry/ml/autogen/client/docs/ExperimentsApi.md#update_experiment_post) | **POST** /api/2.0/mlflow/experiments/update | Update Experiment
@@ -215,7 +214,7 @@ Class | Method | HTTP request | Description
215
214
  - [ExperimentResponseDto](truefoundry/ml/autogen/client/docs/ExperimentResponseDto.md)
216
215
  - [ExperimentTagDto](truefoundry/ml/autogen/client/docs/ExperimentTagDto.md)
217
216
  - [ExportDeploymentFilesRequestDto](truefoundry/ml/autogen/client/docs/ExportDeploymentFilesRequestDto.md)
218
- - [ExternalArtifactSource](truefoundry/ml/autogen/client/docs/ExternalArtifactSource.md)
217
+ - [ExternalBlobStorageSource](truefoundry/ml/autogen/client/docs/ExternalBlobStorageSource.md)
219
218
  - [FastAIFramework](truefoundry/ml/autogen/client/docs/FastAIFramework.md)
220
219
  - [FileInfoDto](truefoundry/ml/autogen/client/docs/FileInfoDto.md)
221
220
  - [FinalizeArtifactVersionRequestDto](truefoundry/ml/autogen/client/docs/FinalizeArtifactVersionRequestDto.md)
@@ -323,7 +322,7 @@ Class | Method | HTTP request | Description
323
322
  - [TransformersFramework](truefoundry/ml/autogen/client/docs/TransformersFramework.md)
324
323
  - [TriggerJobRunConfigRequestDto](truefoundry/ml/autogen/client/docs/TriggerJobRunConfigRequestDto.md)
325
324
  - [TriggerJobRunConfigResponseDto](truefoundry/ml/autogen/client/docs/TriggerJobRunConfigResponseDto.md)
326
- - [TrueFoundryArtifactSource](truefoundry/ml/autogen/client/docs/TrueFoundryArtifactSource.md)
325
+ - [TrueFoundryManagedSource](truefoundry/ml/autogen/client/docs/TrueFoundryManagedSource.md)
327
326
  - [UpdateArtifactVersionRequestDto](truefoundry/ml/autogen/client/docs/UpdateArtifactVersionRequestDto.md)
328
327
  - [UpdateDatasetRequestDto](truefoundry/ml/autogen/client/docs/UpdateDatasetRequestDto.md)
329
328
  - [UpdateExperimentRequestDto](truefoundry/ml/autogen/client/docs/UpdateExperimentRequestDto.md)