truefoundry 0.4.10__py3-none-any.whl → 0.5.0__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 (76) hide show
  1. truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py +2 -2
  2. truefoundry/deploy/lib/dao/application.py +2 -1
  3. truefoundry/ml/__init__.py +41 -1
  4. truefoundry/ml/autogen/client/__init__.py +44 -14
  5. truefoundry/ml/autogen/client/api/__init__.py +3 -3
  6. truefoundry/ml/autogen/client/api/deprecated_api.py +333 -0
  7. truefoundry/ml/autogen/client/api/generate_code_snippet_api.py +526 -0
  8. truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +0 -322
  9. truefoundry/ml/autogen/client/api_client.py +8 -1
  10. truefoundry/ml/autogen/client/models/__init__.py +41 -11
  11. truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +3 -17
  12. truefoundry/ml/autogen/client/models/agent.py +1 -1
  13. truefoundry/ml/autogen/client/models/agent_app.py +1 -1
  14. truefoundry/ml/autogen/client/models/agent_open_api_tool.py +1 -1
  15. truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +1 -1
  16. truefoundry/ml/autogen/client/models/agent_with_fqn.py +1 -1
  17. truefoundry/ml/autogen/client/models/artifact_version_dto.py +3 -5
  18. truefoundry/ml/autogen/client/models/artifact_version_manifest.py +111 -0
  19. truefoundry/ml/autogen/client/models/assistant_message.py +1 -1
  20. truefoundry/ml/autogen/client/models/blob_storage_reference.py +1 -1
  21. truefoundry/ml/autogen/client/models/chat_prompt.py +1 -1
  22. truefoundry/ml/autogen/client/models/command.py +152 -0
  23. truefoundry/ml/autogen/client/models/{feature_dto.py → create_workflow_task_config_request_dto.py} +18 -14
  24. truefoundry/ml/autogen/client/models/{external_model_source.py → external_artifact_source.py} +12 -11
  25. truefoundry/ml/autogen/client/models/fast_ai_framework.py +75 -0
  26. truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +3 -5
  27. truefoundry/ml/autogen/client/models/framework.py +250 -14
  28. truefoundry/ml/autogen/client/models/gluon_framework.py +74 -0
  29. truefoundry/ml/autogen/client/models/{upload_model_source.py → h2_o_framework.py} +11 -11
  30. truefoundry/ml/autogen/client/models/image_content_part.py +1 -1
  31. truefoundry/ml/autogen/client/models/keras_framework.py +74 -0
  32. truefoundry/ml/autogen/client/models/light_gbm_framework.py +75 -0
  33. truefoundry/ml/autogen/client/models/manifest.py +154 -0
  34. truefoundry/ml/autogen/client/models/model_version_dto.py +7 -8
  35. truefoundry/ml/autogen/client/models/model_version_environment.py +97 -0
  36. truefoundry/ml/autogen/client/models/model_version_manifest.py +30 -6
  37. truefoundry/ml/autogen/client/models/onnx_framework.py +74 -0
  38. truefoundry/ml/autogen/client/models/paddle_framework.py +75 -0
  39. truefoundry/ml/autogen/client/models/py_torch_framework.py +75 -0
  40. truefoundry/ml/autogen/client/models/{feature_value_type.py → serialization_format.py} +8 -8
  41. truefoundry/ml/autogen/client/models/sklearn_framework.py +92 -0
  42. truefoundry/ml/autogen/client/models/source.py +23 -46
  43. truefoundry/ml/autogen/client/models/source1.py +154 -0
  44. truefoundry/ml/autogen/client/models/spa_cy_framework.py +74 -0
  45. truefoundry/ml/autogen/client/models/stats_models_framework.py +75 -0
  46. truefoundry/ml/autogen/client/models/system_message.py +1 -1
  47. truefoundry/ml/autogen/client/models/{tensorflow_framework.py → tensor_flow_framework.py} +11 -10
  48. truefoundry/ml/autogen/client/models/text_content_part.py +1 -1
  49. truefoundry/ml/autogen/client/models/transformers_framework.py +10 -4
  50. truefoundry/ml/autogen/client/models/trigger_job_run_config_request_dto.py +90 -0
  51. truefoundry/ml/autogen/client/models/trigger_job_run_config_response_dto.py +71 -0
  52. truefoundry/ml/autogen/client/models/{truefoundry_model_source.py → true_foundry_artifact_source.py} +13 -11
  53. truefoundry/ml/autogen/client/models/update_artifact_version_request_dto.py +11 -1
  54. truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +1 -13
  55. truefoundry/ml/autogen/client/models/user_message.py +1 -1
  56. truefoundry/ml/autogen/client/models/xg_boost_framework.py +92 -0
  57. truefoundry/ml/autogen/client_README.md +30 -12
  58. truefoundry/ml/autogen/entities/artifacts.py +87 -9
  59. truefoundry/ml/autogen/models/__init__.py +4 -0
  60. truefoundry/ml/autogen/models/exceptions.py +30 -0
  61. truefoundry/ml/autogen/models/schema.py +1547 -0
  62. truefoundry/ml/autogen/models/signature.py +139 -0
  63. truefoundry/ml/autogen/models/utils.py +699 -0
  64. truefoundry/ml/log_types/artifacts/artifact.py +131 -63
  65. truefoundry/ml/log_types/artifacts/general_artifact.py +7 -26
  66. truefoundry/ml/log_types/artifacts/model.py +195 -197
  67. truefoundry/ml/mlfoundry_api.py +47 -52
  68. truefoundry/ml/mlfoundry_run.py +35 -43
  69. truefoundry/ml/model_framework.py +169 -0
  70. {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/METADATA +1 -1
  71. {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/RECORD +73 -51
  72. truefoundry/ml/autogen/client/api/python_deployment_config_api.py +0 -201
  73. truefoundry/ml/autogen/client/models/model_schema_dto.py +0 -85
  74. truefoundry/ml/autogen/client/models/prediction_type.py +0 -34
  75. {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/WHEEL +0 -0
  76. {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/entry_points.txt +0 -0
@@ -31,7 +31,7 @@ WORKDIR /app
31
31
 
32
32
  DOCKERFILE_TEMPLATE = Template(
33
33
  """
34
- FROM --platform=linux/amd64 ${python_image_repo}:${python_version}
34
+ FROM ${python_image_repo}:${python_version}
35
35
  ENV PATH=/virtualenvs/venv/bin:$PATH
36
36
  RUN apt update && \
37
37
  DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git && \
@@ -43,7 +43,7 @@ RUN apt update && \
43
43
 
44
44
  CUDA_DOCKERFILE_TEMPLATE = Template(
45
45
  """
46
- FROM --platform=linux/amd64 nvidia/cuda:${nvidia_cuda_image_tag}
46
+ FROM nvidia/cuda:${nvidia_cuda_image_tag}
47
47
  ENV PATH=/virtualenvs/venv/bin:$PATH
48
48
  RUN echo "deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu $(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2) main" >> /etc/apt/sources.list && \
49
49
  echo "deb-src https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu $(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2) main" >> /etc/apt/sources.list && \
@@ -179,10 +179,11 @@ def trigger_job(
179
179
  command=command_str if command_str else None,
180
180
  params=params if params else None,
181
181
  )
182
+ jobRunName = result.jobRunName
182
183
  previous_runs_url = f"{client.base_url.strip('/')}/deployments/{application_info.id}?tab=previousRuns"
183
184
  logger.info(
184
185
  f"{message}.\n"
185
- f"You can check the status of your job run at {previous_runs_url}"
186
+ f"You can check the status of your job run at {previous_runs_url} with jobRunName: {jobRunName}"
186
187
  )
187
188
  return result
188
189
 
@@ -1,3 +1,4 @@
1
+ from truefoundry.ml.autogen.client.models import LibraryName, ModelVersionEnvironment
1
2
  from truefoundry.ml.enums import (
2
3
  DataSlice,
3
4
  FileFormat,
@@ -7,7 +8,11 @@ from truefoundry.ml.enums import (
7
8
  )
8
9
  from truefoundry.ml.exceptions import MlFoundryException
9
10
  from truefoundry.ml.log_types import Image, Plot
10
- from truefoundry.ml.log_types.artifacts.artifact import ArtifactPath, ArtifactVersion
11
+ from truefoundry.ml.log_types.artifacts.artifact import (
12
+ ArtifactPath,
13
+ ArtifactVersion,
14
+ BlobStorageDirectory,
15
+ )
11
16
  from truefoundry.ml.log_types.artifacts.dataset import DataDirectory, DataDirectoryPath
12
17
  from truefoundry.ml.log_types.artifacts.model import (
13
18
  ModelVersion,
@@ -15,10 +20,28 @@ from truefoundry.ml.log_types.artifacts.model import (
15
20
  from truefoundry.ml.logger import init_logger
16
21
  from truefoundry.ml.mlfoundry_api import get_client
17
22
  from truefoundry.ml.mlfoundry_run import MlFoundryRun
23
+ from truefoundry.ml.model_framework import (
24
+ FastAIFramework,
25
+ GluonFramework,
26
+ H2OFramework,
27
+ KerasFramework,
28
+ LightGBMFramework,
29
+ ModelFrameworkType,
30
+ ONNXFramework,
31
+ PaddleFramework,
32
+ PyTorchFramework,
33
+ SklearnFramework,
34
+ SpaCyFramework,
35
+ StatsModelsFramework,
36
+ TensorFlowFramework,
37
+ TransformersFramework,
38
+ XGBoostFramework,
39
+ )
18
40
 
19
41
  __all__ = [
20
42
  "ArtifactPath",
21
43
  "ArtifactVersion",
44
+ "BlobStorageDirectory",
22
45
  "DataDirectory",
23
46
  "DataDirectoryPath",
24
47
  "DataSlice",
@@ -26,12 +49,29 @@ __all__ = [
26
49
  "Image",
27
50
  "MlFoundryRun",
28
51
  "MlFoundryException",
52
+ "ModelVersionEnvironment",
29
53
  "ModelFramework",
30
54
  "ModelType",
31
55
  "ModelVersion",
32
56
  "Plot",
33
57
  "ViewType",
34
58
  "get_client",
59
+ "FastAIFramework",
60
+ "GluonFramework",
61
+ "H2OFramework",
62
+ "KerasFramework",
63
+ "LightGBMFramework",
64
+ "ONNXFramework",
65
+ "PaddleFramework",
66
+ "PyTorchFramework",
67
+ "SklearnFramework",
68
+ "SpaCyFramework",
69
+ "StatsModelsFramework",
70
+ "TensorFlowFramework",
71
+ "TransformersFramework",
72
+ "XGBoostFramework",
73
+ "LibraryName",
74
+ "ModelFrameworkType",
35
75
  ]
36
76
 
37
77
  init_logger()
@@ -19,14 +19,14 @@ __version__ = "0.1.0"
19
19
  from truefoundry.ml.autogen.client.api.auth_api import AuthApi
20
20
  from truefoundry.ml.autogen.client.api.deprecated_api import DeprecatedApi
21
21
  from truefoundry.ml.autogen.client.api.experiments_api import ExperimentsApi
22
+ from truefoundry.ml.autogen.client.api.generate_code_snippet_api import (
23
+ GenerateCodeSnippetApi,
24
+ )
22
25
  from truefoundry.ml.autogen.client.api.health_api import HealthApi
23
26
  from truefoundry.ml.autogen.client.api.metrics_api import MetricsApi
24
27
  from truefoundry.ml.autogen.client.api.mlfoundry_artifacts_api import (
25
28
  MlfoundryArtifactsApi,
26
29
  )
27
- from truefoundry.ml.autogen.client.api.python_deployment_config_api import (
28
- PythonDeploymentConfigApi,
29
- )
30
30
  from truefoundry.ml.autogen.client.api.run_artifacts_api import RunArtifactsApi
31
31
  from truefoundry.ml.autogen.client.api.runs_api import RunsApi
32
32
 
@@ -61,6 +61,9 @@ from truefoundry.ml.autogen.client.models.artifact_response_dto import (
61
61
  )
62
62
  from truefoundry.ml.autogen.client.models.artifact_type import ArtifactType
63
63
  from truefoundry.ml.autogen.client.models.artifact_version_dto import ArtifactVersionDto
64
+ from truefoundry.ml.autogen.client.models.artifact_version_manifest import (
65
+ ArtifactVersionManifest,
66
+ )
64
67
  from truefoundry.ml.autogen.client.models.artifact_version_response_dto import (
65
68
  ArtifactVersionResponseDto,
66
69
  )
@@ -88,6 +91,7 @@ from truefoundry.ml.autogen.client.models.chat_prompt_messages_inner import (
88
91
  ChatPromptMessagesInner,
89
92
  )
90
93
  from truefoundry.ml.autogen.client.models.columns_dto import ColumnsDto
94
+ from truefoundry.ml.autogen.client.models.command import Command
91
95
  from truefoundry.ml.autogen.client.models.content import Content
92
96
  from truefoundry.ml.autogen.client.models.content1 import Content1
93
97
  from truefoundry.ml.autogen.client.models.content2 import Content2
@@ -139,6 +143,9 @@ from truefoundry.ml.autogen.client.models.create_run_request_dto import (
139
143
  from truefoundry.ml.autogen.client.models.create_run_response_dto import (
140
144
  CreateRunResponseDto,
141
145
  )
146
+ from truefoundry.ml.autogen.client.models.create_workflow_task_config_request_dto import (
147
+ CreateWorkflowTaskConfigRequestDto,
148
+ )
142
149
  from truefoundry.ml.autogen.client.models.dataset_dto import DatasetDto
143
150
  from truefoundry.ml.autogen.client.models.dataset_response_dto import DatasetResponseDto
144
151
  from truefoundry.ml.autogen.client.models.delete_artifact_versions_request_dto import (
@@ -165,11 +172,10 @@ from truefoundry.ml.autogen.client.models.experiment_response_dto import (
165
172
  ExperimentResponseDto,
166
173
  )
167
174
  from truefoundry.ml.autogen.client.models.experiment_tag_dto import ExperimentTagDto
168
- from truefoundry.ml.autogen.client.models.external_model_source import (
169
- ExternalModelSource,
175
+ from truefoundry.ml.autogen.client.models.external_artifact_source import (
176
+ ExternalArtifactSource,
170
177
  )
171
- from truefoundry.ml.autogen.client.models.feature_dto import FeatureDto
172
- from truefoundry.ml.autogen.client.models.feature_value_type import FeatureValueType
178
+ from truefoundry.ml.autogen.client.models.fast_ai_framework import FastAIFramework
173
179
  from truefoundry.ml.autogen.client.models.file_info_dto import FileInfoDto
174
180
  from truefoundry.ml.autogen.client.models.finalize_artifact_version_request_dto import (
175
181
  FinalizeArtifactVersionRequestDto,
@@ -211,14 +217,18 @@ from truefoundry.ml.autogen.client.models.get_signed_urls_for_dataset_write_resp
211
217
  from truefoundry.ml.autogen.client.models.get_tenant_id_response_dto import (
212
218
  GetTenantIdResponseDto,
213
219
  )
220
+ from truefoundry.ml.autogen.client.models.gluon_framework import GluonFramework
221
+ from truefoundry.ml.autogen.client.models.h2_o_framework import H2OFramework
214
222
  from truefoundry.ml.autogen.client.models.http_validation_error import (
215
223
  HTTPValidationError,
216
224
  )
217
225
  from truefoundry.ml.autogen.client.models.image_content_part import ImageContentPart
218
226
  from truefoundry.ml.autogen.client.models.image_url import ImageUrl
219
227
  from truefoundry.ml.autogen.client.models.internal_metadata import InternalMetadata
228
+ from truefoundry.ml.autogen.client.models.keras_framework import KerasFramework
220
229
  from truefoundry.ml.autogen.client.models.latest_run_log_dto import LatestRunLogDto
221
230
  from truefoundry.ml.autogen.client.models.library_name import LibraryName
231
+ from truefoundry.ml.autogen.client.models.light_gbm_framework import LightGBMFramework
222
232
  from truefoundry.ml.autogen.client.models.list_artifact_versions_request_dto import (
223
233
  ListArtifactVersionsRequestDto,
224
234
  )
@@ -291,6 +301,7 @@ from truefoundry.ml.autogen.client.models.log_metric_request_dto import (
291
301
  from truefoundry.ml.autogen.client.models.log_param_request_dto import (
292
302
  LogParamRequestDto,
293
303
  )
304
+ from truefoundry.ml.autogen.client.models.manifest import Manifest
294
305
  from truefoundry.ml.autogen.client.models.method import Method
295
306
  from truefoundry.ml.autogen.client.models.metric_collection_dto import (
296
307
  MetricCollectionDto,
@@ -300,8 +311,10 @@ from truefoundry.ml.autogen.client.models.mime_type import MimeType
300
311
  from truefoundry.ml.autogen.client.models.model_configuration import ModelConfiguration
301
312
  from truefoundry.ml.autogen.client.models.model_dto import ModelDto
302
313
  from truefoundry.ml.autogen.client.models.model_response_dto import ModelResponseDto
303
- from truefoundry.ml.autogen.client.models.model_schema_dto import ModelSchemaDto
304
314
  from truefoundry.ml.autogen.client.models.model_version_dto import ModelVersionDto
315
+ from truefoundry.ml.autogen.client.models.model_version_environment import (
316
+ ModelVersionEnvironment,
317
+ )
305
318
  from truefoundry.ml.autogen.client.models.model_version_manifest import (
306
319
  ModelVersionManifest,
307
320
  )
@@ -320,10 +333,12 @@ from truefoundry.ml.autogen.client.models.multi_part_upload_storage_provider imp
320
333
  from truefoundry.ml.autogen.client.models.notify_artifact_version_failure_dto import (
321
334
  NotifyArtifactVersionFailureDto,
322
335
  )
336
+ from truefoundry.ml.autogen.client.models.onnx_framework import ONNXFramework
323
337
  from truefoundry.ml.autogen.client.models.openapi_spec import OpenapiSpec
338
+ from truefoundry.ml.autogen.client.models.paddle_framework import PaddleFramework
324
339
  from truefoundry.ml.autogen.client.models.param_dto import ParamDto
325
340
  from truefoundry.ml.autogen.client.models.parameters import Parameters
326
- from truefoundry.ml.autogen.client.models.prediction_type import PredictionType
341
+ from truefoundry.ml.autogen.client.models.py_torch_framework import PyTorchFramework
327
342
  from truefoundry.ml.autogen.client.models.resolve_agent_app_response_dto import (
328
343
  ResolveAgentAppResponseDto,
329
344
  )
@@ -343,12 +358,21 @@ from truefoundry.ml.autogen.client.models.search_runs_request_dto import (
343
358
  from truefoundry.ml.autogen.client.models.search_runs_response_dto import (
344
359
  SearchRunsResponseDto,
345
360
  )
361
+ from truefoundry.ml.autogen.client.models.serialization_format import (
362
+ SerializationFormat,
363
+ )
346
364
  from truefoundry.ml.autogen.client.models.set_experiment_tag_request_dto import (
347
365
  SetExperimentTagRequestDto,
348
366
  )
349
367
  from truefoundry.ml.autogen.client.models.set_tag_request_dto import SetTagRequestDto
350
368
  from truefoundry.ml.autogen.client.models.signed_url_dto import SignedURLDto
369
+ from truefoundry.ml.autogen.client.models.sklearn_framework import SklearnFramework
351
370
  from truefoundry.ml.autogen.client.models.source import Source
371
+ from truefoundry.ml.autogen.client.models.source1 import Source1
372
+ from truefoundry.ml.autogen.client.models.spa_cy_framework import SpaCyFramework
373
+ from truefoundry.ml.autogen.client.models.stats_models_framework import (
374
+ StatsModelsFramework,
375
+ )
352
376
  from truefoundry.ml.autogen.client.models.stop import Stop
353
377
  from truefoundry.ml.autogen.client.models.store_run_logs_request_dto import (
354
378
  StoreRunLogsRequestDto,
@@ -356,16 +380,22 @@ from truefoundry.ml.autogen.client.models.store_run_logs_request_dto import (
356
380
  from truefoundry.ml.autogen.client.models.subject import Subject
357
381
  from truefoundry.ml.autogen.client.models.subject_type import SubjectType
358
382
  from truefoundry.ml.autogen.client.models.system_message import SystemMessage
359
- from truefoundry.ml.autogen.client.models.tensorflow_framework import (
360
- TensorflowFramework,
383
+ from truefoundry.ml.autogen.client.models.tensor_flow_framework import (
384
+ TensorFlowFramework,
361
385
  )
362
386
  from truefoundry.ml.autogen.client.models.text import Text
363
387
  from truefoundry.ml.autogen.client.models.text_content_part import TextContentPart
364
388
  from truefoundry.ml.autogen.client.models.transformers_framework import (
365
389
  TransformersFramework,
366
390
  )
367
- from truefoundry.ml.autogen.client.models.truefoundry_model_source import (
368
- TruefoundryModelSource,
391
+ from truefoundry.ml.autogen.client.models.trigger_job_run_config_request_dto import (
392
+ TriggerJobRunConfigRequestDto,
393
+ )
394
+ from truefoundry.ml.autogen.client.models.trigger_job_run_config_response_dto import (
395
+ TriggerJobRunConfigResponseDto,
396
+ )
397
+ from truefoundry.ml.autogen.client.models.true_foundry_artifact_source import (
398
+ TrueFoundryArtifactSource,
369
399
  )
370
400
  from truefoundry.ml.autogen.client.models.update_artifact_version_request_dto import (
371
401
  UpdateArtifactVersionRequestDto,
@@ -385,10 +415,10 @@ from truefoundry.ml.autogen.client.models.update_run_request_dto import (
385
415
  from truefoundry.ml.autogen.client.models.update_run_response_dto import (
386
416
  UpdateRunResponseDto,
387
417
  )
388
- from truefoundry.ml.autogen.client.models.upload_model_source import UploadModelSource
389
418
  from truefoundry.ml.autogen.client.models.url import Url
390
419
  from truefoundry.ml.autogen.client.models.user_message import UserMessage
391
420
  from truefoundry.ml.autogen.client.models.validation_error import ValidationError
392
421
  from truefoundry.ml.autogen.client.models.validation_error_loc_inner import (
393
422
  ValidationErrorLocInner,
394
423
  )
424
+ from truefoundry.ml.autogen.client.models.xg_boost_framework import XGBoostFramework
@@ -4,13 +4,13 @@
4
4
  from truefoundry.ml.autogen.client.api.auth_api import AuthApi
5
5
  from truefoundry.ml.autogen.client.api.deprecated_api import DeprecatedApi
6
6
  from truefoundry.ml.autogen.client.api.experiments_api import ExperimentsApi
7
+ from truefoundry.ml.autogen.client.api.generate_code_snippet_api import (
8
+ GenerateCodeSnippetApi,
9
+ )
7
10
  from truefoundry.ml.autogen.client.api.health_api import HealthApi
8
11
  from truefoundry.ml.autogen.client.api.metrics_api import MetricsApi
9
12
  from truefoundry.ml.autogen.client.api.mlfoundry_artifacts_api import (
10
13
  MlfoundryArtifactsApi,
11
14
  )
12
- from truefoundry.ml.autogen.client.api.python_deployment_config_api import (
13
- PythonDeploymentConfigApi,
14
- )
15
15
  from truefoundry.ml.autogen.client.api.run_artifacts_api import RunArtifactsApi
16
16
  from truefoundry.ml.autogen.client.api.runs_api import RunsApi
@@ -21,12 +21,21 @@ from truefoundry.ml.autogen.client.exceptions import ( # noqa: F401
21
21
  ApiTypeError,
22
22
  ApiValueError,
23
23
  )
24
+ from truefoundry.ml.autogen.client.models.add_custom_metrics_to_model_version_request_dto import (
25
+ AddCustomMetricsToModelVersionRequestDto,
26
+ )
27
+ from truefoundry.ml.autogen.client.models.add_features_to_model_version_request_dto import (
28
+ AddFeaturesToModelVersionRequestDto,
29
+ )
24
30
  from truefoundry.ml.autogen.client.models.body_get_search_runs_get import (
25
31
  BodyGetSearchRunsGet,
26
32
  )
27
33
  from truefoundry.ml.autogen.client.models.get_signed_urls_for_dataset_write_response_dto import (
28
34
  GetSignedURLsForDatasetWriteResponseDto,
29
35
  )
36
+ from truefoundry.ml.autogen.client.models.model_version_response_dto import (
37
+ ModelVersionResponseDto,
38
+ )
30
39
  from truefoundry.ml.autogen.client.models.run_response_dto import RunResponseDto
31
40
  from truefoundry.ml.autogen.client.models.search_runs_response_dto import (
32
41
  SearchRunsResponseDto,
@@ -51,6 +60,330 @@ class DeprecatedApi:
51
60
  api_client = ApiClient.get_default()
52
61
  self.api_client = api_client
53
62
 
63
+ @validate_arguments
64
+ def add_custom_metrics_to_model_version_post(
65
+ self,
66
+ add_custom_metrics_to_model_version_request_dto: AddCustomMetricsToModelVersionRequestDto,
67
+ **kwargs,
68
+ ) -> ModelVersionResponseDto: # noqa: E501
69
+ """(Deprecated) Add Custom Metrics To Model Version # noqa: E501
70
+
71
+ This method makes a synchronous HTTP request by default. To make an
72
+ asynchronous HTTP request, please pass async_req=True
73
+
74
+ >>> thread = api.add_custom_metrics_to_model_version_post(add_custom_metrics_to_model_version_request_dto, async_req=True)
75
+ >>> result = thread.get()
76
+
77
+ :param add_custom_metrics_to_model_version_request_dto: (required)
78
+ :type add_custom_metrics_to_model_version_request_dto: AddCustomMetricsToModelVersionRequestDto
79
+ :param async_req: Whether to execute the request asynchronously.
80
+ :type async_req: bool, optional
81
+ :param _request_timeout: timeout setting for this request.
82
+ If one number provided, it will be total request
83
+ timeout. It can also be a pair (tuple) of
84
+ (connection, read) timeouts.
85
+ :return: Returns the result object.
86
+ If the method is called asynchronously,
87
+ returns the request thread.
88
+ :rtype: ModelVersionResponseDto
89
+ """
90
+ kwargs["_return_http_data_only"] = True
91
+ if "_preload_content" in kwargs:
92
+ message = "Error! Please call the add_custom_metrics_to_model_version_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
93
+ raise ValueError(message)
94
+ return self.add_custom_metrics_to_model_version_post_with_http_info(
95
+ add_custom_metrics_to_model_version_request_dto, **kwargs
96
+ ) # noqa: E501
97
+
98
+ @validate_arguments
99
+ def add_custom_metrics_to_model_version_post_with_http_info(
100
+ self,
101
+ add_custom_metrics_to_model_version_request_dto: AddCustomMetricsToModelVersionRequestDto,
102
+ **kwargs,
103
+ ) -> ApiResponse: # noqa: E501
104
+ """(Deprecated) Add Custom Metrics To Model Version # noqa: E501
105
+
106
+ This method makes a synchronous HTTP request by default. To make an
107
+ asynchronous HTTP request, please pass async_req=True
108
+
109
+ >>> thread = api.add_custom_metrics_to_model_version_post_with_http_info(add_custom_metrics_to_model_version_request_dto, async_req=True)
110
+ >>> result = thread.get()
111
+
112
+ :param add_custom_metrics_to_model_version_request_dto: (required)
113
+ :type add_custom_metrics_to_model_version_request_dto: AddCustomMetricsToModelVersionRequestDto
114
+ :param async_req: Whether to execute the request asynchronously.
115
+ :type async_req: bool, optional
116
+ :param _preload_content: if False, the ApiResponse.data will
117
+ be set to none and raw_data will store the
118
+ HTTP response body without reading/decoding.
119
+ Default is True.
120
+ :type _preload_content: bool, optional
121
+ :param _return_http_data_only: response data instead of ApiResponse
122
+ object with status code, headers, etc
123
+ :type _return_http_data_only: bool, optional
124
+ :param _request_timeout: timeout setting for this request. If one
125
+ number provided, it will be total request
126
+ timeout. It can also be a pair (tuple) of
127
+ (connection, read) timeouts.
128
+ :param _request_auth: set to override the auth_settings for an a single
129
+ request; this effectively ignores the authentication
130
+ in the spec for a single request.
131
+ :type _request_auth: dict, optional
132
+ :type _content_type: string, optional: force content-type for the request
133
+ :return: Returns the result object.
134
+ If the method is called asynchronously,
135
+ returns the request thread.
136
+ :rtype: tuple(ModelVersionResponseDto, status_code(int), headers(HTTPHeaderDict))
137
+ """
138
+
139
+ warnings.warn(
140
+ "POST /model-versions/custom-metrics/add is deprecated.", DeprecationWarning
141
+ )
142
+
143
+ _params = locals()
144
+
145
+ _all_params = ["add_custom_metrics_to_model_version_request_dto"]
146
+ _all_params.extend(
147
+ [
148
+ "async_req",
149
+ "_return_http_data_only",
150
+ "_preload_content",
151
+ "_request_timeout",
152
+ "_request_auth",
153
+ "_content_type",
154
+ "_headers",
155
+ ]
156
+ )
157
+
158
+ # validate the arguments
159
+ for _key, _val in _params["kwargs"].items():
160
+ if _key not in _all_params:
161
+ raise ApiTypeError(
162
+ "Got an unexpected keyword argument '%s'"
163
+ " to method add_custom_metrics_to_model_version_post" % _key
164
+ )
165
+ _params[_key] = _val
166
+ del _params["kwargs"]
167
+
168
+ _collection_formats = {}
169
+
170
+ # process the path parameters
171
+ _path_params = {}
172
+
173
+ # process the query parameters
174
+ _query_params = []
175
+ # process the header parameters
176
+ _header_params = dict(_params.get("_headers", {}))
177
+ # process the form parameters
178
+ _form_params = []
179
+ _files = {}
180
+ # process the body parameter
181
+ _body_params = None
182
+ if _params["add_custom_metrics_to_model_version_request_dto"] is not None:
183
+ _body_params = _params["add_custom_metrics_to_model_version_request_dto"]
184
+
185
+ # set the HTTP header `Accept`
186
+ _header_params["Accept"] = self.api_client.select_header_accept(
187
+ ["application/json"]
188
+ ) # noqa: E501
189
+
190
+ # set the HTTP header `Content-Type`
191
+ _content_types_list = _params.get(
192
+ "_content_type",
193
+ self.api_client.select_header_content_type(["application/json"]),
194
+ )
195
+ if _content_types_list:
196
+ _header_params["Content-Type"] = _content_types_list
197
+
198
+ # authentication setting
199
+ _auth_settings = ["HTTPBearer", "APIKeyCookie"] # noqa: E501
200
+
201
+ _response_types_map = {
202
+ "200": "ModelVersionResponseDto",
203
+ "422": "HTTPValidationError",
204
+ }
205
+
206
+ return self.api_client.call_api(
207
+ "/model-versions/custom-metrics/add",
208
+ "POST",
209
+ _path_params,
210
+ _query_params,
211
+ _header_params,
212
+ body=_body_params,
213
+ post_params=_form_params,
214
+ files=_files,
215
+ response_types_map=_response_types_map,
216
+ auth_settings=_auth_settings,
217
+ async_req=_params.get("async_req"),
218
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
219
+ _preload_content=_params.get("_preload_content", True),
220
+ _request_timeout=_params.get("_request_timeout"),
221
+ collection_formats=_collection_formats,
222
+ _request_auth=_params.get("_request_auth"),
223
+ )
224
+
225
+ @validate_arguments
226
+ def add_features_to_model_version_post(
227
+ self,
228
+ add_features_to_model_version_request_dto: AddFeaturesToModelVersionRequestDto,
229
+ **kwargs,
230
+ ) -> ModelVersionResponseDto: # noqa: E501
231
+ """(Deprecated) Add Features To Model Version # noqa: E501
232
+
233
+ This method makes a synchronous HTTP request by default. To make an
234
+ asynchronous HTTP request, please pass async_req=True
235
+
236
+ >>> thread = api.add_features_to_model_version_post(add_features_to_model_version_request_dto, async_req=True)
237
+ >>> result = thread.get()
238
+
239
+ :param add_features_to_model_version_request_dto: (required)
240
+ :type add_features_to_model_version_request_dto: AddFeaturesToModelVersionRequestDto
241
+ :param async_req: Whether to execute the request asynchronously.
242
+ :type async_req: bool, optional
243
+ :param _request_timeout: timeout setting for this request.
244
+ If one number provided, it will be total request
245
+ timeout. It can also be a pair (tuple) of
246
+ (connection, read) timeouts.
247
+ :return: Returns the result object.
248
+ If the method is called asynchronously,
249
+ returns the request thread.
250
+ :rtype: ModelVersionResponseDto
251
+ """
252
+ kwargs["_return_http_data_only"] = True
253
+ if "_preload_content" in kwargs:
254
+ message = "Error! Please call the add_features_to_model_version_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
255
+ raise ValueError(message)
256
+ return self.add_features_to_model_version_post_with_http_info(
257
+ add_features_to_model_version_request_dto, **kwargs
258
+ ) # noqa: E501
259
+
260
+ @validate_arguments
261
+ def add_features_to_model_version_post_with_http_info(
262
+ self,
263
+ add_features_to_model_version_request_dto: AddFeaturesToModelVersionRequestDto,
264
+ **kwargs,
265
+ ) -> ApiResponse: # noqa: E501
266
+ """(Deprecated) Add Features To Model Version # noqa: E501
267
+
268
+ This method makes a synchronous HTTP request by default. To make an
269
+ asynchronous HTTP request, please pass async_req=True
270
+
271
+ >>> thread = api.add_features_to_model_version_post_with_http_info(add_features_to_model_version_request_dto, async_req=True)
272
+ >>> result = thread.get()
273
+
274
+ :param add_features_to_model_version_request_dto: (required)
275
+ :type add_features_to_model_version_request_dto: AddFeaturesToModelVersionRequestDto
276
+ :param async_req: Whether to execute the request asynchronously.
277
+ :type async_req: bool, optional
278
+ :param _preload_content: if False, the ApiResponse.data will
279
+ be set to none and raw_data will store the
280
+ HTTP response body without reading/decoding.
281
+ Default is True.
282
+ :type _preload_content: bool, optional
283
+ :param _return_http_data_only: response data instead of ApiResponse
284
+ object with status code, headers, etc
285
+ :type _return_http_data_only: bool, optional
286
+ :param _request_timeout: timeout setting for this request. If one
287
+ number provided, it will be total request
288
+ timeout. It can also be a pair (tuple) of
289
+ (connection, read) timeouts.
290
+ :param _request_auth: set to override the auth_settings for an a single
291
+ request; this effectively ignores the authentication
292
+ in the spec for a single request.
293
+ :type _request_auth: dict, optional
294
+ :type _content_type: string, optional: force content-type for the request
295
+ :return: Returns the result object.
296
+ If the method is called asynchronously,
297
+ returns the request thread.
298
+ :rtype: tuple(ModelVersionResponseDto, status_code(int), headers(HTTPHeaderDict))
299
+ """
300
+
301
+ warnings.warn(
302
+ "POST /model-versions/features/add is deprecated.", DeprecationWarning
303
+ )
304
+
305
+ _params = locals()
306
+
307
+ _all_params = ["add_features_to_model_version_request_dto"]
308
+ _all_params.extend(
309
+ [
310
+ "async_req",
311
+ "_return_http_data_only",
312
+ "_preload_content",
313
+ "_request_timeout",
314
+ "_request_auth",
315
+ "_content_type",
316
+ "_headers",
317
+ ]
318
+ )
319
+
320
+ # validate the arguments
321
+ for _key, _val in _params["kwargs"].items():
322
+ if _key not in _all_params:
323
+ raise ApiTypeError(
324
+ "Got an unexpected keyword argument '%s'"
325
+ " to method add_features_to_model_version_post" % _key
326
+ )
327
+ _params[_key] = _val
328
+ del _params["kwargs"]
329
+
330
+ _collection_formats = {}
331
+
332
+ # process the path parameters
333
+ _path_params = {}
334
+
335
+ # process the query parameters
336
+ _query_params = []
337
+ # process the header parameters
338
+ _header_params = dict(_params.get("_headers", {}))
339
+ # process the form parameters
340
+ _form_params = []
341
+ _files = {}
342
+ # process the body parameter
343
+ _body_params = None
344
+ if _params["add_features_to_model_version_request_dto"] is not None:
345
+ _body_params = _params["add_features_to_model_version_request_dto"]
346
+
347
+ # set the HTTP header `Accept`
348
+ _header_params["Accept"] = self.api_client.select_header_accept(
349
+ ["application/json"]
350
+ ) # noqa: E501
351
+
352
+ # set the HTTP header `Content-Type`
353
+ _content_types_list = _params.get(
354
+ "_content_type",
355
+ self.api_client.select_header_content_type(["application/json"]),
356
+ )
357
+ if _content_types_list:
358
+ _header_params["Content-Type"] = _content_types_list
359
+
360
+ # authentication setting
361
+ _auth_settings = ["HTTPBearer", "APIKeyCookie"] # noqa: E501
362
+
363
+ _response_types_map = {
364
+ "200": "ModelVersionResponseDto",
365
+ "422": "HTTPValidationError",
366
+ }
367
+
368
+ return self.api_client.call_api(
369
+ "/model-versions/features/add",
370
+ "POST",
371
+ _path_params,
372
+ _query_params,
373
+ _header_params,
374
+ body=_body_params,
375
+ post_params=_form_params,
376
+ files=_files,
377
+ response_types_map=_response_types_map,
378
+ auth_settings=_auth_settings,
379
+ async_req=_params.get("async_req"),
380
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
381
+ _preload_content=_params.get("_preload_content", True),
382
+ _request_timeout=_params.get("_request_timeout"),
383
+ collection_formats=_collection_formats,
384
+ _request_auth=_params.get("_request_auth"),
385
+ )
386
+
54
387
  @validate_arguments
55
388
  def get_run_by_name_get(
56
389
  self,