truefoundry 0.3.2__py3-none-any.whl → 0.4.0.dev0__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/auto_gen/models.py +29 -1
- truefoundry/deploy/cli/cli.py +1 -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/{python_deploy_codegen.py → deploy/python_deploy_codegen.py} +1 -0
- 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.2.dist-info → truefoundry-0.4.0.dev0.dist-info}/METADATA +19 -12
- truefoundry-0.4.0.dev0.dist-info/RECORD +342 -0
- truefoundry-0.3.2.dist-info/RECORD +0 -136
- {truefoundry-0.3.2.dist-info → truefoundry-0.4.0.dev0.dist-info}/WHEEL +0 -0
- {truefoundry-0.3.2.dist-info → truefoundry-0.4.0.dev0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
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 Any, Dict, Optional
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.model_schema_dto import ModelSchemaDto
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictBool, StrictStr
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UpdateModelVersionRequestDto(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
UpdateModelVersionRequestDto
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
id: StrictStr = Field(...)
|
|
31
|
+
description: Optional[StrictStr] = None
|
|
32
|
+
artifact_metadata: Optional[Dict[str, Any]] = None
|
|
33
|
+
model_schema: Optional[ModelSchemaDto] = None
|
|
34
|
+
monitoring_enabled: Optional[StrictBool] = None
|
|
35
|
+
model_framework: Optional[StrictStr] = None
|
|
36
|
+
__properties = [
|
|
37
|
+
"id",
|
|
38
|
+
"description",
|
|
39
|
+
"artifact_metadata",
|
|
40
|
+
"model_schema",
|
|
41
|
+
"monitoring_enabled",
|
|
42
|
+
"model_framework",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
class Config:
|
|
46
|
+
"""Pydantic configuration"""
|
|
47
|
+
|
|
48
|
+
allow_population_by_field_name = True
|
|
49
|
+
validate_assignment = True
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> UpdateModelVersionRequestDto:
|
|
61
|
+
"""Create an instance of UpdateModelVersionRequestDto from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self):
|
|
65
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
66
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
67
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
|
|
68
|
+
if self.model_schema:
|
|
69
|
+
_dict["model_schema"] = self.model_schema.to_dict()
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: dict) -> UpdateModelVersionRequestDto:
|
|
74
|
+
"""Create an instance of UpdateModelVersionRequestDto from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return UpdateModelVersionRequestDto.parse_obj(obj)
|
|
80
|
+
|
|
81
|
+
_obj = UpdateModelVersionRequestDto.parse_obj(
|
|
82
|
+
{
|
|
83
|
+
"id": obj.get("id"),
|
|
84
|
+
"description": obj.get("description"),
|
|
85
|
+
"artifact_metadata": obj.get("artifact_metadata"),
|
|
86
|
+
"model_schema": ModelSchemaDto.from_dict(obj.get("model_schema"))
|
|
87
|
+
if obj.get("model_schema") is not None
|
|
88
|
+
else None,
|
|
89
|
+
"monitoring_enabled": obj.get("monitoring_enabled"),
|
|
90
|
+
"model_framework": obj.get("model_framework"),
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
return _obj
|
|
@@ -0,0 +1,78 @@
|
|
|
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, StrictInt, StrictStr
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class UpdateRunRequestDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
UpdateRunRequestDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
run_id: Optional[StrictStr] = None
|
|
30
|
+
run_uuid: Optional[StrictStr] = None
|
|
31
|
+
status: Optional[StrictStr] = None
|
|
32
|
+
end_time: Optional[StrictInt] = None
|
|
33
|
+
description: Optional[StrictStr] = None
|
|
34
|
+
__properties = ["run_id", "run_uuid", "status", "end_time", "description"]
|
|
35
|
+
|
|
36
|
+
class Config:
|
|
37
|
+
"""Pydantic configuration"""
|
|
38
|
+
|
|
39
|
+
allow_population_by_field_name = True
|
|
40
|
+
validate_assignment = True
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> UpdateRunRequestDto:
|
|
52
|
+
"""Create an instance of UpdateRunRequestDto from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self):
|
|
56
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
57
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
58
|
+
return _dict
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_dict(cls, obj: dict) -> UpdateRunRequestDto:
|
|
62
|
+
"""Create an instance of UpdateRunRequestDto from a dict"""
|
|
63
|
+
if obj is None:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
if not isinstance(obj, dict):
|
|
67
|
+
return UpdateRunRequestDto.parse_obj(obj)
|
|
68
|
+
|
|
69
|
+
_obj = UpdateRunRequestDto.parse_obj(
|
|
70
|
+
{
|
|
71
|
+
"run_id": obj.get("run_id"),
|
|
72
|
+
"run_uuid": obj.get("run_uuid"),
|
|
73
|
+
"status": obj.get("status"),
|
|
74
|
+
"end_time": obj.get("end_time"),
|
|
75
|
+
"description": obj.get("description"),
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
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.ml.autogen.client.models.run_info_dto import RunInfoDto
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UpdateRunResponseDto(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
UpdateRunResponseDto
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
run_info: Optional[RunInfoDto] = None
|
|
31
|
+
__properties = ["run_info"]
|
|
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) -> UpdateRunResponseDto:
|
|
49
|
+
"""Create an instance of UpdateRunResponseDto 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 run_info
|
|
56
|
+
if self.run_info:
|
|
57
|
+
_dict["run_info"] = self.run_info.to_dict()
|
|
58
|
+
return _dict
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_dict(cls, obj: dict) -> UpdateRunResponseDto:
|
|
62
|
+
"""Create an instance of UpdateRunResponseDto from a dict"""
|
|
63
|
+
if obj is None:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
if not isinstance(obj, dict):
|
|
67
|
+
return UpdateRunResponseDto.parse_obj(obj)
|
|
68
|
+
|
|
69
|
+
_obj = UpdateRunResponseDto.parse_obj(
|
|
70
|
+
{
|
|
71
|
+
"run_info": RunInfoDto.from_dict(obj.get("run_info"))
|
|
72
|
+
if obj.get("run_info") is not None
|
|
73
|
+
else None
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
return _obj
|
|
@@ -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
|
+
URL_ANY_OF_SCHEMAS = ["BlobStorageReference", "str"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Url(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
+label=URL for the image +usage=The URL for the image, must be a non-empty valid HTTPS URL or a data URL
|
|
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(URL_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 = Url.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 Url 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) -> Url:
|
|
96
|
+
return cls.from_json(json.dumps(obj))
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_json(cls, json_str: str) -> Url:
|
|
100
|
+
"""Returns the object represented by the json string"""
|
|
101
|
+
instance = Url.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 Url 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,89 @@
|
|
|
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.content2 import Content2
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UserMessage(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
+usage=User message +docs=Defines the structure of a user message, including role and content +label=User Message # noqa: E501
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
role: StrictStr = Field(...)
|
|
31
|
+
content: Content2 = Field(...)
|
|
32
|
+
name: Optional[StrictStr] = Field(
|
|
33
|
+
default=None, description="+label=Name +usage=Name of the user message"
|
|
34
|
+
)
|
|
35
|
+
__properties = ["role", "content", "name"]
|
|
36
|
+
|
|
37
|
+
@validator("role")
|
|
38
|
+
def role_validate_enum(cls, value):
|
|
39
|
+
"""Validates the enum"""
|
|
40
|
+
if value not in ("user"):
|
|
41
|
+
raise ValueError("must be one of enum values ('user')")
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
class Config:
|
|
45
|
+
"""Pydantic configuration"""
|
|
46
|
+
|
|
47
|
+
allow_population_by_field_name = True
|
|
48
|
+
validate_assignment = True
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> UserMessage:
|
|
60
|
+
"""Create an instance of UserMessage from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self):
|
|
64
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
65
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
66
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of content
|
|
67
|
+
if self.content:
|
|
68
|
+
_dict["content"] = self.content.to_dict()
|
|
69
|
+
return _dict
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, obj: dict) -> UserMessage:
|
|
73
|
+
"""Create an instance of UserMessage from a dict"""
|
|
74
|
+
if obj is None:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
if not isinstance(obj, dict):
|
|
78
|
+
return UserMessage.parse_obj(obj)
|
|
79
|
+
|
|
80
|
+
_obj = UserMessage.parse_obj(
|
|
81
|
+
{
|
|
82
|
+
"role": obj.get("role"),
|
|
83
|
+
"content": Content2.from_dict(obj.get("content"))
|
|
84
|
+
if obj.get("content") is not None
|
|
85
|
+
else None,
|
|
86
|
+
"name": obj.get("name"),
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
return _obj
|
|
@@ -0,0 +1,87 @@
|
|
|
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.validation_error_loc_inner import (
|
|
21
|
+
ValidationErrorLocInner,
|
|
22
|
+
)
|
|
23
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, conlist
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ValidationError(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ValidationError
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
loc: conlist(ValidationErrorLocInner) = Field(...)
|
|
32
|
+
msg: StrictStr = Field(...)
|
|
33
|
+
type: StrictStr = Field(...)
|
|
34
|
+
__properties = ["loc", "msg", "type"]
|
|
35
|
+
|
|
36
|
+
class Config:
|
|
37
|
+
"""Pydantic configuration"""
|
|
38
|
+
|
|
39
|
+
allow_population_by_field_name = True
|
|
40
|
+
validate_assignment = True
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> ValidationError:
|
|
52
|
+
"""Create an instance of ValidationError from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self):
|
|
56
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
57
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
58
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in loc (list)
|
|
59
|
+
_items = []
|
|
60
|
+
if self.loc:
|
|
61
|
+
for _item in self.loc:
|
|
62
|
+
if _item:
|
|
63
|
+
_items.append(_item.to_dict())
|
|
64
|
+
_dict["loc"] = _items
|
|
65
|
+
return _dict
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_dict(cls, obj: dict) -> ValidationError:
|
|
69
|
+
"""Create an instance of ValidationError from a dict"""
|
|
70
|
+
if obj is None:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
if not isinstance(obj, dict):
|
|
74
|
+
return ValidationError.parse_obj(obj)
|
|
75
|
+
|
|
76
|
+
_obj = ValidationError.parse_obj(
|
|
77
|
+
{
|
|
78
|
+
"loc": [
|
|
79
|
+
ValidationErrorLocInner.from_dict(_item) for _item in obj.get("loc")
|
|
80
|
+
]
|
|
81
|
+
if obj.get("loc") is not None
|
|
82
|
+
else None,
|
|
83
|
+
"msg": obj.get("msg"),
|
|
84
|
+
"type": obj.get("type"),
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
return _obj
|