truefoundry 0.3.3__py3-none-any.whl → 0.4.0.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of truefoundry might be problematic. Click here for more details.

Files changed (225) hide show
  1. truefoundry/cli/__main__.py +3 -17
  2. truefoundry/common/__init__.py +0 -0
  3. truefoundry/common/request_utils.py +56 -0
  4. truefoundry/deploy/cli/cli.py +1 -1
  5. truefoundry/deploy/cli/util.py +3 -1
  6. truefoundry/deploy/lib/auth/credential_provider.py +2 -12
  7. truefoundry/deploy/lib/clients/servicefoundry_client.py +0 -9
  8. truefoundry/deploy/lib/exceptions.py +1 -6
  9. truefoundry/deploy/lib/session.py +1 -16
  10. truefoundry/langchain/truefoundry_chat.py +1 -1
  11. truefoundry/langchain/truefoundry_embeddings.py +1 -1
  12. truefoundry/langchain/truefoundry_llm.py +1 -1
  13. truefoundry/langchain/utils.py +0 -41
  14. truefoundry/ml/__init__.py +46 -6
  15. truefoundry/ml/artifact/__init__.py +0 -0
  16. truefoundry/ml/artifact/truefoundry_artifact_repo.py +1120 -0
  17. truefoundry/ml/autogen/__init__.py +0 -0
  18. truefoundry/ml/autogen/client/__init__.py +373 -0
  19. truefoundry/ml/autogen/client/api/__init__.py +16 -0
  20. truefoundry/ml/autogen/client/api/auth_api.py +184 -0
  21. truefoundry/ml/autogen/client/api/deprecated_api.py +605 -0
  22. truefoundry/ml/autogen/client/api/experiments_api.py +2109 -0
  23. truefoundry/ml/autogen/client/api/health_api.py +299 -0
  24. truefoundry/ml/autogen/client/api/metrics_api.py +371 -0
  25. truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +7213 -0
  26. truefoundry/ml/autogen/client/api/python_deployment_config_api.py +201 -0
  27. truefoundry/ml/autogen/client/api/run_artifacts_api.py +231 -0
  28. truefoundry/ml/autogen/client/api/runs_api.py +2919 -0
  29. truefoundry/ml/autogen/client/api_client.py +822 -0
  30. truefoundry/ml/autogen/client/api_response.py +30 -0
  31. truefoundry/ml/autogen/client/configuration.py +489 -0
  32. truefoundry/ml/autogen/client/exceptions.py +161 -0
  33. truefoundry/ml/autogen/client/models/__init__.py +344 -0
  34. truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py +69 -0
  35. truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +83 -0
  36. truefoundry/ml/autogen/client/models/agent.py +125 -0
  37. truefoundry/ml/autogen/client/models/agent_app.py +118 -0
  38. truefoundry/ml/autogen/client/models/agent_open_api_tool.py +143 -0
  39. truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +144 -0
  40. truefoundry/ml/autogen/client/models/agent_with_fqn.py +127 -0
  41. truefoundry/ml/autogen/client/models/artifact_dto.py +115 -0
  42. truefoundry/ml/autogen/client/models/artifact_response_dto.py +75 -0
  43. truefoundry/ml/autogen/client/models/artifact_type.py +39 -0
  44. truefoundry/ml/autogen/client/models/artifact_version_dto.py +141 -0
  45. truefoundry/ml/autogen/client/models/artifact_version_response_dto.py +77 -0
  46. truefoundry/ml/autogen/client/models/artifact_version_status.py +35 -0
  47. truefoundry/ml/autogen/client/models/assistant_message.py +89 -0
  48. truefoundry/ml/autogen/client/models/authorize_user_for_model_request_dto.py +69 -0
  49. truefoundry/ml/autogen/client/models/authorize_user_for_model_version_request_dto.py +69 -0
  50. truefoundry/ml/autogen/client/models/backfill_default_storage_integration_id_request_dto.py +67 -0
  51. truefoundry/ml/autogen/client/models/blob_storage_reference.py +93 -0
  52. truefoundry/ml/autogen/client/models/body_get_search_runs_get.py +72 -0
  53. truefoundry/ml/autogen/client/models/chat_prompt.py +156 -0
  54. truefoundry/ml/autogen/client/models/chat_prompt_messages_inner.py +171 -0
  55. truefoundry/ml/autogen/client/models/columns_dto.py +73 -0
  56. truefoundry/ml/autogen/client/models/content.py +153 -0
  57. truefoundry/ml/autogen/client/models/content1.py +153 -0
  58. truefoundry/ml/autogen/client/models/content2.py +174 -0
  59. truefoundry/ml/autogen/client/models/content2_any_of_inner.py +150 -0
  60. truefoundry/ml/autogen/client/models/create_artifact_request_dto.py +74 -0
  61. truefoundry/ml/autogen/client/models/create_artifact_response_dto.py +66 -0
  62. truefoundry/ml/autogen/client/models/create_artifact_version_request_dto.py +74 -0
  63. truefoundry/ml/autogen/client/models/create_artifact_version_response_dto.py +66 -0
  64. truefoundry/ml/autogen/client/models/create_dataset_request_dto.py +76 -0
  65. truefoundry/ml/autogen/client/models/create_experiment_request_dto.py +94 -0
  66. truefoundry/ml/autogen/client/models/create_experiment_response_dto.py +67 -0
  67. truefoundry/ml/autogen/client/models/create_model_version_request_dto.py +95 -0
  68. truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_request_dto.py +73 -0
  69. truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_response_dto.py +79 -0
  70. truefoundry/ml/autogen/client/models/create_multi_part_upload_request_dto.py +73 -0
  71. truefoundry/ml/autogen/client/models/create_python_deployment_config_request_dto.py +72 -0
  72. truefoundry/ml/autogen/client/models/create_python_deployment_config_response_dto.py +68 -0
  73. truefoundry/ml/autogen/client/models/create_run_request_dto.py +97 -0
  74. truefoundry/ml/autogen/client/models/create_run_response_dto.py +76 -0
  75. truefoundry/ml/autogen/client/models/dataset_dto.py +112 -0
  76. truefoundry/ml/autogen/client/models/dataset_response_dto.py +75 -0
  77. truefoundry/ml/autogen/client/models/delete_artifact_versions_request_dto.py +65 -0
  78. truefoundry/ml/autogen/client/models/delete_dataset_request_dto.py +74 -0
  79. truefoundry/ml/autogen/client/models/delete_model_version_request_dto.py +65 -0
  80. truefoundry/ml/autogen/client/models/delete_run_request.py +65 -0
  81. truefoundry/ml/autogen/client/models/delete_tag_request_dto.py +68 -0
  82. truefoundry/ml/autogen/client/models/experiment_dto.py +127 -0
  83. truefoundry/ml/autogen/client/models/experiment_id_request_dto.py +67 -0
  84. truefoundry/ml/autogen/client/models/experiment_response_dto.py +75 -0
  85. truefoundry/ml/autogen/client/models/experiment_tag_dto.py +69 -0
  86. truefoundry/ml/autogen/client/models/feature_dto.py +68 -0
  87. truefoundry/ml/autogen/client/models/feature_value_type.py +35 -0
  88. truefoundry/ml/autogen/client/models/file_info_dto.py +76 -0
  89. truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +101 -0
  90. truefoundry/ml/autogen/client/models/get_experiment_response_dto.py +88 -0
  91. truefoundry/ml/autogen/client/models/get_latest_run_log_response_dto.py +76 -0
  92. truefoundry/ml/autogen/client/models/get_metric_history_response.py +79 -0
  93. truefoundry/ml/autogen/client/models/get_signed_url_for_dataset_write_request_dto.py +68 -0
  94. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_request_dto.py +68 -0
  95. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_response_dto.py +81 -0
  96. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_request_dto.py +69 -0
  97. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_response_dto.py +83 -0
  98. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_request_dto.py +68 -0
  99. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_response_dto.py +81 -0
  100. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_write_response_dto.py +81 -0
  101. truefoundry/ml/autogen/client/models/get_tenant_id_response_dto.py +74 -0
  102. truefoundry/ml/autogen/client/models/http_validation_error.py +82 -0
  103. truefoundry/ml/autogen/client/models/image_content_part.py +87 -0
  104. truefoundry/ml/autogen/client/models/image_url.py +75 -0
  105. truefoundry/ml/autogen/client/models/internal_metadata.py +180 -0
  106. truefoundry/ml/autogen/client/models/latest_run_log_dto.py +78 -0
  107. truefoundry/ml/autogen/client/models/list_artifact_versions_request_dto.py +107 -0
  108. truefoundry/ml/autogen/client/models/list_artifact_versions_response_dto.py +87 -0
  109. truefoundry/ml/autogen/client/models/list_artifacts_request_dto.py +96 -0
  110. truefoundry/ml/autogen/client/models/list_artifacts_response_dto.py +86 -0
  111. truefoundry/ml/autogen/client/models/list_colums_response_dto.py +75 -0
  112. truefoundry/ml/autogen/client/models/list_datasets_request_dto.py +78 -0
  113. truefoundry/ml/autogen/client/models/list_datasets_response_dto.py +86 -0
  114. truefoundry/ml/autogen/client/models/list_experiments_response_dto.py +86 -0
  115. truefoundry/ml/autogen/client/models/list_files_for_artifact_version_request_dto.py +76 -0
  116. truefoundry/ml/autogen/client/models/list_files_for_artifact_versions_response_dto.py +82 -0
  117. truefoundry/ml/autogen/client/models/list_files_for_dataset_request_dto.py +76 -0
  118. truefoundry/ml/autogen/client/models/list_files_for_dataset_response_dto.py +82 -0
  119. truefoundry/ml/autogen/client/models/list_latest_run_logs_response_dto.py +82 -0
  120. truefoundry/ml/autogen/client/models/list_metric_history_request_dto.py +69 -0
  121. truefoundry/ml/autogen/client/models/list_metric_history_response_dto.py +84 -0
  122. truefoundry/ml/autogen/client/models/list_model_version_response_dto.py +87 -0
  123. truefoundry/ml/autogen/client/models/list_model_versions_request_dto.py +93 -0
  124. truefoundry/ml/autogen/client/models/list_models_request_dto.py +89 -0
  125. truefoundry/ml/autogen/client/models/list_models_response_dto.py +84 -0
  126. truefoundry/ml/autogen/client/models/list_run_artifacts_response_dto.py +84 -0
  127. truefoundry/ml/autogen/client/models/list_run_logs_response_dto.py +82 -0
  128. truefoundry/ml/autogen/client/models/list_seed_experiments_response_dto.py +81 -0
  129. truefoundry/ml/autogen/client/models/log_batch_request_dto.py +106 -0
  130. truefoundry/ml/autogen/client/models/log_metric_request_dto.py +80 -0
  131. truefoundry/ml/autogen/client/models/log_param_request_dto.py +76 -0
  132. truefoundry/ml/autogen/client/models/method.py +37 -0
  133. truefoundry/ml/autogen/client/models/metric_collection_dto.py +82 -0
  134. truefoundry/ml/autogen/client/models/metric_dto.py +76 -0
  135. truefoundry/ml/autogen/client/models/mime_type.py +37 -0
  136. truefoundry/ml/autogen/client/models/model_configuration.py +103 -0
  137. truefoundry/ml/autogen/client/models/model_dto.py +122 -0
  138. truefoundry/ml/autogen/client/models/model_response_dto.py +75 -0
  139. truefoundry/ml/autogen/client/models/model_schema_dto.py +85 -0
  140. truefoundry/ml/autogen/client/models/model_version_dto.py +163 -0
  141. truefoundry/ml/autogen/client/models/model_version_response_dto.py +75 -0
  142. truefoundry/ml/autogen/client/models/multi_part_upload_dto.py +107 -0
  143. truefoundry/ml/autogen/client/models/multi_part_upload_response_dto.py +79 -0
  144. truefoundry/ml/autogen/client/models/multi_part_upload_storage_provider.py +34 -0
  145. truefoundry/ml/autogen/client/models/notify_artifact_version_failure_dto.py +65 -0
  146. truefoundry/ml/autogen/client/models/openapi_spec.py +152 -0
  147. truefoundry/ml/autogen/client/models/param_dto.py +66 -0
  148. truefoundry/ml/autogen/client/models/parameters.py +84 -0
  149. truefoundry/ml/autogen/client/models/prediction_type.py +34 -0
  150. truefoundry/ml/autogen/client/models/resolve_agent_app_response_dto.py +75 -0
  151. truefoundry/ml/autogen/client/models/restore_run_request_dto.py +65 -0
  152. truefoundry/ml/autogen/client/models/run_data_dto.py +104 -0
  153. truefoundry/ml/autogen/client/models/run_dto.py +84 -0
  154. truefoundry/ml/autogen/client/models/run_info_dto.py +105 -0
  155. truefoundry/ml/autogen/client/models/run_log_dto.py +90 -0
  156. truefoundry/ml/autogen/client/models/run_log_input_dto.py +80 -0
  157. truefoundry/ml/autogen/client/models/run_response_dto.py +75 -0
  158. truefoundry/ml/autogen/client/models/run_tag_dto.py +66 -0
  159. truefoundry/ml/autogen/client/models/search_runs_request_dto.py +94 -0
  160. truefoundry/ml/autogen/client/models/search_runs_response_dto.py +84 -0
  161. truefoundry/ml/autogen/client/models/set_experiment_tag_request_dto.py +73 -0
  162. truefoundry/ml/autogen/client/models/set_tag_request_dto.py +76 -0
  163. truefoundry/ml/autogen/client/models/signed_url_dto.py +69 -0
  164. truefoundry/ml/autogen/client/models/stop.py +152 -0
  165. truefoundry/ml/autogen/client/models/store_run_logs_request_dto.py +83 -0
  166. truefoundry/ml/autogen/client/models/system_message.py +89 -0
  167. truefoundry/ml/autogen/client/models/text.py +153 -0
  168. truefoundry/ml/autogen/client/models/text_content_part.py +84 -0
  169. truefoundry/ml/autogen/client/models/update_artifact_version_request_dto.py +74 -0
  170. truefoundry/ml/autogen/client/models/update_dataset_request_dto.py +74 -0
  171. truefoundry/ml/autogen/client/models/update_experiment_request_dto.py +74 -0
  172. truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +93 -0
  173. truefoundry/ml/autogen/client/models/update_run_request_dto.py +78 -0
  174. truefoundry/ml/autogen/client/models/update_run_response_dto.py +76 -0
  175. truefoundry/ml/autogen/client/models/url.py +153 -0
  176. truefoundry/ml/autogen/client/models/user_message.py +89 -0
  177. truefoundry/ml/autogen/client/models/validation_error.py +87 -0
  178. truefoundry/ml/autogen/client/models/validation_error_loc_inner.py +154 -0
  179. truefoundry/ml/autogen/client/rest.py +426 -0
  180. truefoundry/ml/autogen/client_README.md +322 -0
  181. truefoundry/ml/cli/__init__.py +0 -0
  182. truefoundry/ml/cli/cli.py +18 -0
  183. truefoundry/ml/cli/commands/__init__.py +3 -0
  184. truefoundry/ml/cli/commands/download.py +87 -0
  185. truefoundry/ml/constants.py +84 -0
  186. truefoundry/ml/enums.py +70 -0
  187. truefoundry/ml/env_vars.py +13 -0
  188. truefoundry/ml/exceptions.py +8 -0
  189. truefoundry/ml/git_info.py +60 -0
  190. truefoundry/ml/internal_namespace.py +52 -0
  191. truefoundry/ml/log_types/__init__.py +4 -0
  192. truefoundry/ml/log_types/artifacts/artifact.py +427 -0
  193. truefoundry/ml/log_types/artifacts/constants.py +33 -0
  194. truefoundry/ml/log_types/artifacts/dataset.py +383 -0
  195. truefoundry/ml/log_types/artifacts/general_artifact.py +110 -0
  196. truefoundry/ml/log_types/artifacts/model.py +628 -0
  197. truefoundry/ml/log_types/artifacts/model_extras.py +48 -0
  198. truefoundry/ml/log_types/artifacts/utils.py +161 -0
  199. truefoundry/ml/log_types/image/__init__.py +3 -0
  200. truefoundry/ml/log_types/image/constants.py +8 -0
  201. truefoundry/ml/log_types/image/image.py +358 -0
  202. truefoundry/ml/log_types/image/image_normalizer.py +101 -0
  203. truefoundry/ml/log_types/image/types.py +68 -0
  204. truefoundry/ml/log_types/plot.py +281 -0
  205. truefoundry/ml/log_types/pydantic_base.py +10 -0
  206. truefoundry/ml/log_types/utils.py +12 -0
  207. truefoundry/ml/logger.py +17 -0
  208. truefoundry/ml/login.py +241 -0
  209. truefoundry/ml/mlfoundry_api.py +1620 -0
  210. truefoundry/ml/mlfoundry_run.py +1238 -0
  211. truefoundry/ml/run_utils.py +102 -0
  212. truefoundry/ml/services/__init__.py +0 -0
  213. truefoundry/ml/services/auth_service.py +109 -0
  214. truefoundry/ml/services/entities.py +108 -0
  215. truefoundry/ml/services/servicefoundry_service.py +35 -0
  216. truefoundry/ml/services/utils.py +122 -0
  217. truefoundry/ml/session.py +271 -0
  218. truefoundry/ml/validation_utils.py +346 -0
  219. truefoundry/pydantic_v1.py +5 -1
  220. {truefoundry-0.3.3.dist-info → truefoundry-0.4.0.dev1.dist-info}/METADATA +18 -11
  221. truefoundry-0.4.0.dev1.dist-info/RECORD +342 -0
  222. truefoundry-0.3.3.dist-info/RECORD +0 -136
  223. /truefoundry/{python_deploy_codegen.py → deploy/python_deploy_codegen.py} +0 -0
  224. {truefoundry-0.3.3.dist-info → truefoundry-0.4.0.dev1.dist-info}/WHEEL +0 -0
  225. {truefoundry-0.3.3.dist-info → truefoundry-0.4.0.dev1.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.url import Url
21
+ from truefoundry.pydantic_v1 import BaseModel, Field
22
+
23
+
24
+ class ImageUrl(BaseModel):
25
+ """
26
+ +label=URL for the image +usage=The URL for the image, must be a non-empty valid HTTPS URL or a data URL # noqa: E501
27
+ """
28
+
29
+ url: Url = Field(...)
30
+ __properties = ["url"]
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) -> ImageUrl:
48
+ """Create an instance of ImageUrl 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 url
55
+ if self.url:
56
+ _dict["url"] = self.url.to_dict()
57
+ return _dict
58
+
59
+ @classmethod
60
+ def from_dict(cls, obj: dict) -> ImageUrl:
61
+ """Create an instance of ImageUrl from a dict"""
62
+ if obj is None:
63
+ return None
64
+
65
+ if not isinstance(obj, dict):
66
+ return ImageUrl.parse_obj(obj)
67
+
68
+ _obj = ImageUrl.parse_obj(
69
+ {
70
+ "url": Url.from_dict(obj.get("url"))
71
+ if obj.get("url") is not None
72
+ else None
73
+ }
74
+ )
75
+ return _obj
@@ -0,0 +1,180 @@
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.agent import Agent
22
+ from truefoundry.ml.autogen.client.models.agent_open_api_tool import AgentOpenAPITool
23
+ from truefoundry.ml.autogen.client.models.chat_prompt import ChatPrompt
24
+ from truefoundry.pydantic_v1 import (
25
+ BaseModel,
26
+ Field,
27
+ ValidationError,
28
+ validator,
29
+ )
30
+
31
+ INTERNALMETADATA_ANY_OF_SCHEMAS = ["Agent", "AgentOpenAPITool", "ChatPrompt", "object"]
32
+
33
+
34
+ class InternalMetadata(BaseModel):
35
+ """
36
+ InternalMetadata
37
+ """
38
+
39
+ # data type: ChatPrompt
40
+ anyof_schema_1_validator: Optional[ChatPrompt] = None
41
+ # data type: AgentOpenAPITool
42
+ anyof_schema_2_validator: Optional[AgentOpenAPITool] = None
43
+ # data type: Agent
44
+ anyof_schema_3_validator: Optional[Agent] = None
45
+ # data type: object
46
+ anyof_schema_4_validator: Optional[Dict[str, Any]] = None
47
+ if TYPE_CHECKING:
48
+ actual_instance: Union[Agent, AgentOpenAPITool, ChatPrompt, object]
49
+ else:
50
+ actual_instance: Any
51
+ any_of_schemas: List[str] = Field(INTERNALMETADATA_ANY_OF_SCHEMAS, const=True)
52
+
53
+ class Config:
54
+ validate_assignment = True
55
+
56
+ def __init__(self, *args, **kwargs) -> None:
57
+ if args:
58
+ if len(args) > 1:
59
+ raise ValueError(
60
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
61
+ )
62
+ if kwargs:
63
+ raise ValueError(
64
+ "If a position argument is used, keyword arguments cannot be used."
65
+ )
66
+ super().__init__(actual_instance=args[0])
67
+ else:
68
+ super().__init__(**kwargs)
69
+
70
+ @validator("actual_instance")
71
+ def actual_instance_must_validate_anyof(cls, v):
72
+ instance = InternalMetadata.construct()
73
+ error_messages = []
74
+ # validate data type: ChatPrompt
75
+ if not isinstance(v, ChatPrompt):
76
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ChatPrompt`")
77
+ else:
78
+ return v
79
+
80
+ # validate data type: AgentOpenAPITool
81
+ if not isinstance(v, AgentOpenAPITool):
82
+ error_messages.append(
83
+ f"Error! Input type `{type(v)}` is not `AgentOpenAPITool`"
84
+ )
85
+ else:
86
+ return v
87
+
88
+ # validate data type: Agent
89
+ if not isinstance(v, Agent):
90
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Agent`")
91
+ else:
92
+ return v
93
+
94
+ # validate data type: object
95
+ try:
96
+ instance.anyof_schema_4_validator = v
97
+ return v
98
+ except (ValidationError, ValueError) as e:
99
+ error_messages.append(str(e))
100
+ if error_messages:
101
+ # no match
102
+ raise ValueError(
103
+ "No match found when setting the actual_instance in InternalMetadata with anyOf schemas: Agent, AgentOpenAPITool, ChatPrompt, object. Details: "
104
+ + ", ".join(error_messages)
105
+ )
106
+ else:
107
+ return v
108
+
109
+ @classmethod
110
+ def from_dict(cls, obj: dict) -> InternalMetadata:
111
+ return cls.from_json(json.dumps(obj))
112
+
113
+ @classmethod
114
+ def from_json(cls, json_str: str) -> InternalMetadata:
115
+ """Returns the object represented by the json string"""
116
+ instance = InternalMetadata.construct()
117
+ error_messages = []
118
+ # anyof_schema_1_validator: Optional[ChatPrompt] = None
119
+ try:
120
+ instance.actual_instance = ChatPrompt.from_json(json_str)
121
+ return instance
122
+ except (ValidationError, ValueError) as e:
123
+ error_messages.append(str(e))
124
+ # anyof_schema_2_validator: Optional[AgentOpenAPITool] = None
125
+ try:
126
+ instance.actual_instance = AgentOpenAPITool.from_json(json_str)
127
+ return instance
128
+ except (ValidationError, ValueError) as e:
129
+ error_messages.append(str(e))
130
+ # anyof_schema_3_validator: Optional[Agent] = None
131
+ try:
132
+ instance.actual_instance = Agent.from_json(json_str)
133
+ return instance
134
+ except (ValidationError, ValueError) as e:
135
+ error_messages.append(str(e))
136
+ # deserialize data into object
137
+ try:
138
+ # validation
139
+ instance.anyof_schema_4_validator = json.loads(json_str)
140
+ # assign value to actual_instance
141
+ instance.actual_instance = instance.anyof_schema_4_validator
142
+ return instance
143
+ except (ValidationError, ValueError) as e:
144
+ error_messages.append(str(e))
145
+
146
+ if error_messages:
147
+ # no match
148
+ raise ValueError(
149
+ "No match found when deserializing the JSON string into InternalMetadata with anyOf schemas: Agent, AgentOpenAPITool, ChatPrompt, object. Details: "
150
+ + ", ".join(error_messages)
151
+ )
152
+ else:
153
+ return instance
154
+
155
+ def to_json(self) -> str:
156
+ """Returns the JSON representation of the actual instance"""
157
+ if self.actual_instance is None:
158
+ return "null"
159
+
160
+ to_json = getattr(self.actual_instance, "to_json", None)
161
+ if callable(to_json):
162
+ return self.actual_instance.to_json()
163
+ else:
164
+ return json.dumps(self.actual_instance)
165
+
166
+ def to_dict(self) -> dict:
167
+ """Returns the dict representation of the actual instance"""
168
+ if self.actual_instance is None:
169
+ return "null"
170
+
171
+ to_json = getattr(self.actual_instance, "to_json", None)
172
+ if callable(to_json):
173
+ return self.actual_instance.to_dict()
174
+ else:
175
+ # primitive type
176
+ return self.actual_instance
177
+
178
+ def to_str(self) -> str:
179
+ """Returns the string representation of the actual instance"""
180
+ return pprint.pformat(self.dict())
@@ -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.ml.autogen.client.models.run_log_dto import RunLogDto
22
+ from truefoundry.pydantic_v1 import BaseModel, Field, StrictInt, conlist
23
+
24
+
25
+ class LatestRunLogDto(BaseModel):
26
+ """
27
+ LatestRunLogDto
28
+ """
29
+
30
+ run_log: Optional[RunLogDto] = None
31
+ steps: conlist(StrictInt) = Field(...)
32
+ __properties = ["run_log", "steps"]
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) -> LatestRunLogDto:
50
+ """Create an instance of LatestRunLogDto 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 run_log
57
+ if self.run_log:
58
+ _dict["run_log"] = self.run_log.to_dict()
59
+ return _dict
60
+
61
+ @classmethod
62
+ def from_dict(cls, obj: dict) -> LatestRunLogDto:
63
+ """Create an instance of LatestRunLogDto from a dict"""
64
+ if obj is None:
65
+ return None
66
+
67
+ if not isinstance(obj, dict):
68
+ return LatestRunLogDto.parse_obj(obj)
69
+
70
+ _obj = LatestRunLogDto.parse_obj(
71
+ {
72
+ "run_log": RunLogDto.from_dict(obj.get("run_log"))
73
+ if obj.get("run_log") is not None
74
+ else None,
75
+ "steps": obj.get("steps"),
76
+ }
77
+ )
78
+ 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.artifact_type import ArtifactType
22
+ from truefoundry.ml.autogen.client.models.artifact_version_status import (
23
+ ArtifactVersionStatus,
24
+ )
25
+ from truefoundry.pydantic_v1 import BaseModel, StrictBool, StrictInt, StrictStr, conlist
26
+
27
+
28
+ class ListArtifactVersionsRequestDto(BaseModel):
29
+ """
30
+ ListArtifactVersionsRequestDto
31
+ """
32
+
33
+ artifact_id: Optional[StrictStr] = None
34
+ statuses: Optional[conlist(ArtifactVersionStatus)] = None
35
+ max_results: Optional[StrictInt] = None
36
+ offset: Optional[StrictInt] = None
37
+ page_token: Optional[StrictStr] = None
38
+ run_ids: Optional[conlist(StrictStr)] = None
39
+ artifact_types: Optional[conlist(ArtifactType)] = None
40
+ run_steps: Optional[conlist(StrictInt)] = None
41
+ include_internal_metadata: Optional[StrictBool] = False
42
+ include_model_versions: Optional[StrictBool] = False
43
+ __properties = [
44
+ "artifact_id",
45
+ "statuses",
46
+ "max_results",
47
+ "offset",
48
+ "page_token",
49
+ "run_ids",
50
+ "artifact_types",
51
+ "run_steps",
52
+ "include_internal_metadata",
53
+ "include_model_versions",
54
+ ]
55
+
56
+ class Config:
57
+ """Pydantic configuration"""
58
+
59
+ allow_population_by_field_name = True
60
+ validate_assignment = True
61
+
62
+ def to_str(self) -> str:
63
+ """Returns the string representation of the model using alias"""
64
+ return pprint.pformat(self.dict(by_alias=True))
65
+
66
+ def to_json(self) -> str:
67
+ """Returns the JSON representation of the model using alias"""
68
+ return json.dumps(self.to_dict())
69
+
70
+ @classmethod
71
+ def from_json(cls, json_str: str) -> ListArtifactVersionsRequestDto:
72
+ """Create an instance of ListArtifactVersionsRequestDto from a JSON string"""
73
+ return cls.from_dict(json.loads(json_str))
74
+
75
+ def to_dict(self):
76
+ """Returns the dictionary representation of the model using alias"""
77
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: dict) -> ListArtifactVersionsRequestDto:
82
+ """Create an instance of ListArtifactVersionsRequestDto from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return ListArtifactVersionsRequestDto.parse_obj(obj)
88
+
89
+ _obj = ListArtifactVersionsRequestDto.parse_obj(
90
+ {
91
+ "artifact_id": obj.get("artifact_id"),
92
+ "statuses": obj.get("statuses"),
93
+ "max_results": obj.get("max_results"),
94
+ "offset": obj.get("offset"),
95
+ "page_token": obj.get("page_token"),
96
+ "run_ids": obj.get("run_ids"),
97
+ "artifact_types": obj.get("artifact_types"),
98
+ "run_steps": obj.get("run_steps"),
99
+ "include_internal_metadata": obj.get("include_internal_metadata")
100
+ if obj.get("include_internal_metadata") is not None
101
+ else False,
102
+ "include_model_versions": obj.get("include_model_versions")
103
+ if obj.get("include_model_versions") is not None
104
+ else False,
105
+ }
106
+ )
107
+ 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
+ from typing import Optional
20
+
21
+ from truefoundry.ml.autogen.client.models.artifact_version_dto import ArtifactVersionDto
22
+ from truefoundry.pydantic_v1 import BaseModel, Field, StrictInt, StrictStr, conlist
23
+
24
+
25
+ class ListArtifactVersionsResponseDto(BaseModel):
26
+ """
27
+ ListArtifactVersionsResponseDto
28
+ """
29
+
30
+ artifact_versions: conlist(ArtifactVersionDto) = Field(...)
31
+ next_page_token: Optional[StrictStr] = None
32
+ total: Optional[StrictInt] = None
33
+ __properties = ["artifact_versions", "next_page_token", "total"]
34
+
35
+ class Config:
36
+ """Pydantic configuration"""
37
+
38
+ allow_population_by_field_name = True
39
+ validate_assignment = True
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.dict(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> ListArtifactVersionsResponseDto:
51
+ """Create an instance of ListArtifactVersionsResponseDto from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self):
55
+ """Returns the dictionary representation of the model using alias"""
56
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
57
+ # override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of each item in artifact_versions (list)
58
+ _items = []
59
+ if self.artifact_versions:
60
+ for _item in self.artifact_versions:
61
+ if _item:
62
+ _items.append(_item.to_dict())
63
+ _dict["artifact_versions"] = _items
64
+ return _dict
65
+
66
+ @classmethod
67
+ def from_dict(cls, obj: dict) -> ListArtifactVersionsResponseDto:
68
+ """Create an instance of ListArtifactVersionsResponseDto from a dict"""
69
+ if obj is None:
70
+ return None
71
+
72
+ if not isinstance(obj, dict):
73
+ return ListArtifactVersionsResponseDto.parse_obj(obj)
74
+
75
+ _obj = ListArtifactVersionsResponseDto.parse_obj(
76
+ {
77
+ "artifact_versions": [
78
+ ArtifactVersionDto.from_dict(_item)
79
+ for _item in obj.get("artifact_versions")
80
+ ]
81
+ if obj.get("artifact_versions") is not None
82
+ else None,
83
+ "next_page_token": obj.get("next_page_token"),
84
+ "total": obj.get("total"),
85
+ }
86
+ )
87
+ return _obj
@@ -0,0 +1,96 @@
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.artifact_type import ArtifactType
22
+ from truefoundry.pydantic_v1 import BaseModel, StrictBool, StrictInt, StrictStr, conlist
23
+
24
+
25
+ class ListArtifactsRequestDto(BaseModel):
26
+ """
27
+ ListArtifactsRequestDto
28
+ """
29
+
30
+ experiment_id: Optional[StrictStr] = None
31
+ artifact_types: Optional[conlist(ArtifactType)] = None
32
+ name: Optional[StrictStr] = None
33
+ max_results: Optional[StrictInt] = None
34
+ offset: Optional[StrictInt] = None
35
+ page_token: Optional[StrictStr] = None
36
+ run_id: Optional[StrictStr] = None
37
+ include_models: Optional[StrictBool] = False
38
+ __properties = [
39
+ "experiment_id",
40
+ "artifact_types",
41
+ "name",
42
+ "max_results",
43
+ "offset",
44
+ "page_token",
45
+ "run_id",
46
+ "include_models",
47
+ ]
48
+
49
+ class Config:
50
+ """Pydantic configuration"""
51
+
52
+ allow_population_by_field_name = True
53
+ validate_assignment = True
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.dict(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> ListArtifactsRequestDto:
65
+ """Create an instance of ListArtifactsRequestDto from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self):
69
+ """Returns the dictionary representation of the model using alias"""
70
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: dict) -> ListArtifactsRequestDto:
75
+ """Create an instance of ListArtifactsRequestDto from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return ListArtifactsRequestDto.parse_obj(obj)
81
+
82
+ _obj = ListArtifactsRequestDto.parse_obj(
83
+ {
84
+ "experiment_id": obj.get("experiment_id"),
85
+ "artifact_types": obj.get("artifact_types"),
86
+ "name": obj.get("name"),
87
+ "max_results": obj.get("max_results"),
88
+ "offset": obj.get("offset"),
89
+ "page_token": obj.get("page_token"),
90
+ "run_id": obj.get("run_id"),
91
+ "include_models": obj.get("include_models")
92
+ if obj.get("include_models") is not None
93
+ else False,
94
+ }
95
+ )
96
+ return _obj