truefoundry 0.3.4__py3-none-any.whl → 0.4.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.
- truefoundry/__init__.py +2 -0
- truefoundry/autodeploy/agents/developer.py +1 -1
- truefoundry/autodeploy/agents/project_identifier.py +2 -2
- truefoundry/autodeploy/agents/tester.py +1 -1
- truefoundry/autodeploy/cli.py +1 -1
- truefoundry/autodeploy/tools/list_files.py +1 -1
- truefoundry/cli/__main__.py +3 -17
- truefoundry/common/__init__.py +0 -0
- truefoundry/{deploy/lib/auth → common}/auth_service_client.py +50 -40
- truefoundry/common/constants.py +12 -0
- truefoundry/{deploy/lib/auth → common}/credential_file_manager.py +7 -7
- truefoundry/{deploy/lib/auth → common}/credential_provider.py +10 -23
- truefoundry/common/entities.py +124 -0
- truefoundry/common/exceptions.py +12 -0
- truefoundry/common/request_utils.py +84 -0
- truefoundry/common/servicefoundry_client.py +91 -0
- truefoundry/common/utils.py +56 -0
- truefoundry/deploy/auto_gen/models.py +4 -6
- truefoundry/deploy/cli/cli.py +3 -1
- truefoundry/deploy/cli/commands/apply_command.py +1 -1
- truefoundry/deploy/cli/commands/build_command.py +1 -1
- truefoundry/deploy/cli/commands/deploy_command.py +1 -1
- truefoundry/deploy/cli/commands/login_command.py +2 -2
- truefoundry/deploy/cli/commands/patch_application_command.py +1 -1
- truefoundry/deploy/cli/commands/patch_command.py +1 -1
- truefoundry/deploy/cli/commands/terminate_comand.py +1 -1
- truefoundry/deploy/cli/util.py +1 -1
- truefoundry/deploy/function_service/remote/remote.py +1 -1
- truefoundry/deploy/lib/auth/servicefoundry_session.py +2 -2
- truefoundry/deploy/lib/clients/servicefoundry_client.py +120 -159
- truefoundry/deploy/lib/const.py +1 -35
- truefoundry/deploy/lib/exceptions.py +0 -16
- truefoundry/deploy/lib/model/entity.py +1 -112
- truefoundry/deploy/lib/session.py +14 -42
- truefoundry/deploy/lib/util.py +0 -37
- truefoundry/{python_deploy_codegen.py → deploy/python_deploy_codegen.py} +2 -2
- truefoundry/deploy/v2/lib/deploy.py +3 -3
- truefoundry/deploy/v2/lib/deployable_patched_models.py +1 -1
- 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 +37 -6
- truefoundry/ml/artifact/__init__.py +0 -0
- truefoundry/ml/artifact/truefoundry_artifact_repo.py +1161 -0
- truefoundry/ml/autogen/__init__.py +0 -0
- truefoundry/ml/autogen/client/__init__.py +370 -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 +1944 -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 +341 -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/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 +65 -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 +65 -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 +67 -0
- truefoundry/ml/autogen/client/models/create_run_request_dto.py +97 -0
- truefoundry/ml/autogen/client/models/create_run_response_dto.py +75 -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 +75 -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 +73 -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 +170 -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 +75 -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 +320 -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/clients/__init__.py +0 -0
- truefoundry/ml/clients/entities.py +8 -0
- truefoundry/ml/clients/servicefoundry_client.py +45 -0
- truefoundry/ml/clients/utils.py +122 -0
- truefoundry/ml/constants.py +84 -0
- truefoundry/ml/entities.py +62 -0
- truefoundry/ml/enums.py +70 -0
- truefoundry/ml/env_vars.py +9 -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 +431 -0
- truefoundry/ml/log_types/artifacts/constants.py +33 -0
- truefoundry/ml/log_types/artifacts/dataset.py +384 -0
- truefoundry/ml/log_types/artifacts/general_artifact.py +110 -0
- truefoundry/ml/log_types/artifacts/model.py +611 -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 +357 -0
- truefoundry/ml/log_types/image/image_normalizer.py +102 -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/mlfoundry_api.py +1575 -0
- truefoundry/ml/mlfoundry_run.py +1203 -0
- truefoundry/ml/run_utils.py +93 -0
- truefoundry/ml/session.py +168 -0
- truefoundry/ml/validation_utils.py +346 -0
- truefoundry/pydantic_v1.py +6 -2
- truefoundry/workflow/__init__.py +16 -1
- {truefoundry-0.3.4.dist-info → truefoundry-0.4.0.dist-info}/METADATA +21 -14
- truefoundry-0.4.0.dist-info/RECORD +344 -0
- truefoundry/deploy/lib/clients/utils.py +0 -41
- truefoundry-0.3.4.dist-info/RECORD +0 -136
- {truefoundry-0.3.4.dist-info → truefoundry-0.4.0.dist-info}/WHEEL +0 -0
- {truefoundry-0.3.4.dist-info → truefoundry-0.4.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
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 TYPE_CHECKING, Any, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.blob_storage_reference import (
|
|
22
|
+
BlobStorageReference,
|
|
23
|
+
)
|
|
24
|
+
from truefoundry.pydantic_v1 import (
|
|
25
|
+
BaseModel,
|
|
26
|
+
Field,
|
|
27
|
+
ValidationError,
|
|
28
|
+
constr,
|
|
29
|
+
validator,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
CONTENT1_ANY_OF_SCHEMAS = ["BlobStorageReference", "str"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Content1(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
+label=Content +usage=Text content for the system message
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
# data type: str
|
|
41
|
+
anyof_schema_1_validator: Optional[constr(strict=True)] = None
|
|
42
|
+
# data type: BlobStorageReference
|
|
43
|
+
anyof_schema_2_validator: Optional[BlobStorageReference] = None
|
|
44
|
+
if TYPE_CHECKING:
|
|
45
|
+
actual_instance: Union[BlobStorageReference, str]
|
|
46
|
+
else:
|
|
47
|
+
actual_instance: Any
|
|
48
|
+
any_of_schemas: List[str] = Field(CONTENT1_ANY_OF_SCHEMAS, const=True)
|
|
49
|
+
|
|
50
|
+
class Config:
|
|
51
|
+
validate_assignment = True
|
|
52
|
+
|
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
54
|
+
if args:
|
|
55
|
+
if len(args) > 1:
|
|
56
|
+
raise ValueError(
|
|
57
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
58
|
+
)
|
|
59
|
+
if kwargs:
|
|
60
|
+
raise ValueError(
|
|
61
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
62
|
+
)
|
|
63
|
+
super().__init__(actual_instance=args[0])
|
|
64
|
+
else:
|
|
65
|
+
super().__init__(**kwargs)
|
|
66
|
+
|
|
67
|
+
@validator("actual_instance")
|
|
68
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
69
|
+
instance = Content1.construct()
|
|
70
|
+
error_messages = []
|
|
71
|
+
# validate data type: str
|
|
72
|
+
try:
|
|
73
|
+
instance.anyof_schema_1_validator = v
|
|
74
|
+
return v
|
|
75
|
+
except (ValidationError, ValueError) as e:
|
|
76
|
+
error_messages.append(str(e))
|
|
77
|
+
# validate data type: BlobStorageReference
|
|
78
|
+
if not isinstance(v, BlobStorageReference):
|
|
79
|
+
error_messages.append(
|
|
80
|
+
f"Error! Input type `{type(v)}` is not `BlobStorageReference`"
|
|
81
|
+
)
|
|
82
|
+
else:
|
|
83
|
+
return v
|
|
84
|
+
|
|
85
|
+
if error_messages:
|
|
86
|
+
# no match
|
|
87
|
+
raise ValueError(
|
|
88
|
+
"No match found when setting the actual_instance in Content1 with anyOf schemas: BlobStorageReference, str. Details: "
|
|
89
|
+
+ ", ".join(error_messages)
|
|
90
|
+
)
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls, obj: dict) -> Content1:
|
|
96
|
+
return cls.from_json(json.dumps(obj))
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_json(cls, json_str: str) -> Content1:
|
|
100
|
+
"""Returns the object represented by the json string"""
|
|
101
|
+
instance = Content1.construct()
|
|
102
|
+
error_messages = []
|
|
103
|
+
# deserialize data into str
|
|
104
|
+
try:
|
|
105
|
+
# validation
|
|
106
|
+
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
107
|
+
# assign value to actual_instance
|
|
108
|
+
instance.actual_instance = instance.anyof_schema_1_validator
|
|
109
|
+
return instance
|
|
110
|
+
except (ValidationError, ValueError) as e:
|
|
111
|
+
error_messages.append(str(e))
|
|
112
|
+
# anyof_schema_2_validator: Optional[BlobStorageReference] = None
|
|
113
|
+
try:
|
|
114
|
+
instance.actual_instance = BlobStorageReference.from_json(json_str)
|
|
115
|
+
return instance
|
|
116
|
+
except (ValidationError, ValueError) as e:
|
|
117
|
+
error_messages.append(str(e))
|
|
118
|
+
|
|
119
|
+
if error_messages:
|
|
120
|
+
# no match
|
|
121
|
+
raise ValueError(
|
|
122
|
+
"No match found when deserializing the JSON string into Content1 with anyOf schemas: BlobStorageReference, str. Details: "
|
|
123
|
+
+ ", ".join(error_messages)
|
|
124
|
+
)
|
|
125
|
+
else:
|
|
126
|
+
return instance
|
|
127
|
+
|
|
128
|
+
def to_json(self) -> str:
|
|
129
|
+
"""Returns the JSON representation of the actual instance"""
|
|
130
|
+
if self.actual_instance is None:
|
|
131
|
+
return "null"
|
|
132
|
+
|
|
133
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
134
|
+
if callable(to_json):
|
|
135
|
+
return self.actual_instance.to_json()
|
|
136
|
+
else:
|
|
137
|
+
return json.dumps(self.actual_instance)
|
|
138
|
+
|
|
139
|
+
def to_dict(self) -> dict:
|
|
140
|
+
"""Returns the dict representation of the actual instance"""
|
|
141
|
+
if self.actual_instance is None:
|
|
142
|
+
return "null"
|
|
143
|
+
|
|
144
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
145
|
+
if callable(to_json):
|
|
146
|
+
return self.actual_instance.to_dict()
|
|
147
|
+
else:
|
|
148
|
+
# primitive type
|
|
149
|
+
return self.actual_instance
|
|
150
|
+
|
|
151
|
+
def to_str(self) -> str:
|
|
152
|
+
"""Returns the string representation of the actual instance"""
|
|
153
|
+
return pprint.pformat(self.dict())
|
|
@@ -0,0 +1,174 @@
|
|
|
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 TYPE_CHECKING, Any, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.blob_storage_reference import (
|
|
22
|
+
BlobStorageReference,
|
|
23
|
+
)
|
|
24
|
+
from truefoundry.ml.autogen.client.models.content2_any_of_inner import (
|
|
25
|
+
Content2AnyOfInner,
|
|
26
|
+
)
|
|
27
|
+
from truefoundry.pydantic_v1 import (
|
|
28
|
+
BaseModel,
|
|
29
|
+
Field,
|
|
30
|
+
ValidationError,
|
|
31
|
+
conlist,
|
|
32
|
+
constr,
|
|
33
|
+
validator,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
CONTENT2_ANY_OF_SCHEMAS = ["BlobStorageReference", "List[Content2AnyOfInner]", "str"]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Content2(BaseModel):
|
|
40
|
+
"""
|
|
41
|
+
+label=Content +usage=Text content for the user message
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
# data type: str
|
|
45
|
+
anyof_schema_1_validator: Optional[constr(strict=True)] = None
|
|
46
|
+
# data type: BlobStorageReference
|
|
47
|
+
anyof_schema_2_validator: Optional[BlobStorageReference] = None
|
|
48
|
+
# data type: List[Content2AnyOfInner]
|
|
49
|
+
anyof_schema_3_validator: Optional[conlist(Content2AnyOfInner)] = None
|
|
50
|
+
if TYPE_CHECKING:
|
|
51
|
+
actual_instance: Union[BlobStorageReference, List[Content2AnyOfInner], str]
|
|
52
|
+
else:
|
|
53
|
+
actual_instance: Any
|
|
54
|
+
any_of_schemas: List[str] = Field(CONTENT2_ANY_OF_SCHEMAS, const=True)
|
|
55
|
+
|
|
56
|
+
class Config:
|
|
57
|
+
validate_assignment = True
|
|
58
|
+
|
|
59
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
60
|
+
if args:
|
|
61
|
+
if len(args) > 1:
|
|
62
|
+
raise ValueError(
|
|
63
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
64
|
+
)
|
|
65
|
+
if kwargs:
|
|
66
|
+
raise ValueError(
|
|
67
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
68
|
+
)
|
|
69
|
+
super().__init__(actual_instance=args[0])
|
|
70
|
+
else:
|
|
71
|
+
super().__init__(**kwargs)
|
|
72
|
+
|
|
73
|
+
@validator("actual_instance")
|
|
74
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
75
|
+
instance = Content2.construct()
|
|
76
|
+
error_messages = []
|
|
77
|
+
# validate data type: str
|
|
78
|
+
try:
|
|
79
|
+
instance.anyof_schema_1_validator = v
|
|
80
|
+
return v
|
|
81
|
+
except (ValidationError, ValueError) as e:
|
|
82
|
+
error_messages.append(str(e))
|
|
83
|
+
# validate data type: BlobStorageReference
|
|
84
|
+
if not isinstance(v, BlobStorageReference):
|
|
85
|
+
error_messages.append(
|
|
86
|
+
f"Error! Input type `{type(v)}` is not `BlobStorageReference`"
|
|
87
|
+
)
|
|
88
|
+
else:
|
|
89
|
+
return v
|
|
90
|
+
|
|
91
|
+
# validate data type: List[Content2AnyOfInner]
|
|
92
|
+
try:
|
|
93
|
+
instance.anyof_schema_3_validator = v
|
|
94
|
+
return v
|
|
95
|
+
except (ValidationError, ValueError) as e:
|
|
96
|
+
error_messages.append(str(e))
|
|
97
|
+
if error_messages:
|
|
98
|
+
# no match
|
|
99
|
+
raise ValueError(
|
|
100
|
+
"No match found when setting the actual_instance in Content2 with anyOf schemas: BlobStorageReference, List[Content2AnyOfInner], str. Details: "
|
|
101
|
+
+ ", ".join(error_messages)
|
|
102
|
+
)
|
|
103
|
+
else:
|
|
104
|
+
return v
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def from_dict(cls, obj: dict) -> Content2:
|
|
108
|
+
return cls.from_json(json.dumps(obj))
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_json(cls, json_str: str) -> Content2:
|
|
112
|
+
"""Returns the object represented by the json string"""
|
|
113
|
+
instance = Content2.construct()
|
|
114
|
+
error_messages = []
|
|
115
|
+
# deserialize data into str
|
|
116
|
+
try:
|
|
117
|
+
# validation
|
|
118
|
+
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
119
|
+
# assign value to actual_instance
|
|
120
|
+
instance.actual_instance = instance.anyof_schema_1_validator
|
|
121
|
+
return instance
|
|
122
|
+
except (ValidationError, ValueError) as e:
|
|
123
|
+
error_messages.append(str(e))
|
|
124
|
+
# anyof_schema_2_validator: Optional[BlobStorageReference] = None
|
|
125
|
+
try:
|
|
126
|
+
instance.actual_instance = BlobStorageReference.from_json(json_str)
|
|
127
|
+
return instance
|
|
128
|
+
except (ValidationError, ValueError) as e:
|
|
129
|
+
error_messages.append(str(e))
|
|
130
|
+
# deserialize data into List[Content2AnyOfInner]
|
|
131
|
+
try:
|
|
132
|
+
# validation
|
|
133
|
+
instance.anyof_schema_3_validator = json.loads(json_str)
|
|
134
|
+
# assign value to actual_instance
|
|
135
|
+
instance.actual_instance = instance.anyof_schema_3_validator
|
|
136
|
+
return instance
|
|
137
|
+
except (ValidationError, ValueError) as e:
|
|
138
|
+
error_messages.append(str(e))
|
|
139
|
+
|
|
140
|
+
if error_messages:
|
|
141
|
+
# no match
|
|
142
|
+
raise ValueError(
|
|
143
|
+
"No match found when deserializing the JSON string into Content2 with anyOf schemas: BlobStorageReference, List[Content2AnyOfInner], str. Details: "
|
|
144
|
+
+ ", ".join(error_messages)
|
|
145
|
+
)
|
|
146
|
+
else:
|
|
147
|
+
return instance
|
|
148
|
+
|
|
149
|
+
def to_json(self) -> str:
|
|
150
|
+
"""Returns the JSON representation of the actual instance"""
|
|
151
|
+
if self.actual_instance is None:
|
|
152
|
+
return "null"
|
|
153
|
+
|
|
154
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
155
|
+
if callable(to_json):
|
|
156
|
+
return self.actual_instance.to_json()
|
|
157
|
+
else:
|
|
158
|
+
return json.dumps(self.actual_instance)
|
|
159
|
+
|
|
160
|
+
def to_dict(self) -> dict:
|
|
161
|
+
"""Returns the dict representation of the actual instance"""
|
|
162
|
+
if self.actual_instance is None:
|
|
163
|
+
return "null"
|
|
164
|
+
|
|
165
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
166
|
+
if callable(to_json):
|
|
167
|
+
return self.actual_instance.to_dict()
|
|
168
|
+
else:
|
|
169
|
+
# primitive type
|
|
170
|
+
return self.actual_instance
|
|
171
|
+
|
|
172
|
+
def to_str(self) -> str:
|
|
173
|
+
"""Returns the string representation of the actual instance"""
|
|
174
|
+
return pprint.pformat(self.dict())
|
|
@@ -0,0 +1,150 @@
|
|
|
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 TYPE_CHECKING, Any, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.image_content_part import ImageContentPart
|
|
22
|
+
from truefoundry.ml.autogen.client.models.text_content_part import TextContentPart
|
|
23
|
+
from truefoundry.pydantic_v1 import (
|
|
24
|
+
BaseModel,
|
|
25
|
+
Field,
|
|
26
|
+
ValidationError,
|
|
27
|
+
validator,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
CONTENT2ANYOFINNER_ANY_OF_SCHEMAS = ["ImageContentPart", "TextContentPart"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Content2AnyOfInner(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
Content2AnyOfInner
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
# data type: TextContentPart
|
|
39
|
+
anyof_schema_1_validator: Optional[TextContentPart] = None
|
|
40
|
+
# data type: ImageContentPart
|
|
41
|
+
anyof_schema_2_validator: Optional[ImageContentPart] = None
|
|
42
|
+
if TYPE_CHECKING:
|
|
43
|
+
actual_instance: Union[ImageContentPart, TextContentPart]
|
|
44
|
+
else:
|
|
45
|
+
actual_instance: Any
|
|
46
|
+
any_of_schemas: List[str] = Field(CONTENT2ANYOFINNER_ANY_OF_SCHEMAS, const=True)
|
|
47
|
+
|
|
48
|
+
class Config:
|
|
49
|
+
validate_assignment = True
|
|
50
|
+
|
|
51
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
52
|
+
if args:
|
|
53
|
+
if len(args) > 1:
|
|
54
|
+
raise ValueError(
|
|
55
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
56
|
+
)
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError(
|
|
59
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
60
|
+
)
|
|
61
|
+
super().__init__(actual_instance=args[0])
|
|
62
|
+
else:
|
|
63
|
+
super().__init__(**kwargs)
|
|
64
|
+
|
|
65
|
+
@validator("actual_instance")
|
|
66
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
67
|
+
instance = Content2AnyOfInner.construct()
|
|
68
|
+
error_messages = []
|
|
69
|
+
# validate data type: TextContentPart
|
|
70
|
+
if not isinstance(v, TextContentPart):
|
|
71
|
+
error_messages.append(
|
|
72
|
+
f"Error! Input type `{type(v)}` is not `TextContentPart`"
|
|
73
|
+
)
|
|
74
|
+
else:
|
|
75
|
+
return v
|
|
76
|
+
|
|
77
|
+
# validate data type: ImageContentPart
|
|
78
|
+
if not isinstance(v, ImageContentPart):
|
|
79
|
+
error_messages.append(
|
|
80
|
+
f"Error! Input type `{type(v)}` is not `ImageContentPart`"
|
|
81
|
+
)
|
|
82
|
+
else:
|
|
83
|
+
return v
|
|
84
|
+
|
|
85
|
+
if error_messages:
|
|
86
|
+
# no match
|
|
87
|
+
raise ValueError(
|
|
88
|
+
"No match found when setting the actual_instance in Content2AnyOfInner with anyOf schemas: ImageContentPart, TextContentPart. Details: "
|
|
89
|
+
+ ", ".join(error_messages)
|
|
90
|
+
)
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls, obj: dict) -> Content2AnyOfInner:
|
|
96
|
+
return cls.from_json(json.dumps(obj))
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_json(cls, json_str: str) -> Content2AnyOfInner:
|
|
100
|
+
"""Returns the object represented by the json string"""
|
|
101
|
+
instance = Content2AnyOfInner.construct()
|
|
102
|
+
error_messages = []
|
|
103
|
+
# anyof_schema_1_validator: Optional[TextContentPart] = None
|
|
104
|
+
try:
|
|
105
|
+
instance.actual_instance = TextContentPart.from_json(json_str)
|
|
106
|
+
return instance
|
|
107
|
+
except (ValidationError, ValueError) as e:
|
|
108
|
+
error_messages.append(str(e))
|
|
109
|
+
# anyof_schema_2_validator: Optional[ImageContentPart] = None
|
|
110
|
+
try:
|
|
111
|
+
instance.actual_instance = ImageContentPart.from_json(json_str)
|
|
112
|
+
return instance
|
|
113
|
+
except (ValidationError, ValueError) as e:
|
|
114
|
+
error_messages.append(str(e))
|
|
115
|
+
|
|
116
|
+
if error_messages:
|
|
117
|
+
# no match
|
|
118
|
+
raise ValueError(
|
|
119
|
+
"No match found when deserializing the JSON string into Content2AnyOfInner with anyOf schemas: ImageContentPart, TextContentPart. Details: "
|
|
120
|
+
+ ", ".join(error_messages)
|
|
121
|
+
)
|
|
122
|
+
else:
|
|
123
|
+
return instance
|
|
124
|
+
|
|
125
|
+
def to_json(self) -> str:
|
|
126
|
+
"""Returns the JSON representation of the actual instance"""
|
|
127
|
+
if self.actual_instance is None:
|
|
128
|
+
return "null"
|
|
129
|
+
|
|
130
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
131
|
+
if callable(to_json):
|
|
132
|
+
return self.actual_instance.to_json()
|
|
133
|
+
else:
|
|
134
|
+
return json.dumps(self.actual_instance)
|
|
135
|
+
|
|
136
|
+
def to_dict(self) -> dict:
|
|
137
|
+
"""Returns the dict representation of the actual instance"""
|
|
138
|
+
if self.actual_instance is None:
|
|
139
|
+
return "null"
|
|
140
|
+
|
|
141
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
142
|
+
if callable(to_json):
|
|
143
|
+
return self.actual_instance.to_dict()
|
|
144
|
+
else:
|
|
145
|
+
# primitive type
|
|
146
|
+
return self.actual_instance
|
|
147
|
+
|
|
148
|
+
def to_str(self) -> str:
|
|
149
|
+
"""Returns the string representation of the actual instance"""
|
|
150
|
+
return pprint.pformat(self.dict())
|
|
@@ -0,0 +1,74 @@
|
|
|
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.artifact_type import ArtifactType
|
|
21
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class CreateArtifactRequestDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
CreateArtifactRequestDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
experiment_id: StrictStr = Field(...)
|
|
30
|
+
name: StrictStr = Field(...)
|
|
31
|
+
artifact_type: ArtifactType = Field(...)
|
|
32
|
+
__properties = ["experiment_id", "name", "artifact_type"]
|
|
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) -> CreateArtifactRequestDto:
|
|
50
|
+
"""Create an instance of CreateArtifactRequestDto 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
|
+
return _dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls, obj: dict) -> CreateArtifactRequestDto:
|
|
60
|
+
"""Create an instance of CreateArtifactRequestDto from a dict"""
|
|
61
|
+
if obj is None:
|
|
62
|
+
return None
|
|
63
|
+
|
|
64
|
+
if not isinstance(obj, dict):
|
|
65
|
+
return CreateArtifactRequestDto.parse_obj(obj)
|
|
66
|
+
|
|
67
|
+
_obj = CreateArtifactRequestDto.parse_obj(
|
|
68
|
+
{
|
|
69
|
+
"experiment_id": obj.get("experiment_id"),
|
|
70
|
+
"name": obj.get("name"),
|
|
71
|
+
"artifact_type": obj.get("artifact_type"),
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
return _obj
|
|
@@ -0,0 +1,65 @@
|
|
|
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.pydantic_v1 import BaseModel, Field, StrictStr
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class CreateArtifactResponseDto(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
CreateArtifactResponseDto
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
id: StrictStr = Field(...)
|
|
29
|
+
__properties = ["id"]
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
"""Pydantic configuration"""
|
|
33
|
+
|
|
34
|
+
allow_population_by_field_name = True
|
|
35
|
+
validate_assignment = True
|
|
36
|
+
|
|
37
|
+
def to_str(self) -> str:
|
|
38
|
+
"""Returns the string representation of the model using alias"""
|
|
39
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
40
|
+
|
|
41
|
+
def to_json(self) -> str:
|
|
42
|
+
"""Returns the JSON representation of the model using alias"""
|
|
43
|
+
return json.dumps(self.to_dict())
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_json(cls, json_str: str) -> CreateArtifactResponseDto:
|
|
47
|
+
"""Create an instance of CreateArtifactResponseDto from a JSON string"""
|
|
48
|
+
return cls.from_dict(json.loads(json_str))
|
|
49
|
+
|
|
50
|
+
def to_dict(self):
|
|
51
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
52
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
53
|
+
return _dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls, obj: dict) -> CreateArtifactResponseDto:
|
|
57
|
+
"""Create an instance of CreateArtifactResponseDto from a dict"""
|
|
58
|
+
if obj is None:
|
|
59
|
+
return None
|
|
60
|
+
|
|
61
|
+
if not isinstance(obj, dict):
|
|
62
|
+
return CreateArtifactResponseDto.parse_obj(obj)
|
|
63
|
+
|
|
64
|
+
_obj = CreateArtifactResponseDto.parse_obj({"id": obj.get("id")})
|
|
65
|
+
return _obj
|
|
@@ -0,0 +1,74 @@
|
|
|
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.artifact_type import ArtifactType
|
|
21
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictInt, StrictStr
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class CreateArtifactVersionRequestDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
CreateArtifactVersionRequestDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
experiment_id: StrictInt = Field(...)
|
|
30
|
+
name: StrictStr = Field(...)
|
|
31
|
+
artifact_type: ArtifactType = Field(...)
|
|
32
|
+
__properties = ["experiment_id", "name", "artifact_type"]
|
|
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) -> CreateArtifactVersionRequestDto:
|
|
50
|
+
"""Create an instance of CreateArtifactVersionRequestDto 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
|
+
return _dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls, obj: dict) -> CreateArtifactVersionRequestDto:
|
|
60
|
+
"""Create an instance of CreateArtifactVersionRequestDto from a dict"""
|
|
61
|
+
if obj is None:
|
|
62
|
+
return None
|
|
63
|
+
|
|
64
|
+
if not isinstance(obj, dict):
|
|
65
|
+
return CreateArtifactVersionRequestDto.parse_obj(obj)
|
|
66
|
+
|
|
67
|
+
_obj = CreateArtifactVersionRequestDto.parse_obj(
|
|
68
|
+
{
|
|
69
|
+
"experiment_id": obj.get("experiment_id"),
|
|
70
|
+
"name": obj.get("name"),
|
|
71
|
+
"artifact_type": obj.get("artifact_type"),
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
return _obj
|