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,75 @@
|
|
|
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.model_version_dto import ModelVersionDto
|
|
21
|
+
from truefoundry.pydantic_v1 import BaseModel, Field
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ModelVersionResponseDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
ModelVersionResponseDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
model_version: ModelVersionDto = Field(...)
|
|
30
|
+
__properties = ["model_version"]
|
|
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) -> ModelVersionResponseDto:
|
|
48
|
+
"""Create an instance of ModelVersionResponseDto 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 model_version
|
|
55
|
+
if self.model_version:
|
|
56
|
+
_dict["model_version"] = self.model_version.to_dict()
|
|
57
|
+
return _dict
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_dict(cls, obj: dict) -> ModelVersionResponseDto:
|
|
61
|
+
"""Create an instance of ModelVersionResponseDto from a dict"""
|
|
62
|
+
if obj is None:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
if not isinstance(obj, dict):
|
|
66
|
+
return ModelVersionResponseDto.parse_obj(obj)
|
|
67
|
+
|
|
68
|
+
_obj = ModelVersionResponseDto.parse_obj(
|
|
69
|
+
{
|
|
70
|
+
"model_version": ModelVersionDto.from_dict(obj.get("model_version"))
|
|
71
|
+
if obj.get("model_version") is not None
|
|
72
|
+
else None
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
return _obj
|
|
@@ -0,0 +1,107 @@
|
|
|
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.multi_part_upload_storage_provider import (
|
|
22
|
+
MultiPartUploadStorageProvider,
|
|
23
|
+
)
|
|
24
|
+
from truefoundry.ml.autogen.client.models.signed_url_dto import SignedURLDto
|
|
25
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, conlist
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class MultiPartUploadDto(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
MultiPartUploadDto
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
storage_provider: MultiPartUploadStorageProvider = Field(...)
|
|
34
|
+
part_signed_urls: conlist(SignedURLDto) = Field(...)
|
|
35
|
+
s3_compatible_upload_id: Optional[StrictStr] = None
|
|
36
|
+
azure_blob_block_ids: Optional[conlist(StrictStr)] = None
|
|
37
|
+
finalize_signed_url: SignedURLDto = Field(...)
|
|
38
|
+
__properties = [
|
|
39
|
+
"storage_provider",
|
|
40
|
+
"part_signed_urls",
|
|
41
|
+
"s3_compatible_upload_id",
|
|
42
|
+
"azure_blob_block_ids",
|
|
43
|
+
"finalize_signed_url",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
class Config:
|
|
47
|
+
"""Pydantic configuration"""
|
|
48
|
+
|
|
49
|
+
allow_population_by_field_name = True
|
|
50
|
+
validate_assignment = True
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
return json.dumps(self.to_dict())
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> MultiPartUploadDto:
|
|
62
|
+
"""Create an instance of MultiPartUploadDto from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self):
|
|
66
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
67
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
68
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in part_signed_urls (list)
|
|
69
|
+
_items = []
|
|
70
|
+
if self.part_signed_urls:
|
|
71
|
+
for _item in self.part_signed_urls:
|
|
72
|
+
if _item:
|
|
73
|
+
_items.append(_item.to_dict())
|
|
74
|
+
_dict["part_signed_urls"] = _items
|
|
75
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of finalize_signed_url
|
|
76
|
+
if self.finalize_signed_url:
|
|
77
|
+
_dict["finalize_signed_url"] = self.finalize_signed_url.to_dict()
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: dict) -> MultiPartUploadDto:
|
|
82
|
+
"""Create an instance of MultiPartUploadDto from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return MultiPartUploadDto.parse_obj(obj)
|
|
88
|
+
|
|
89
|
+
_obj = MultiPartUploadDto.parse_obj(
|
|
90
|
+
{
|
|
91
|
+
"storage_provider": obj.get("storage_provider"),
|
|
92
|
+
"part_signed_urls": [
|
|
93
|
+
SignedURLDto.from_dict(_item)
|
|
94
|
+
for _item in obj.get("part_signed_urls")
|
|
95
|
+
]
|
|
96
|
+
if obj.get("part_signed_urls") is not None
|
|
97
|
+
else None,
|
|
98
|
+
"s3_compatible_upload_id": obj.get("s3_compatible_upload_id"),
|
|
99
|
+
"azure_blob_block_ids": obj.get("azure_blob_block_ids"),
|
|
100
|
+
"finalize_signed_url": SignedURLDto.from_dict(
|
|
101
|
+
obj.get("finalize_signed_url")
|
|
102
|
+
)
|
|
103
|
+
if obj.get("finalize_signed_url") is not None
|
|
104
|
+
else None,
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
return _obj
|
|
@@ -0,0 +1,79 @@
|
|
|
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.multi_part_upload_dto import (
|
|
21
|
+
MultiPartUploadDto,
|
|
22
|
+
)
|
|
23
|
+
from truefoundry.pydantic_v1 import BaseModel, Field
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MultiPartUploadResponseDto(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
MultiPartUploadResponseDto
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
multipart_upload: MultiPartUploadDto = Field(...)
|
|
32
|
+
__properties = ["multipart_upload"]
|
|
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) -> MultiPartUploadResponseDto:
|
|
50
|
+
"""Create an instance of MultiPartUploadResponseDto 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 multipart_upload
|
|
57
|
+
if self.multipart_upload:
|
|
58
|
+
_dict["multipart_upload"] = self.multipart_upload.to_dict()
|
|
59
|
+
return _dict
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_dict(cls, obj: dict) -> MultiPartUploadResponseDto:
|
|
63
|
+
"""Create an instance of MultiPartUploadResponseDto from a dict"""
|
|
64
|
+
if obj is None:
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
if not isinstance(obj, dict):
|
|
68
|
+
return MultiPartUploadResponseDto.parse_obj(obj)
|
|
69
|
+
|
|
70
|
+
_obj = MultiPartUploadResponseDto.parse_obj(
|
|
71
|
+
{
|
|
72
|
+
"multipart_upload": MultiPartUploadDto.from_dict(
|
|
73
|
+
obj.get("multipart_upload")
|
|
74
|
+
)
|
|
75
|
+
if obj.get("multipart_upload") is not None
|
|
76
|
+
else None
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
return _obj
|
|
@@ -0,0 +1,34 @@
|
|
|
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 MultiPartUploadStorageProvider(str, Enum):
|
|
21
|
+
"""
|
|
22
|
+
An enumeration.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
allowed enum values
|
|
27
|
+
"""
|
|
28
|
+
S3_COMPATIBLE = "S3_COMPATIBLE"
|
|
29
|
+
AZURE_BLOB = "AZURE_BLOB"
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def from_json(cls, json_str: str) -> MultiPartUploadStorageProvider:
|
|
33
|
+
"""Create an instance of MultiPartUploadStorageProvider from a JSON string"""
|
|
34
|
+
return MultiPartUploadStorageProvider(json.loads(json_str))
|
|
@@ -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 NotifyArtifactVersionFailureDto(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
NotifyArtifactVersionFailureDto
|
|
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) -> NotifyArtifactVersionFailureDto:
|
|
47
|
+
"""Create an instance of NotifyArtifactVersionFailureDto 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) -> NotifyArtifactVersionFailureDto:
|
|
57
|
+
"""Create an instance of NotifyArtifactVersionFailureDto from a dict"""
|
|
58
|
+
if obj is None:
|
|
59
|
+
return None
|
|
60
|
+
|
|
61
|
+
if not isinstance(obj, dict):
|
|
62
|
+
return NotifyArtifactVersionFailureDto.parse_obj(obj)
|
|
63
|
+
|
|
64
|
+
_obj = NotifyArtifactVersionFailureDto.parse_obj({"id": obj.get("id")})
|
|
65
|
+
return _obj
|
|
@@ -0,0 +1,152 @@
|
|
|
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, Dict, 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
|
+
validator,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
OPENAPISPEC_ANY_OF_SCHEMAS = ["BlobStorageReference", "object"]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class OpenapiSpec(BaseModel):
|
|
35
|
+
"""
|
|
36
|
+
+sort=20 +uiType=OpenapiSchema
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
# data type: BlobStorageReference
|
|
40
|
+
anyof_schema_1_validator: Optional[BlobStorageReference] = None
|
|
41
|
+
# data type: object
|
|
42
|
+
anyof_schema_2_validator: Optional[Dict[str, Any]] = None
|
|
43
|
+
if TYPE_CHECKING:
|
|
44
|
+
actual_instance: Union[BlobStorageReference, object]
|
|
45
|
+
else:
|
|
46
|
+
actual_instance: Any
|
|
47
|
+
any_of_schemas: List[str] = Field(OPENAPISPEC_ANY_OF_SCHEMAS, const=True)
|
|
48
|
+
|
|
49
|
+
class Config:
|
|
50
|
+
validate_assignment = True
|
|
51
|
+
|
|
52
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
53
|
+
if args:
|
|
54
|
+
if len(args) > 1:
|
|
55
|
+
raise ValueError(
|
|
56
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
57
|
+
)
|
|
58
|
+
if kwargs:
|
|
59
|
+
raise ValueError(
|
|
60
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
61
|
+
)
|
|
62
|
+
super().__init__(actual_instance=args[0])
|
|
63
|
+
else:
|
|
64
|
+
super().__init__(**kwargs)
|
|
65
|
+
|
|
66
|
+
@validator("actual_instance")
|
|
67
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
68
|
+
instance = OpenapiSpec.construct()
|
|
69
|
+
error_messages = []
|
|
70
|
+
# validate data type: BlobStorageReference
|
|
71
|
+
if not isinstance(v, BlobStorageReference):
|
|
72
|
+
error_messages.append(
|
|
73
|
+
f"Error! Input type `{type(v)}` is not `BlobStorageReference`"
|
|
74
|
+
)
|
|
75
|
+
else:
|
|
76
|
+
return v
|
|
77
|
+
|
|
78
|
+
# validate data type: object
|
|
79
|
+
try:
|
|
80
|
+
instance.anyof_schema_2_validator = v
|
|
81
|
+
return v
|
|
82
|
+
except (ValidationError, ValueError) as e:
|
|
83
|
+
error_messages.append(str(e))
|
|
84
|
+
if error_messages:
|
|
85
|
+
# no match
|
|
86
|
+
raise ValueError(
|
|
87
|
+
"No match found when setting the actual_instance in OpenapiSpec with anyOf schemas: BlobStorageReference, object. Details: "
|
|
88
|
+
+ ", ".join(error_messages)
|
|
89
|
+
)
|
|
90
|
+
else:
|
|
91
|
+
return v
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: dict) -> OpenapiSpec:
|
|
95
|
+
return cls.from_json(json.dumps(obj))
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_json(cls, json_str: str) -> OpenapiSpec:
|
|
99
|
+
"""Returns the object represented by the json string"""
|
|
100
|
+
instance = OpenapiSpec.construct()
|
|
101
|
+
error_messages = []
|
|
102
|
+
# anyof_schema_1_validator: Optional[BlobStorageReference] = None
|
|
103
|
+
try:
|
|
104
|
+
instance.actual_instance = BlobStorageReference.from_json(json_str)
|
|
105
|
+
return instance
|
|
106
|
+
except (ValidationError, ValueError) as e:
|
|
107
|
+
error_messages.append(str(e))
|
|
108
|
+
# deserialize data into object
|
|
109
|
+
try:
|
|
110
|
+
# validation
|
|
111
|
+
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
112
|
+
# assign value to actual_instance
|
|
113
|
+
instance.actual_instance = instance.anyof_schema_2_validator
|
|
114
|
+
return instance
|
|
115
|
+
except (ValidationError, ValueError) as e:
|
|
116
|
+
error_messages.append(str(e))
|
|
117
|
+
|
|
118
|
+
if error_messages:
|
|
119
|
+
# no match
|
|
120
|
+
raise ValueError(
|
|
121
|
+
"No match found when deserializing the JSON string into OpenapiSpec with anyOf schemas: BlobStorageReference, object. Details: "
|
|
122
|
+
+ ", ".join(error_messages)
|
|
123
|
+
)
|
|
124
|
+
else:
|
|
125
|
+
return instance
|
|
126
|
+
|
|
127
|
+
def to_json(self) -> str:
|
|
128
|
+
"""Returns the JSON representation of the actual instance"""
|
|
129
|
+
if self.actual_instance is None:
|
|
130
|
+
return "null"
|
|
131
|
+
|
|
132
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
133
|
+
if callable(to_json):
|
|
134
|
+
return self.actual_instance.to_json()
|
|
135
|
+
else:
|
|
136
|
+
return json.dumps(self.actual_instance)
|
|
137
|
+
|
|
138
|
+
def to_dict(self) -> dict:
|
|
139
|
+
"""Returns the dict representation of the actual instance"""
|
|
140
|
+
if self.actual_instance is None:
|
|
141
|
+
return "null"
|
|
142
|
+
|
|
143
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
144
|
+
if callable(to_json):
|
|
145
|
+
return self.actual_instance.to_dict()
|
|
146
|
+
else:
|
|
147
|
+
# primitive type
|
|
148
|
+
return self.actual_instance
|
|
149
|
+
|
|
150
|
+
def to_str(self) -> str:
|
|
151
|
+
"""Returns the string representation of the actual instance"""
|
|
152
|
+
return pprint.pformat(self.dict())
|
|
@@ -0,0 +1,66 @@
|
|
|
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 ParamDto(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
ParamDto
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
key: StrictStr = Field(...)
|
|
29
|
+
value: StrictStr = Field(...)
|
|
30
|
+
__properties = ["key", "value"]
|
|
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) -> ParamDto:
|
|
48
|
+
"""Create an instance of ParamDto 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
|
+
return _dict
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls, obj: dict) -> ParamDto:
|
|
58
|
+
"""Create an instance of ParamDto from a dict"""
|
|
59
|
+
if obj is None:
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
if not isinstance(obj, dict):
|
|
63
|
+
return ParamDto.parse_obj(obj)
|
|
64
|
+
|
|
65
|
+
_obj = ParamDto.parse_obj({"key": obj.get("key"), "value": obj.get("value")})
|
|
66
|
+
return _obj
|
|
@@ -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, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.stop import Stop
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, StrictFloat, StrictInt
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Parameters(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
+usage=Parameters for the provider +label=Parameters +docs=Key-value pairs to store additional parameters for the provider # noqa: E501
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
max_tokens: Optional[StrictInt] = None
|
|
31
|
+
temperature: Optional[Union[StrictFloat, StrictInt]] = None
|
|
32
|
+
top_k: Optional[Union[StrictFloat, StrictInt]] = None
|
|
33
|
+
top_p: Optional[Union[StrictFloat, StrictInt]] = None
|
|
34
|
+
stop: Optional[Stop] = None
|
|
35
|
+
__properties = ["max_tokens", "temperature", "top_k", "top_p", "stop"]
|
|
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) -> Parameters:
|
|
53
|
+
"""Create an instance of Parameters 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
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of stop
|
|
60
|
+
if self.stop:
|
|
61
|
+
_dict["stop"] = self.stop.to_dict()
|
|
62
|
+
return _dict
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dict(cls, obj: dict) -> Parameters:
|
|
66
|
+
"""Create an instance of Parameters from a dict"""
|
|
67
|
+
if obj is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
if not isinstance(obj, dict):
|
|
71
|
+
return Parameters.parse_obj(obj)
|
|
72
|
+
|
|
73
|
+
_obj = Parameters.parse_obj(
|
|
74
|
+
{
|
|
75
|
+
"max_tokens": obj.get("max_tokens"),
|
|
76
|
+
"temperature": obj.get("temperature"),
|
|
77
|
+
"top_k": obj.get("top_k"),
|
|
78
|
+
"top_p": obj.get("top_p"),
|
|
79
|
+
"stop": Stop.from_dict(obj.get("stop"))
|
|
80
|
+
if obj.get("stop") is not None
|
|
81
|
+
else None,
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
return _obj
|