truefoundry 0.3.3__py3-none-any.whl → 0.4.0.dev1__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.
- truefoundry/cli/__main__.py +3 -17
- truefoundry/common/__init__.py +0 -0
- truefoundry/common/request_utils.py +56 -0
- truefoundry/deploy/cli/cli.py +1 -1
- truefoundry/deploy/cli/util.py +3 -1
- truefoundry/deploy/lib/auth/credential_provider.py +2 -12
- truefoundry/deploy/lib/clients/servicefoundry_client.py +0 -9
- truefoundry/deploy/lib/exceptions.py +1 -6
- truefoundry/deploy/lib/session.py +1 -16
- truefoundry/langchain/truefoundry_chat.py +1 -1
- truefoundry/langchain/truefoundry_embeddings.py +1 -1
- truefoundry/langchain/truefoundry_llm.py +1 -1
- truefoundry/langchain/utils.py +0 -41
- truefoundry/ml/__init__.py +46 -6
- truefoundry/ml/artifact/__init__.py +0 -0
- truefoundry/ml/artifact/truefoundry_artifact_repo.py +1120 -0
- truefoundry/ml/autogen/__init__.py +0 -0
- truefoundry/ml/autogen/client/__init__.py +373 -0
- truefoundry/ml/autogen/client/api/__init__.py +16 -0
- truefoundry/ml/autogen/client/api/auth_api.py +184 -0
- truefoundry/ml/autogen/client/api/deprecated_api.py +605 -0
- truefoundry/ml/autogen/client/api/experiments_api.py +2109 -0
- truefoundry/ml/autogen/client/api/health_api.py +299 -0
- truefoundry/ml/autogen/client/api/metrics_api.py +371 -0
- truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +7213 -0
- truefoundry/ml/autogen/client/api/python_deployment_config_api.py +201 -0
- truefoundry/ml/autogen/client/api/run_artifacts_api.py +231 -0
- truefoundry/ml/autogen/client/api/runs_api.py +2919 -0
- truefoundry/ml/autogen/client/api_client.py +822 -0
- truefoundry/ml/autogen/client/api_response.py +30 -0
- truefoundry/ml/autogen/client/configuration.py +489 -0
- truefoundry/ml/autogen/client/exceptions.py +161 -0
- truefoundry/ml/autogen/client/models/__init__.py +344 -0
- truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py +69 -0
- truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +83 -0
- truefoundry/ml/autogen/client/models/agent.py +125 -0
- truefoundry/ml/autogen/client/models/agent_app.py +118 -0
- truefoundry/ml/autogen/client/models/agent_open_api_tool.py +143 -0
- truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +144 -0
- truefoundry/ml/autogen/client/models/agent_with_fqn.py +127 -0
- truefoundry/ml/autogen/client/models/artifact_dto.py +115 -0
- truefoundry/ml/autogen/client/models/artifact_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/artifact_type.py +39 -0
- truefoundry/ml/autogen/client/models/artifact_version_dto.py +141 -0
- truefoundry/ml/autogen/client/models/artifact_version_response_dto.py +77 -0
- truefoundry/ml/autogen/client/models/artifact_version_status.py +35 -0
- truefoundry/ml/autogen/client/models/assistant_message.py +89 -0
- truefoundry/ml/autogen/client/models/authorize_user_for_model_request_dto.py +69 -0
- truefoundry/ml/autogen/client/models/authorize_user_for_model_version_request_dto.py +69 -0
- truefoundry/ml/autogen/client/models/backfill_default_storage_integration_id_request_dto.py +67 -0
- truefoundry/ml/autogen/client/models/blob_storage_reference.py +93 -0
- truefoundry/ml/autogen/client/models/body_get_search_runs_get.py +72 -0
- truefoundry/ml/autogen/client/models/chat_prompt.py +156 -0
- truefoundry/ml/autogen/client/models/chat_prompt_messages_inner.py +171 -0
- truefoundry/ml/autogen/client/models/columns_dto.py +73 -0
- truefoundry/ml/autogen/client/models/content.py +153 -0
- truefoundry/ml/autogen/client/models/content1.py +153 -0
- truefoundry/ml/autogen/client/models/content2.py +174 -0
- truefoundry/ml/autogen/client/models/content2_any_of_inner.py +150 -0
- truefoundry/ml/autogen/client/models/create_artifact_request_dto.py +74 -0
- truefoundry/ml/autogen/client/models/create_artifact_response_dto.py +66 -0
- truefoundry/ml/autogen/client/models/create_artifact_version_request_dto.py +74 -0
- truefoundry/ml/autogen/client/models/create_artifact_version_response_dto.py +66 -0
- truefoundry/ml/autogen/client/models/create_dataset_request_dto.py +76 -0
- truefoundry/ml/autogen/client/models/create_experiment_request_dto.py +94 -0
- truefoundry/ml/autogen/client/models/create_experiment_response_dto.py +67 -0
- truefoundry/ml/autogen/client/models/create_model_version_request_dto.py +95 -0
- truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_request_dto.py +73 -0
- truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_response_dto.py +79 -0
- truefoundry/ml/autogen/client/models/create_multi_part_upload_request_dto.py +73 -0
- truefoundry/ml/autogen/client/models/create_python_deployment_config_request_dto.py +72 -0
- truefoundry/ml/autogen/client/models/create_python_deployment_config_response_dto.py +68 -0
- truefoundry/ml/autogen/client/models/create_run_request_dto.py +97 -0
- truefoundry/ml/autogen/client/models/create_run_response_dto.py +76 -0
- truefoundry/ml/autogen/client/models/dataset_dto.py +112 -0
- truefoundry/ml/autogen/client/models/dataset_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/delete_artifact_versions_request_dto.py +65 -0
- truefoundry/ml/autogen/client/models/delete_dataset_request_dto.py +74 -0
- truefoundry/ml/autogen/client/models/delete_model_version_request_dto.py +65 -0
- truefoundry/ml/autogen/client/models/delete_run_request.py +65 -0
- truefoundry/ml/autogen/client/models/delete_tag_request_dto.py +68 -0
- truefoundry/ml/autogen/client/models/experiment_dto.py +127 -0
- truefoundry/ml/autogen/client/models/experiment_id_request_dto.py +67 -0
- truefoundry/ml/autogen/client/models/experiment_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/experiment_tag_dto.py +69 -0
- truefoundry/ml/autogen/client/models/feature_dto.py +68 -0
- truefoundry/ml/autogen/client/models/feature_value_type.py +35 -0
- truefoundry/ml/autogen/client/models/file_info_dto.py +76 -0
- truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +101 -0
- truefoundry/ml/autogen/client/models/get_experiment_response_dto.py +88 -0
- truefoundry/ml/autogen/client/models/get_latest_run_log_response_dto.py +76 -0
- truefoundry/ml/autogen/client/models/get_metric_history_response.py +79 -0
- truefoundry/ml/autogen/client/models/get_signed_url_for_dataset_write_request_dto.py +68 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_request_dto.py +68 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_response_dto.py +81 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_request_dto.py +69 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_response_dto.py +83 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_request_dto.py +68 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_response_dto.py +81 -0
- truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_write_response_dto.py +81 -0
- truefoundry/ml/autogen/client/models/get_tenant_id_response_dto.py +74 -0
- truefoundry/ml/autogen/client/models/http_validation_error.py +82 -0
- truefoundry/ml/autogen/client/models/image_content_part.py +87 -0
- truefoundry/ml/autogen/client/models/image_url.py +75 -0
- truefoundry/ml/autogen/client/models/internal_metadata.py +180 -0
- truefoundry/ml/autogen/client/models/latest_run_log_dto.py +78 -0
- truefoundry/ml/autogen/client/models/list_artifact_versions_request_dto.py +107 -0
- truefoundry/ml/autogen/client/models/list_artifact_versions_response_dto.py +87 -0
- truefoundry/ml/autogen/client/models/list_artifacts_request_dto.py +96 -0
- truefoundry/ml/autogen/client/models/list_artifacts_response_dto.py +86 -0
- truefoundry/ml/autogen/client/models/list_colums_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/list_datasets_request_dto.py +78 -0
- truefoundry/ml/autogen/client/models/list_datasets_response_dto.py +86 -0
- truefoundry/ml/autogen/client/models/list_experiments_response_dto.py +86 -0
- truefoundry/ml/autogen/client/models/list_files_for_artifact_version_request_dto.py +76 -0
- truefoundry/ml/autogen/client/models/list_files_for_artifact_versions_response_dto.py +82 -0
- truefoundry/ml/autogen/client/models/list_files_for_dataset_request_dto.py +76 -0
- truefoundry/ml/autogen/client/models/list_files_for_dataset_response_dto.py +82 -0
- truefoundry/ml/autogen/client/models/list_latest_run_logs_response_dto.py +82 -0
- truefoundry/ml/autogen/client/models/list_metric_history_request_dto.py +69 -0
- truefoundry/ml/autogen/client/models/list_metric_history_response_dto.py +84 -0
- truefoundry/ml/autogen/client/models/list_model_version_response_dto.py +87 -0
- truefoundry/ml/autogen/client/models/list_model_versions_request_dto.py +93 -0
- truefoundry/ml/autogen/client/models/list_models_request_dto.py +89 -0
- truefoundry/ml/autogen/client/models/list_models_response_dto.py +84 -0
- truefoundry/ml/autogen/client/models/list_run_artifacts_response_dto.py +84 -0
- truefoundry/ml/autogen/client/models/list_run_logs_response_dto.py +82 -0
- truefoundry/ml/autogen/client/models/list_seed_experiments_response_dto.py +81 -0
- truefoundry/ml/autogen/client/models/log_batch_request_dto.py +106 -0
- truefoundry/ml/autogen/client/models/log_metric_request_dto.py +80 -0
- truefoundry/ml/autogen/client/models/log_param_request_dto.py +76 -0
- truefoundry/ml/autogen/client/models/method.py +37 -0
- truefoundry/ml/autogen/client/models/metric_collection_dto.py +82 -0
- truefoundry/ml/autogen/client/models/metric_dto.py +76 -0
- truefoundry/ml/autogen/client/models/mime_type.py +37 -0
- truefoundry/ml/autogen/client/models/model_configuration.py +103 -0
- truefoundry/ml/autogen/client/models/model_dto.py +122 -0
- truefoundry/ml/autogen/client/models/model_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/model_schema_dto.py +85 -0
- truefoundry/ml/autogen/client/models/model_version_dto.py +163 -0
- truefoundry/ml/autogen/client/models/model_version_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/multi_part_upload_dto.py +107 -0
- truefoundry/ml/autogen/client/models/multi_part_upload_response_dto.py +79 -0
- truefoundry/ml/autogen/client/models/multi_part_upload_storage_provider.py +34 -0
- truefoundry/ml/autogen/client/models/notify_artifact_version_failure_dto.py +65 -0
- truefoundry/ml/autogen/client/models/openapi_spec.py +152 -0
- truefoundry/ml/autogen/client/models/param_dto.py +66 -0
- truefoundry/ml/autogen/client/models/parameters.py +84 -0
- truefoundry/ml/autogen/client/models/prediction_type.py +34 -0
- truefoundry/ml/autogen/client/models/resolve_agent_app_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/restore_run_request_dto.py +65 -0
- truefoundry/ml/autogen/client/models/run_data_dto.py +104 -0
- truefoundry/ml/autogen/client/models/run_dto.py +84 -0
- truefoundry/ml/autogen/client/models/run_info_dto.py +105 -0
- truefoundry/ml/autogen/client/models/run_log_dto.py +90 -0
- truefoundry/ml/autogen/client/models/run_log_input_dto.py +80 -0
- truefoundry/ml/autogen/client/models/run_response_dto.py +75 -0
- truefoundry/ml/autogen/client/models/run_tag_dto.py +66 -0
- truefoundry/ml/autogen/client/models/search_runs_request_dto.py +94 -0
- truefoundry/ml/autogen/client/models/search_runs_response_dto.py +84 -0
- truefoundry/ml/autogen/client/models/set_experiment_tag_request_dto.py +73 -0
- truefoundry/ml/autogen/client/models/set_tag_request_dto.py +76 -0
- truefoundry/ml/autogen/client/models/signed_url_dto.py +69 -0
- truefoundry/ml/autogen/client/models/stop.py +152 -0
- truefoundry/ml/autogen/client/models/store_run_logs_request_dto.py +83 -0
- truefoundry/ml/autogen/client/models/system_message.py +89 -0
- truefoundry/ml/autogen/client/models/text.py +153 -0
- truefoundry/ml/autogen/client/models/text_content_part.py +84 -0
- truefoundry/ml/autogen/client/models/update_artifact_version_request_dto.py +74 -0
- truefoundry/ml/autogen/client/models/update_dataset_request_dto.py +74 -0
- truefoundry/ml/autogen/client/models/update_experiment_request_dto.py +74 -0
- truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +93 -0
- truefoundry/ml/autogen/client/models/update_run_request_dto.py +78 -0
- truefoundry/ml/autogen/client/models/update_run_response_dto.py +76 -0
- truefoundry/ml/autogen/client/models/url.py +153 -0
- truefoundry/ml/autogen/client/models/user_message.py +89 -0
- truefoundry/ml/autogen/client/models/validation_error.py +87 -0
- truefoundry/ml/autogen/client/models/validation_error_loc_inner.py +154 -0
- truefoundry/ml/autogen/client/rest.py +426 -0
- truefoundry/ml/autogen/client_README.md +322 -0
- truefoundry/ml/cli/__init__.py +0 -0
- truefoundry/ml/cli/cli.py +18 -0
- truefoundry/ml/cli/commands/__init__.py +3 -0
- truefoundry/ml/cli/commands/download.py +87 -0
- truefoundry/ml/constants.py +84 -0
- truefoundry/ml/enums.py +70 -0
- truefoundry/ml/env_vars.py +13 -0
- truefoundry/ml/exceptions.py +8 -0
- truefoundry/ml/git_info.py +60 -0
- truefoundry/ml/internal_namespace.py +52 -0
- truefoundry/ml/log_types/__init__.py +4 -0
- truefoundry/ml/log_types/artifacts/artifact.py +427 -0
- truefoundry/ml/log_types/artifacts/constants.py +33 -0
- truefoundry/ml/log_types/artifacts/dataset.py +383 -0
- truefoundry/ml/log_types/artifacts/general_artifact.py +110 -0
- truefoundry/ml/log_types/artifacts/model.py +628 -0
- truefoundry/ml/log_types/artifacts/model_extras.py +48 -0
- truefoundry/ml/log_types/artifacts/utils.py +161 -0
- truefoundry/ml/log_types/image/__init__.py +3 -0
- truefoundry/ml/log_types/image/constants.py +8 -0
- truefoundry/ml/log_types/image/image.py +358 -0
- truefoundry/ml/log_types/image/image_normalizer.py +101 -0
- truefoundry/ml/log_types/image/types.py +68 -0
- truefoundry/ml/log_types/plot.py +281 -0
- truefoundry/ml/log_types/pydantic_base.py +10 -0
- truefoundry/ml/log_types/utils.py +12 -0
- truefoundry/ml/logger.py +17 -0
- truefoundry/ml/login.py +241 -0
- truefoundry/ml/mlfoundry_api.py +1620 -0
- truefoundry/ml/mlfoundry_run.py +1238 -0
- truefoundry/ml/run_utils.py +102 -0
- truefoundry/ml/services/__init__.py +0 -0
- truefoundry/ml/services/auth_service.py +109 -0
- truefoundry/ml/services/entities.py +108 -0
- truefoundry/ml/services/servicefoundry_service.py +35 -0
- truefoundry/ml/services/utils.py +122 -0
- truefoundry/ml/session.py +271 -0
- truefoundry/ml/validation_utils.py +346 -0
- truefoundry/pydantic_v1.py +5 -1
- {truefoundry-0.3.3.dist-info → truefoundry-0.4.0.dev1.dist-info}/METADATA +18 -11
- truefoundry-0.4.0.dev1.dist-info/RECORD +342 -0
- truefoundry-0.3.3.dist-info/RECORD +0 -136
- /truefoundry/{python_deploy_codegen.py → deploy/python_deploy_codegen.py} +0 -0
- {truefoundry-0.3.3.dist-info → truefoundry-0.4.0.dev1.dist-info}/WHEEL +0 -0
- {truefoundry-0.3.3.dist-info → truefoundry-0.4.0.dev1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
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.ml.autogen.client.models.file_info_dto import FileInfoDto
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, conlist
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ListRunArtifactsResponseDto(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ListRunArtifactsResponseDto
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
root_uri: Optional[StrictStr] = None
|
|
31
|
+
files: conlist(FileInfoDto) = Field(...)
|
|
32
|
+
next_page_token: Optional[StrictStr] = None
|
|
33
|
+
__properties = ["root_uri", "files", "next_page_token"]
|
|
34
|
+
|
|
35
|
+
class Config:
|
|
36
|
+
"""Pydantic configuration"""
|
|
37
|
+
|
|
38
|
+
allow_population_by_field_name = True
|
|
39
|
+
validate_assignment = True
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> ListRunArtifactsResponseDto:
|
|
51
|
+
"""Create an instance of ListRunArtifactsResponseDto from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self):
|
|
55
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
56
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
57
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in files (list)
|
|
58
|
+
_items = []
|
|
59
|
+
if self.files:
|
|
60
|
+
for _item in self.files:
|
|
61
|
+
if _item:
|
|
62
|
+
_items.append(_item.to_dict())
|
|
63
|
+
_dict["files"] = _items
|
|
64
|
+
return _dict
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dict(cls, obj: dict) -> ListRunArtifactsResponseDto:
|
|
68
|
+
"""Create an instance of ListRunArtifactsResponseDto from a dict"""
|
|
69
|
+
if obj is None:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
if not isinstance(obj, dict):
|
|
73
|
+
return ListRunArtifactsResponseDto.parse_obj(obj)
|
|
74
|
+
|
|
75
|
+
_obj = ListRunArtifactsResponseDto.parse_obj(
|
|
76
|
+
{
|
|
77
|
+
"root_uri": obj.get("root_uri"),
|
|
78
|
+
"files": [FileInfoDto.from_dict(_item) for _item in obj.get("files")]
|
|
79
|
+
if obj.get("files") is not None
|
|
80
|
+
else None,
|
|
81
|
+
"next_page_token": obj.get("next_page_token"),
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
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.ml.autogen.client.models.run_log_dto import RunLogDto
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, conlist
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ListRunLogsResponseDto(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ListRunLogsResponseDto
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
run_logs: Optional[conlist(RunLogDto)] = None
|
|
31
|
+
__properties = ["run_logs"]
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
"""Pydantic configuration"""
|
|
35
|
+
|
|
36
|
+
allow_population_by_field_name = True
|
|
37
|
+
validate_assignment = True
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> ListRunLogsResponseDto:
|
|
49
|
+
"""Create an instance of ListRunLogsResponseDto from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self):
|
|
53
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
54
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
55
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in run_logs (list)
|
|
56
|
+
_items = []
|
|
57
|
+
if self.run_logs:
|
|
58
|
+
for _item in self.run_logs:
|
|
59
|
+
if _item:
|
|
60
|
+
_items.append(_item.to_dict())
|
|
61
|
+
_dict["run_logs"] = _items
|
|
62
|
+
return _dict
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dict(cls, obj: dict) -> ListRunLogsResponseDto:
|
|
66
|
+
"""Create an instance of ListRunLogsResponseDto from a dict"""
|
|
67
|
+
if obj is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
if not isinstance(obj, dict):
|
|
71
|
+
return ListRunLogsResponseDto.parse_obj(obj)
|
|
72
|
+
|
|
73
|
+
_obj = ListRunLogsResponseDto.parse_obj(
|
|
74
|
+
{
|
|
75
|
+
"run_logs": [
|
|
76
|
+
RunLogDto.from_dict(_item) for _item in obj.get("run_logs")
|
|
77
|
+
]
|
|
78
|
+
if obj.get("run_logs") is not None
|
|
79
|
+
else None
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
return _obj
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
|
|
20
|
+
from truefoundry.ml.autogen.client.models.experiment_dto import ExperimentDto
|
|
21
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, conlist
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ListSeedExperimentsResponseDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
ListSeedExperimentsResponseDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
experiments: conlist(ExperimentDto) = Field(...)
|
|
30
|
+
__properties = ["experiments"]
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
"""Pydantic configuration"""
|
|
34
|
+
|
|
35
|
+
allow_population_by_field_name = True
|
|
36
|
+
validate_assignment = True
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
return json.dumps(self.to_dict())
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_json(cls, json_str: str) -> ListSeedExperimentsResponseDto:
|
|
48
|
+
"""Create an instance of ListSeedExperimentsResponseDto from a JSON string"""
|
|
49
|
+
return cls.from_dict(json.loads(json_str))
|
|
50
|
+
|
|
51
|
+
def to_dict(self):
|
|
52
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
53
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
54
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in experiments (list)
|
|
55
|
+
_items = []
|
|
56
|
+
if self.experiments:
|
|
57
|
+
for _item in self.experiments:
|
|
58
|
+
if _item:
|
|
59
|
+
_items.append(_item.to_dict())
|
|
60
|
+
_dict["experiments"] = _items
|
|
61
|
+
return _dict
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_dict(cls, obj: dict) -> ListSeedExperimentsResponseDto:
|
|
65
|
+
"""Create an instance of ListSeedExperimentsResponseDto from a dict"""
|
|
66
|
+
if obj is None:
|
|
67
|
+
return None
|
|
68
|
+
|
|
69
|
+
if not isinstance(obj, dict):
|
|
70
|
+
return ListSeedExperimentsResponseDto.parse_obj(obj)
|
|
71
|
+
|
|
72
|
+
_obj = ListSeedExperimentsResponseDto.parse_obj(
|
|
73
|
+
{
|
|
74
|
+
"experiments": [
|
|
75
|
+
ExperimentDto.from_dict(_item) for _item in obj.get("experiments")
|
|
76
|
+
]
|
|
77
|
+
if obj.get("experiments") is not None
|
|
78
|
+
else None
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
return _obj
|
|
@@ -0,0 +1,106 @@
|
|
|
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.ml.autogen.client.models.metric_dto import MetricDto
|
|
22
|
+
from truefoundry.ml.autogen.client.models.param_dto import ParamDto
|
|
23
|
+
from truefoundry.ml.autogen.client.models.run_tag_dto import RunTagDto
|
|
24
|
+
from truefoundry.pydantic_v1 import BaseModel, StrictStr, conlist
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class LogBatchRequestDto(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
LogBatchRequestDto
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
run_id: Optional[StrictStr] = None
|
|
33
|
+
metrics: Optional[conlist(MetricDto)] = None
|
|
34
|
+
params: Optional[conlist(ParamDto)] = None
|
|
35
|
+
tags: Optional[conlist(RunTagDto)] = None
|
|
36
|
+
__properties = ["run_id", "metrics", "params", "tags"]
|
|
37
|
+
|
|
38
|
+
class Config:
|
|
39
|
+
"""Pydantic configuration"""
|
|
40
|
+
|
|
41
|
+
allow_population_by_field_name = True
|
|
42
|
+
validate_assignment = True
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> LogBatchRequestDto:
|
|
54
|
+
"""Create an instance of LogBatchRequestDto from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self):
|
|
58
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
59
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
60
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in metrics (list)
|
|
61
|
+
_items = []
|
|
62
|
+
if self.metrics:
|
|
63
|
+
for _item in self.metrics:
|
|
64
|
+
if _item:
|
|
65
|
+
_items.append(_item.to_dict())
|
|
66
|
+
_dict["metrics"] = _items
|
|
67
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in params (list)
|
|
68
|
+
_items = []
|
|
69
|
+
if self.params:
|
|
70
|
+
for _item in self.params:
|
|
71
|
+
if _item:
|
|
72
|
+
_items.append(_item.to_dict())
|
|
73
|
+
_dict["params"] = _items
|
|
74
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in tags (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.tags:
|
|
77
|
+
for _item in self.tags:
|
|
78
|
+
if _item:
|
|
79
|
+
_items.append(_item.to_dict())
|
|
80
|
+
_dict["tags"] = _items
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: dict) -> LogBatchRequestDto:
|
|
85
|
+
"""Create an instance of LogBatchRequestDto from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return LogBatchRequestDto.parse_obj(obj)
|
|
91
|
+
|
|
92
|
+
_obj = LogBatchRequestDto.parse_obj(
|
|
93
|
+
{
|
|
94
|
+
"run_id": obj.get("run_id"),
|
|
95
|
+
"metrics": [MetricDto.from_dict(_item) for _item in obj.get("metrics")]
|
|
96
|
+
if obj.get("metrics") is not None
|
|
97
|
+
else None,
|
|
98
|
+
"params": [ParamDto.from_dict(_item) for _item in obj.get("params")]
|
|
99
|
+
if obj.get("params") is not None
|
|
100
|
+
else None,
|
|
101
|
+
"tags": [RunTagDto.from_dict(_item) for _item in obj.get("tags")]
|
|
102
|
+
if obj.get("tags") is not None
|
|
103
|
+
else None,
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
return _obj
|
|
@@ -0,0 +1,80 @@
|
|
|
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, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class LogMetricRequestDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
LogMetricRequestDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
run_id: Optional[StrictStr] = None
|
|
30
|
+
run_uuid: Optional[StrictStr] = None
|
|
31
|
+
key: StrictStr = Field(...)
|
|
32
|
+
value: Union[StrictFloat, StrictInt] = Field(...)
|
|
33
|
+
timestamp: StrictInt = Field(...)
|
|
34
|
+
step: Optional[StrictInt] = 0
|
|
35
|
+
__properties = ["run_id", "run_uuid", "key", "value", "timestamp", "step"]
|
|
36
|
+
|
|
37
|
+
class Config:
|
|
38
|
+
"""Pydantic configuration"""
|
|
39
|
+
|
|
40
|
+
allow_population_by_field_name = True
|
|
41
|
+
validate_assignment = True
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> LogMetricRequestDto:
|
|
53
|
+
"""Create an instance of LogMetricRequestDto from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self):
|
|
57
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
58
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
59
|
+
return _dict
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_dict(cls, obj: dict) -> LogMetricRequestDto:
|
|
63
|
+
"""Create an instance of LogMetricRequestDto from a dict"""
|
|
64
|
+
if obj is None:
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
if not isinstance(obj, dict):
|
|
68
|
+
return LogMetricRequestDto.parse_obj(obj)
|
|
69
|
+
|
|
70
|
+
_obj = LogMetricRequestDto.parse_obj(
|
|
71
|
+
{
|
|
72
|
+
"run_id": obj.get("run_id"),
|
|
73
|
+
"run_uuid": obj.get("run_uuid"),
|
|
74
|
+
"key": obj.get("key"),
|
|
75
|
+
"value": obj.get("value"),
|
|
76
|
+
"timestamp": obj.get("timestamp"),
|
|
77
|
+
"step": obj.get("step") if obj.get("step") is not None else 0,
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
return _obj
|
|
@@ -0,0 +1,76 @@
|
|
|
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 BaseModel, Field, StrictStr
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class LogParamRequestDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
LogParamRequestDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
run_id: Optional[StrictStr] = None
|
|
30
|
+
run_uuid: Optional[StrictStr] = None
|
|
31
|
+
key: StrictStr = Field(...)
|
|
32
|
+
value: StrictStr = Field(...)
|
|
33
|
+
__properties = ["run_id", "run_uuid", "key", "value"]
|
|
34
|
+
|
|
35
|
+
class Config:
|
|
36
|
+
"""Pydantic configuration"""
|
|
37
|
+
|
|
38
|
+
allow_population_by_field_name = True
|
|
39
|
+
validate_assignment = True
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> LogParamRequestDto:
|
|
51
|
+
"""Create an instance of LogParamRequestDto from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self):
|
|
55
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
56
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
57
|
+
return _dict
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_dict(cls, obj: dict) -> LogParamRequestDto:
|
|
61
|
+
"""Create an instance of LogParamRequestDto from a dict"""
|
|
62
|
+
if obj is None:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
if not isinstance(obj, dict):
|
|
66
|
+
return LogParamRequestDto.parse_obj(obj)
|
|
67
|
+
|
|
68
|
+
_obj = LogParamRequestDto.parse_obj(
|
|
69
|
+
{
|
|
70
|
+
"run_id": obj.get("run_id"),
|
|
71
|
+
"run_uuid": obj.get("run_uuid"),
|
|
72
|
+
"key": obj.get("key"),
|
|
73
|
+
"value": obj.get("value"),
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
return _obj
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import json
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
|
|
17
|
+
from aenum import Enum
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Method(str, Enum):
|
|
21
|
+
"""
|
|
22
|
+
+sort=50 +uiType=Hidden
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
allowed enum values
|
|
27
|
+
"""
|
|
28
|
+
GET = "get"
|
|
29
|
+
POST = "post"
|
|
30
|
+
PUT = "put"
|
|
31
|
+
DELETE = "delete"
|
|
32
|
+
PATCH = "patch"
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_json(cls, json_str: str) -> Method:
|
|
36
|
+
"""Create an instance of Method from a JSON string"""
|
|
37
|
+
return Method(json.loads(json_str))
|
|
@@ -0,0 +1,82 @@
|
|
|
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.ml.autogen.client.models.metric_dto import MetricDto
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, StrictStr, conlist
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MetricCollectionDto(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
MetricCollectionDto
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
key: Optional[StrictStr] = None
|
|
31
|
+
metrics: Optional[conlist(MetricDto)] = None
|
|
32
|
+
__properties = ["key", "metrics"]
|
|
33
|
+
|
|
34
|
+
class Config:
|
|
35
|
+
"""Pydantic configuration"""
|
|
36
|
+
|
|
37
|
+
allow_population_by_field_name = True
|
|
38
|
+
validate_assignment = True
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> MetricCollectionDto:
|
|
50
|
+
"""Create an instance of MetricCollectionDto from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self):
|
|
54
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
55
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
56
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in metrics (list)
|
|
57
|
+
_items = []
|
|
58
|
+
if self.metrics:
|
|
59
|
+
for _item in self.metrics:
|
|
60
|
+
if _item:
|
|
61
|
+
_items.append(_item.to_dict())
|
|
62
|
+
_dict["metrics"] = _items
|
|
63
|
+
return _dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls, obj: dict) -> MetricCollectionDto:
|
|
67
|
+
"""Create an instance of MetricCollectionDto from a dict"""
|
|
68
|
+
if obj is None:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
if not isinstance(obj, dict):
|
|
72
|
+
return MetricCollectionDto.parse_obj(obj)
|
|
73
|
+
|
|
74
|
+
_obj = MetricCollectionDto.parse_obj(
|
|
75
|
+
{
|
|
76
|
+
"key": obj.get("key"),
|
|
77
|
+
"metrics": [MetricDto.from_dict(_item) for _item in obj.get("metrics")]
|
|
78
|
+
if obj.get("metrics") is not None
|
|
79
|
+
else None,
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
return _obj
|