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.

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/auto_gen/models.py +29 -1
  5. truefoundry/deploy/cli/cli.py +1 -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/{python_deploy_codegen.py → deploy/python_deploy_codegen.py} +1 -0
  11. truefoundry/langchain/truefoundry_chat.py +1 -1
  12. truefoundry/langchain/truefoundry_embeddings.py +1 -1
  13. truefoundry/langchain/truefoundry_llm.py +1 -1
  14. truefoundry/langchain/utils.py +0 -41
  15. truefoundry/ml/__init__.py +46 -6
  16. truefoundry/ml/artifact/__init__.py +0 -0
  17. truefoundry/ml/artifact/truefoundry_artifact_repo.py +1120 -0
  18. truefoundry/ml/autogen/__init__.py +0 -0
  19. truefoundry/ml/autogen/client/__init__.py +373 -0
  20. truefoundry/ml/autogen/client/api/__init__.py +16 -0
  21. truefoundry/ml/autogen/client/api/auth_api.py +184 -0
  22. truefoundry/ml/autogen/client/api/deprecated_api.py +605 -0
  23. truefoundry/ml/autogen/client/api/experiments_api.py +2109 -0
  24. truefoundry/ml/autogen/client/api/health_api.py +299 -0
  25. truefoundry/ml/autogen/client/api/metrics_api.py +371 -0
  26. truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +7213 -0
  27. truefoundry/ml/autogen/client/api/python_deployment_config_api.py +201 -0
  28. truefoundry/ml/autogen/client/api/run_artifacts_api.py +231 -0
  29. truefoundry/ml/autogen/client/api/runs_api.py +2919 -0
  30. truefoundry/ml/autogen/client/api_client.py +822 -0
  31. truefoundry/ml/autogen/client/api_response.py +30 -0
  32. truefoundry/ml/autogen/client/configuration.py +489 -0
  33. truefoundry/ml/autogen/client/exceptions.py +161 -0
  34. truefoundry/ml/autogen/client/models/__init__.py +344 -0
  35. truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py +69 -0
  36. truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +83 -0
  37. truefoundry/ml/autogen/client/models/agent.py +125 -0
  38. truefoundry/ml/autogen/client/models/agent_app.py +118 -0
  39. truefoundry/ml/autogen/client/models/agent_open_api_tool.py +143 -0
  40. truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +144 -0
  41. truefoundry/ml/autogen/client/models/agent_with_fqn.py +127 -0
  42. truefoundry/ml/autogen/client/models/artifact_dto.py +115 -0
  43. truefoundry/ml/autogen/client/models/artifact_response_dto.py +75 -0
  44. truefoundry/ml/autogen/client/models/artifact_type.py +39 -0
  45. truefoundry/ml/autogen/client/models/artifact_version_dto.py +141 -0
  46. truefoundry/ml/autogen/client/models/artifact_version_response_dto.py +77 -0
  47. truefoundry/ml/autogen/client/models/artifact_version_status.py +35 -0
  48. truefoundry/ml/autogen/client/models/assistant_message.py +89 -0
  49. truefoundry/ml/autogen/client/models/authorize_user_for_model_request_dto.py +69 -0
  50. truefoundry/ml/autogen/client/models/authorize_user_for_model_version_request_dto.py +69 -0
  51. truefoundry/ml/autogen/client/models/backfill_default_storage_integration_id_request_dto.py +67 -0
  52. truefoundry/ml/autogen/client/models/blob_storage_reference.py +93 -0
  53. truefoundry/ml/autogen/client/models/body_get_search_runs_get.py +72 -0
  54. truefoundry/ml/autogen/client/models/chat_prompt.py +156 -0
  55. truefoundry/ml/autogen/client/models/chat_prompt_messages_inner.py +171 -0
  56. truefoundry/ml/autogen/client/models/columns_dto.py +73 -0
  57. truefoundry/ml/autogen/client/models/content.py +153 -0
  58. truefoundry/ml/autogen/client/models/content1.py +153 -0
  59. truefoundry/ml/autogen/client/models/content2.py +174 -0
  60. truefoundry/ml/autogen/client/models/content2_any_of_inner.py +150 -0
  61. truefoundry/ml/autogen/client/models/create_artifact_request_dto.py +74 -0
  62. truefoundry/ml/autogen/client/models/create_artifact_response_dto.py +66 -0
  63. truefoundry/ml/autogen/client/models/create_artifact_version_request_dto.py +74 -0
  64. truefoundry/ml/autogen/client/models/create_artifact_version_response_dto.py +66 -0
  65. truefoundry/ml/autogen/client/models/create_dataset_request_dto.py +76 -0
  66. truefoundry/ml/autogen/client/models/create_experiment_request_dto.py +94 -0
  67. truefoundry/ml/autogen/client/models/create_experiment_response_dto.py +67 -0
  68. truefoundry/ml/autogen/client/models/create_model_version_request_dto.py +95 -0
  69. truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_request_dto.py +73 -0
  70. truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_response_dto.py +79 -0
  71. truefoundry/ml/autogen/client/models/create_multi_part_upload_request_dto.py +73 -0
  72. truefoundry/ml/autogen/client/models/create_python_deployment_config_request_dto.py +72 -0
  73. truefoundry/ml/autogen/client/models/create_python_deployment_config_response_dto.py +68 -0
  74. truefoundry/ml/autogen/client/models/create_run_request_dto.py +97 -0
  75. truefoundry/ml/autogen/client/models/create_run_response_dto.py +76 -0
  76. truefoundry/ml/autogen/client/models/dataset_dto.py +112 -0
  77. truefoundry/ml/autogen/client/models/dataset_response_dto.py +75 -0
  78. truefoundry/ml/autogen/client/models/delete_artifact_versions_request_dto.py +65 -0
  79. truefoundry/ml/autogen/client/models/delete_dataset_request_dto.py +74 -0
  80. truefoundry/ml/autogen/client/models/delete_model_version_request_dto.py +65 -0
  81. truefoundry/ml/autogen/client/models/delete_run_request.py +65 -0
  82. truefoundry/ml/autogen/client/models/delete_tag_request_dto.py +68 -0
  83. truefoundry/ml/autogen/client/models/experiment_dto.py +127 -0
  84. truefoundry/ml/autogen/client/models/experiment_id_request_dto.py +67 -0
  85. truefoundry/ml/autogen/client/models/experiment_response_dto.py +75 -0
  86. truefoundry/ml/autogen/client/models/experiment_tag_dto.py +69 -0
  87. truefoundry/ml/autogen/client/models/feature_dto.py +68 -0
  88. truefoundry/ml/autogen/client/models/feature_value_type.py +35 -0
  89. truefoundry/ml/autogen/client/models/file_info_dto.py +76 -0
  90. truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +101 -0
  91. truefoundry/ml/autogen/client/models/get_experiment_response_dto.py +88 -0
  92. truefoundry/ml/autogen/client/models/get_latest_run_log_response_dto.py +76 -0
  93. truefoundry/ml/autogen/client/models/get_metric_history_response.py +79 -0
  94. truefoundry/ml/autogen/client/models/get_signed_url_for_dataset_write_request_dto.py +68 -0
  95. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_request_dto.py +68 -0
  96. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_response_dto.py +81 -0
  97. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_request_dto.py +69 -0
  98. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_response_dto.py +83 -0
  99. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_request_dto.py +68 -0
  100. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_response_dto.py +81 -0
  101. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_write_response_dto.py +81 -0
  102. truefoundry/ml/autogen/client/models/get_tenant_id_response_dto.py +74 -0
  103. truefoundry/ml/autogen/client/models/http_validation_error.py +82 -0
  104. truefoundry/ml/autogen/client/models/image_content_part.py +87 -0
  105. truefoundry/ml/autogen/client/models/image_url.py +75 -0
  106. truefoundry/ml/autogen/client/models/internal_metadata.py +180 -0
  107. truefoundry/ml/autogen/client/models/latest_run_log_dto.py +78 -0
  108. truefoundry/ml/autogen/client/models/list_artifact_versions_request_dto.py +107 -0
  109. truefoundry/ml/autogen/client/models/list_artifact_versions_response_dto.py +87 -0
  110. truefoundry/ml/autogen/client/models/list_artifacts_request_dto.py +96 -0
  111. truefoundry/ml/autogen/client/models/list_artifacts_response_dto.py +86 -0
  112. truefoundry/ml/autogen/client/models/list_colums_response_dto.py +75 -0
  113. truefoundry/ml/autogen/client/models/list_datasets_request_dto.py +78 -0
  114. truefoundry/ml/autogen/client/models/list_datasets_response_dto.py +86 -0
  115. truefoundry/ml/autogen/client/models/list_experiments_response_dto.py +86 -0
  116. truefoundry/ml/autogen/client/models/list_files_for_artifact_version_request_dto.py +76 -0
  117. truefoundry/ml/autogen/client/models/list_files_for_artifact_versions_response_dto.py +82 -0
  118. truefoundry/ml/autogen/client/models/list_files_for_dataset_request_dto.py +76 -0
  119. truefoundry/ml/autogen/client/models/list_files_for_dataset_response_dto.py +82 -0
  120. truefoundry/ml/autogen/client/models/list_latest_run_logs_response_dto.py +82 -0
  121. truefoundry/ml/autogen/client/models/list_metric_history_request_dto.py +69 -0
  122. truefoundry/ml/autogen/client/models/list_metric_history_response_dto.py +84 -0
  123. truefoundry/ml/autogen/client/models/list_model_version_response_dto.py +87 -0
  124. truefoundry/ml/autogen/client/models/list_model_versions_request_dto.py +93 -0
  125. truefoundry/ml/autogen/client/models/list_models_request_dto.py +89 -0
  126. truefoundry/ml/autogen/client/models/list_models_response_dto.py +84 -0
  127. truefoundry/ml/autogen/client/models/list_run_artifacts_response_dto.py +84 -0
  128. truefoundry/ml/autogen/client/models/list_run_logs_response_dto.py +82 -0
  129. truefoundry/ml/autogen/client/models/list_seed_experiments_response_dto.py +81 -0
  130. truefoundry/ml/autogen/client/models/log_batch_request_dto.py +106 -0
  131. truefoundry/ml/autogen/client/models/log_metric_request_dto.py +80 -0
  132. truefoundry/ml/autogen/client/models/log_param_request_dto.py +76 -0
  133. truefoundry/ml/autogen/client/models/method.py +37 -0
  134. truefoundry/ml/autogen/client/models/metric_collection_dto.py +82 -0
  135. truefoundry/ml/autogen/client/models/metric_dto.py +76 -0
  136. truefoundry/ml/autogen/client/models/mime_type.py +37 -0
  137. truefoundry/ml/autogen/client/models/model_configuration.py +103 -0
  138. truefoundry/ml/autogen/client/models/model_dto.py +122 -0
  139. truefoundry/ml/autogen/client/models/model_response_dto.py +75 -0
  140. truefoundry/ml/autogen/client/models/model_schema_dto.py +85 -0
  141. truefoundry/ml/autogen/client/models/model_version_dto.py +163 -0
  142. truefoundry/ml/autogen/client/models/model_version_response_dto.py +75 -0
  143. truefoundry/ml/autogen/client/models/multi_part_upload_dto.py +107 -0
  144. truefoundry/ml/autogen/client/models/multi_part_upload_response_dto.py +79 -0
  145. truefoundry/ml/autogen/client/models/multi_part_upload_storage_provider.py +34 -0
  146. truefoundry/ml/autogen/client/models/notify_artifact_version_failure_dto.py +65 -0
  147. truefoundry/ml/autogen/client/models/openapi_spec.py +152 -0
  148. truefoundry/ml/autogen/client/models/param_dto.py +66 -0
  149. truefoundry/ml/autogen/client/models/parameters.py +84 -0
  150. truefoundry/ml/autogen/client/models/prediction_type.py +34 -0
  151. truefoundry/ml/autogen/client/models/resolve_agent_app_response_dto.py +75 -0
  152. truefoundry/ml/autogen/client/models/restore_run_request_dto.py +65 -0
  153. truefoundry/ml/autogen/client/models/run_data_dto.py +104 -0
  154. truefoundry/ml/autogen/client/models/run_dto.py +84 -0
  155. truefoundry/ml/autogen/client/models/run_info_dto.py +105 -0
  156. truefoundry/ml/autogen/client/models/run_log_dto.py +90 -0
  157. truefoundry/ml/autogen/client/models/run_log_input_dto.py +80 -0
  158. truefoundry/ml/autogen/client/models/run_response_dto.py +75 -0
  159. truefoundry/ml/autogen/client/models/run_tag_dto.py +66 -0
  160. truefoundry/ml/autogen/client/models/search_runs_request_dto.py +94 -0
  161. truefoundry/ml/autogen/client/models/search_runs_response_dto.py +84 -0
  162. truefoundry/ml/autogen/client/models/set_experiment_tag_request_dto.py +73 -0
  163. truefoundry/ml/autogen/client/models/set_tag_request_dto.py +76 -0
  164. truefoundry/ml/autogen/client/models/signed_url_dto.py +69 -0
  165. truefoundry/ml/autogen/client/models/stop.py +152 -0
  166. truefoundry/ml/autogen/client/models/store_run_logs_request_dto.py +83 -0
  167. truefoundry/ml/autogen/client/models/system_message.py +89 -0
  168. truefoundry/ml/autogen/client/models/text.py +153 -0
  169. truefoundry/ml/autogen/client/models/text_content_part.py +84 -0
  170. truefoundry/ml/autogen/client/models/update_artifact_version_request_dto.py +74 -0
  171. truefoundry/ml/autogen/client/models/update_dataset_request_dto.py +74 -0
  172. truefoundry/ml/autogen/client/models/update_experiment_request_dto.py +74 -0
  173. truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +93 -0
  174. truefoundry/ml/autogen/client/models/update_run_request_dto.py +78 -0
  175. truefoundry/ml/autogen/client/models/update_run_response_dto.py +76 -0
  176. truefoundry/ml/autogen/client/models/url.py +153 -0
  177. truefoundry/ml/autogen/client/models/user_message.py +89 -0
  178. truefoundry/ml/autogen/client/models/validation_error.py +87 -0
  179. truefoundry/ml/autogen/client/models/validation_error_loc_inner.py +154 -0
  180. truefoundry/ml/autogen/client/rest.py +426 -0
  181. truefoundry/ml/autogen/client_README.md +322 -0
  182. truefoundry/ml/cli/__init__.py +0 -0
  183. truefoundry/ml/cli/cli.py +18 -0
  184. truefoundry/ml/cli/commands/__init__.py +3 -0
  185. truefoundry/ml/cli/commands/download.py +87 -0
  186. truefoundry/ml/constants.py +84 -0
  187. truefoundry/ml/enums.py +70 -0
  188. truefoundry/ml/env_vars.py +13 -0
  189. truefoundry/ml/exceptions.py +8 -0
  190. truefoundry/ml/git_info.py +60 -0
  191. truefoundry/ml/internal_namespace.py +52 -0
  192. truefoundry/ml/log_types/__init__.py +4 -0
  193. truefoundry/ml/log_types/artifacts/artifact.py +427 -0
  194. truefoundry/ml/log_types/artifacts/constants.py +33 -0
  195. truefoundry/ml/log_types/artifacts/dataset.py +383 -0
  196. truefoundry/ml/log_types/artifacts/general_artifact.py +110 -0
  197. truefoundry/ml/log_types/artifacts/model.py +628 -0
  198. truefoundry/ml/log_types/artifacts/model_extras.py +48 -0
  199. truefoundry/ml/log_types/artifacts/utils.py +161 -0
  200. truefoundry/ml/log_types/image/__init__.py +3 -0
  201. truefoundry/ml/log_types/image/constants.py +8 -0
  202. truefoundry/ml/log_types/image/image.py +358 -0
  203. truefoundry/ml/log_types/image/image_normalizer.py +101 -0
  204. truefoundry/ml/log_types/image/types.py +68 -0
  205. truefoundry/ml/log_types/plot.py +281 -0
  206. truefoundry/ml/log_types/pydantic_base.py +10 -0
  207. truefoundry/ml/log_types/utils.py +12 -0
  208. truefoundry/ml/logger.py +17 -0
  209. truefoundry/ml/login.py +241 -0
  210. truefoundry/ml/mlfoundry_api.py +1620 -0
  211. truefoundry/ml/mlfoundry_run.py +1238 -0
  212. truefoundry/ml/run_utils.py +102 -0
  213. truefoundry/ml/services/__init__.py +0 -0
  214. truefoundry/ml/services/auth_service.py +109 -0
  215. truefoundry/ml/services/entities.py +108 -0
  216. truefoundry/ml/services/servicefoundry_service.py +35 -0
  217. truefoundry/ml/services/utils.py +122 -0
  218. truefoundry/ml/session.py +271 -0
  219. truefoundry/ml/validation_utils.py +346 -0
  220. truefoundry/pydantic_v1.py +5 -1
  221. {truefoundry-0.3.2.dist-info → truefoundry-0.4.0.dev0.dist-info}/METADATA +19 -12
  222. truefoundry-0.4.0.dev0.dist-info/RECORD +342 -0
  223. truefoundry-0.3.2.dist-info/RECORD +0 -136
  224. {truefoundry-0.3.2.dist-info → truefoundry-0.4.0.dev0.dist-info}/WHEEL +0 -0
  225. {truefoundry-0.3.2.dist-info → truefoundry-0.4.0.dev0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,299 @@
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 re # noqa: F401
15
+
16
+ from truefoundry.ml.autogen.client.api_client import ApiClient
17
+ from truefoundry.ml.autogen.client.api_response import ApiResponse
18
+ from truefoundry.ml.autogen.client.exceptions import ( # noqa: F401
19
+ ApiTypeError,
20
+ ApiValueError,
21
+ )
22
+ from truefoundry.pydantic_v1 import validate_arguments
23
+
24
+
25
+ class HealthApi:
26
+ """NOTE: This class is auto generated by OpenAPI Generator
27
+ Ref: https://openapi-generator.tech
28
+
29
+ Do not edit the class manually.
30
+ """
31
+
32
+ def __init__(self, api_client=None) -> None:
33
+ if api_client is None:
34
+ api_client = ApiClient.get_default()
35
+ self.api_client = api_client
36
+
37
+ @validate_arguments
38
+ def health_get(self, **kwargs) -> object: # noqa: E501
39
+ """Health # noqa: E501
40
+
41
+ This method makes a synchronous HTTP request by default. To make an
42
+ asynchronous HTTP request, please pass async_req=True
43
+
44
+ >>> thread = api.health_get(async_req=True)
45
+ >>> result = thread.get()
46
+
47
+ :param async_req: Whether to execute the request asynchronously.
48
+ :type async_req: bool, optional
49
+ :param _request_timeout: timeout setting for this request.
50
+ If one number provided, it will be total request
51
+ timeout. It can also be a pair (tuple) of
52
+ (connection, read) timeouts.
53
+ :return: Returns the result object.
54
+ If the method is called asynchronously,
55
+ returns the request thread.
56
+ :rtype: object
57
+ """
58
+ kwargs["_return_http_data_only"] = True
59
+ if "_preload_content" in kwargs:
60
+ message = "Error! Please call the health_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
61
+ raise ValueError(message)
62
+ return self.health_get_with_http_info(**kwargs) # noqa: E501
63
+
64
+ @validate_arguments
65
+ def health_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
66
+ """Health # noqa: E501
67
+
68
+ This method makes a synchronous HTTP request by default. To make an
69
+ asynchronous HTTP request, please pass async_req=True
70
+
71
+ >>> thread = api.health_get_with_http_info(async_req=True)
72
+ >>> result = thread.get()
73
+
74
+ :param async_req: Whether to execute the request asynchronously.
75
+ :type async_req: bool, optional
76
+ :param _preload_content: if False, the ApiResponse.data will
77
+ be set to none and raw_data will store the
78
+ HTTP response body without reading/decoding.
79
+ Default is True.
80
+ :type _preload_content: bool, optional
81
+ :param _return_http_data_only: response data instead of ApiResponse
82
+ object with status code, headers, etc
83
+ :type _return_http_data_only: bool, optional
84
+ :param _request_timeout: timeout setting for this request. If one
85
+ number provided, it will be total request
86
+ timeout. It can also be a pair (tuple) of
87
+ (connection, read) timeouts.
88
+ :param _request_auth: set to override the auth_settings for an a single
89
+ request; this effectively ignores the authentication
90
+ in the spec for a single request.
91
+ :type _request_auth: dict, optional
92
+ :type _content_type: string, optional: force content-type for the request
93
+ :return: Returns the result object.
94
+ If the method is called asynchronously,
95
+ returns the request thread.
96
+ :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
97
+ """
98
+
99
+ _params = locals()
100
+
101
+ _all_params = []
102
+ _all_params.extend(
103
+ [
104
+ "async_req",
105
+ "_return_http_data_only",
106
+ "_preload_content",
107
+ "_request_timeout",
108
+ "_request_auth",
109
+ "_content_type",
110
+ "_headers",
111
+ ]
112
+ )
113
+
114
+ # validate the arguments
115
+ for _key, _val in _params["kwargs"].items():
116
+ if _key not in _all_params:
117
+ raise ApiTypeError(
118
+ "Got an unexpected keyword argument '%s'"
119
+ " to method health_get" % _key
120
+ )
121
+ _params[_key] = _val
122
+ del _params["kwargs"]
123
+
124
+ _collection_formats = {}
125
+
126
+ # process the path parameters
127
+ _path_params = {}
128
+
129
+ # process the query parameters
130
+ _query_params = []
131
+ # process the header parameters
132
+ _header_params = dict(_params.get("_headers", {}))
133
+ # process the form parameters
134
+ _form_params = []
135
+ _files = {}
136
+ # process the body parameter
137
+ _body_params = None
138
+ # set the HTTP header `Accept`
139
+ _header_params["Accept"] = self.api_client.select_header_accept(
140
+ ["application/json"]
141
+ ) # noqa: E501
142
+
143
+ # authentication setting
144
+ _auth_settings = [] # noqa: E501
145
+
146
+ _response_types_map = {
147
+ "200": "object",
148
+ }
149
+
150
+ return self.api_client.call_api(
151
+ "/health",
152
+ "GET",
153
+ _path_params,
154
+ _query_params,
155
+ _header_params,
156
+ body=_body_params,
157
+ post_params=_form_params,
158
+ files=_files,
159
+ response_types_map=_response_types_map,
160
+ auth_settings=_auth_settings,
161
+ async_req=_params.get("async_req"),
162
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
163
+ _preload_content=_params.get("_preload_content", True),
164
+ _request_timeout=_params.get("_request_timeout"),
165
+ collection_formats=_collection_formats,
166
+ _request_auth=_params.get("_request_auth"),
167
+ )
168
+
169
+ @validate_arguments
170
+ def serve_get(self, **kwargs) -> object: # noqa: E501
171
+ """Serve # noqa: E501
172
+
173
+ This method makes a synchronous HTTP request by default. To make an
174
+ asynchronous HTTP request, please pass async_req=True
175
+
176
+ >>> thread = api.serve_get(async_req=True)
177
+ >>> result = thread.get()
178
+
179
+ :param async_req: Whether to execute the request asynchronously.
180
+ :type async_req: bool, optional
181
+ :param _request_timeout: timeout setting for this request.
182
+ If one number provided, it will be total request
183
+ timeout. It can also be a pair (tuple) of
184
+ (connection, read) timeouts.
185
+ :return: Returns the result object.
186
+ If the method is called asynchronously,
187
+ returns the request thread.
188
+ :rtype: object
189
+ """
190
+ kwargs["_return_http_data_only"] = True
191
+ if "_preload_content" in kwargs:
192
+ message = "Error! Please call the serve_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
193
+ raise ValueError(message)
194
+ return self.serve_get_with_http_info(**kwargs) # noqa: E501
195
+
196
+ @validate_arguments
197
+ def serve_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
198
+ """Serve # noqa: E501
199
+
200
+ This method makes a synchronous HTTP request by default. To make an
201
+ asynchronous HTTP request, please pass async_req=True
202
+
203
+ >>> thread = api.serve_get_with_http_info(async_req=True)
204
+ >>> result = thread.get()
205
+
206
+ :param async_req: Whether to execute the request asynchronously.
207
+ :type async_req: bool, optional
208
+ :param _preload_content: if False, the ApiResponse.data will
209
+ be set to none and raw_data will store the
210
+ HTTP response body without reading/decoding.
211
+ Default is True.
212
+ :type _preload_content: bool, optional
213
+ :param _return_http_data_only: response data instead of ApiResponse
214
+ object with status code, headers, etc
215
+ :type _return_http_data_only: bool, optional
216
+ :param _request_timeout: timeout setting for this request. If one
217
+ number provided, it will be total request
218
+ timeout. It can also be a pair (tuple) of
219
+ (connection, read) timeouts.
220
+ :param _request_auth: set to override the auth_settings for an a single
221
+ request; this effectively ignores the authentication
222
+ in the spec for a single request.
223
+ :type _request_auth: dict, optional
224
+ :type _content_type: string, optional: force content-type for the request
225
+ :return: Returns the result object.
226
+ If the method is called asynchronously,
227
+ returns the request thread.
228
+ :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict))
229
+ """
230
+
231
+ _params = locals()
232
+
233
+ _all_params = []
234
+ _all_params.extend(
235
+ [
236
+ "async_req",
237
+ "_return_http_data_only",
238
+ "_preload_content",
239
+ "_request_timeout",
240
+ "_request_auth",
241
+ "_content_type",
242
+ "_headers",
243
+ ]
244
+ )
245
+
246
+ # validate the arguments
247
+ for _key, _val in _params["kwargs"].items():
248
+ if _key not in _all_params:
249
+ raise ApiTypeError(
250
+ "Got an unexpected keyword argument '%s'"
251
+ " to method serve_get" % _key
252
+ )
253
+ _params[_key] = _val
254
+ del _params["kwargs"]
255
+
256
+ _collection_formats = {}
257
+
258
+ # process the path parameters
259
+ _path_params = {}
260
+
261
+ # process the query parameters
262
+ _query_params = []
263
+ # process the header parameters
264
+ _header_params = dict(_params.get("_headers", {}))
265
+ # process the form parameters
266
+ _form_params = []
267
+ _files = {}
268
+ # process the body parameter
269
+ _body_params = None
270
+ # set the HTTP header `Accept`
271
+ _header_params["Accept"] = self.api_client.select_header_accept(
272
+ ["application/json"]
273
+ ) # noqa: E501
274
+
275
+ # authentication setting
276
+ _auth_settings = [] # noqa: E501
277
+
278
+ _response_types_map = {
279
+ "200": "object",
280
+ }
281
+
282
+ return self.api_client.call_api(
283
+ "/",
284
+ "GET",
285
+ _path_params,
286
+ _query_params,
287
+ _header_params,
288
+ body=_body_params,
289
+ post_params=_form_params,
290
+ files=_files,
291
+ response_types_map=_response_types_map,
292
+ auth_settings=_auth_settings,
293
+ async_req=_params.get("async_req"),
294
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
295
+ _preload_content=_params.get("_preload_content", True),
296
+ _request_timeout=_params.get("_request_timeout"),
297
+ collection_formats=_collection_formats,
298
+ _request_auth=_params.get("_request_auth"),
299
+ )
@@ -0,0 +1,371 @@
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 re # noqa: F401
15
+ from typing import Optional
16
+
17
+ from truefoundry.ml.autogen.client.api_client import ApiClient
18
+ from truefoundry.ml.autogen.client.api_response import ApiResponse
19
+ from truefoundry.ml.autogen.client.exceptions import ( # noqa: F401
20
+ ApiTypeError,
21
+ ApiValueError,
22
+ )
23
+ from truefoundry.ml.autogen.client.models.get_metric_history_response import (
24
+ GetMetricHistoryResponse,
25
+ )
26
+ from truefoundry.ml.autogen.client.models.list_metric_history_request_dto import (
27
+ ListMetricHistoryRequestDto,
28
+ )
29
+ from truefoundry.ml.autogen.client.models.list_metric_history_response_dto import (
30
+ ListMetricHistoryResponseDto,
31
+ )
32
+ from truefoundry.pydantic_v1 import StrictStr, validate_arguments
33
+
34
+
35
+ class MetricsApi:
36
+ """NOTE: This class is auto generated by OpenAPI Generator
37
+ Ref: https://openapi-generator.tech
38
+
39
+ Do not edit the class manually.
40
+ """
41
+
42
+ def __init__(self, api_client=None) -> None:
43
+ if api_client is None:
44
+ api_client = ApiClient.get_default()
45
+ self.api_client = api_client
46
+
47
+ @validate_arguments
48
+ def get_metric_history_get(
49
+ self,
50
+ run_uuid: Optional[StrictStr] = None,
51
+ run_id: Optional[StrictStr] = None,
52
+ metric_key: Optional[StrictStr] = None,
53
+ **kwargs,
54
+ ) -> GetMetricHistoryResponse: # noqa: E501
55
+ """Get Metric History # noqa: E501
56
+
57
+ Get Metric History # noqa: E501
58
+ This method makes a synchronous HTTP request by default. To make an
59
+ asynchronous HTTP request, please pass async_req=True
60
+
61
+ >>> thread = api.get_metric_history_get(run_uuid, run_id, metric_key, async_req=True)
62
+ >>> result = thread.get()
63
+
64
+ :param run_uuid:
65
+ :type run_uuid: str
66
+ :param run_id:
67
+ :type run_id: str
68
+ :param metric_key:
69
+ :type metric_key: str
70
+ :param async_req: Whether to execute the request asynchronously.
71
+ :type async_req: bool, optional
72
+ :param _request_timeout: timeout setting for this request.
73
+ If one number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :return: Returns the result object.
77
+ If the method is called asynchronously,
78
+ returns the request thread.
79
+ :rtype: GetMetricHistoryResponse
80
+ """
81
+ kwargs["_return_http_data_only"] = True
82
+ if "_preload_content" in kwargs:
83
+ message = "Error! Please call the get_metric_history_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
84
+ raise ValueError(message)
85
+ return self.get_metric_history_get_with_http_info(
86
+ run_uuid, run_id, metric_key, **kwargs
87
+ ) # noqa: E501
88
+
89
+ @validate_arguments
90
+ def get_metric_history_get_with_http_info(
91
+ self,
92
+ run_uuid: Optional[StrictStr] = None,
93
+ run_id: Optional[StrictStr] = None,
94
+ metric_key: Optional[StrictStr] = None,
95
+ **kwargs,
96
+ ) -> ApiResponse: # noqa: E501
97
+ """Get Metric History # noqa: E501
98
+
99
+ Get Metric History # noqa: E501
100
+ This method makes a synchronous HTTP request by default. To make an
101
+ asynchronous HTTP request, please pass async_req=True
102
+
103
+ >>> thread = api.get_metric_history_get_with_http_info(run_uuid, run_id, metric_key, async_req=True)
104
+ >>> result = thread.get()
105
+
106
+ :param run_uuid:
107
+ :type run_uuid: str
108
+ :param run_id:
109
+ :type run_id: str
110
+ :param metric_key:
111
+ :type metric_key: str
112
+ :param async_req: Whether to execute the request asynchronously.
113
+ :type async_req: bool, optional
114
+ :param _preload_content: if False, the ApiResponse.data will
115
+ be set to none and raw_data will store the
116
+ HTTP response body without reading/decoding.
117
+ Default is True.
118
+ :type _preload_content: bool, optional
119
+ :param _return_http_data_only: response data instead of ApiResponse
120
+ object with status code, headers, etc
121
+ :type _return_http_data_only: bool, optional
122
+ :param _request_timeout: timeout setting for this request. If one
123
+ number provided, it will be total request
124
+ timeout. It can also be a pair (tuple) of
125
+ (connection, read) timeouts.
126
+ :param _request_auth: set to override the auth_settings for an a single
127
+ request; this effectively ignores the authentication
128
+ in the spec for a single request.
129
+ :type _request_auth: dict, optional
130
+ :type _content_type: string, optional: force content-type for the request
131
+ :return: Returns the result object.
132
+ If the method is called asynchronously,
133
+ returns the request thread.
134
+ :rtype: tuple(GetMetricHistoryResponse, status_code(int), headers(HTTPHeaderDict))
135
+ """
136
+
137
+ _params = locals()
138
+
139
+ _all_params = ["run_uuid", "run_id", "metric_key"]
140
+ _all_params.extend(
141
+ [
142
+ "async_req",
143
+ "_return_http_data_only",
144
+ "_preload_content",
145
+ "_request_timeout",
146
+ "_request_auth",
147
+ "_content_type",
148
+ "_headers",
149
+ ]
150
+ )
151
+
152
+ # validate the arguments
153
+ for _key, _val in _params["kwargs"].items():
154
+ if _key not in _all_params:
155
+ raise ApiTypeError(
156
+ "Got an unexpected keyword argument '%s'"
157
+ " to method get_metric_history_get" % _key
158
+ )
159
+ _params[_key] = _val
160
+ del _params["kwargs"]
161
+
162
+ _collection_formats = {}
163
+
164
+ # process the path parameters
165
+ _path_params = {}
166
+
167
+ # process the query parameters
168
+ _query_params = []
169
+ if _params.get("run_uuid") is not None: # noqa: E501
170
+ _query_params.append(("run_uuid", _params["run_uuid"]))
171
+
172
+ if _params.get("run_id") is not None: # noqa: E501
173
+ _query_params.append(("run_id", _params["run_id"]))
174
+
175
+ if _params.get("metric_key") is not None: # noqa: E501
176
+ _query_params.append(("metric_key", _params["metric_key"]))
177
+
178
+ # process the header parameters
179
+ _header_params = dict(_params.get("_headers", {}))
180
+ # process the form parameters
181
+ _form_params = []
182
+ _files = {}
183
+ # process the body parameter
184
+ _body_params = None
185
+ # set the HTTP header `Accept`
186
+ _header_params["Accept"] = self.api_client.select_header_accept(
187
+ ["application/json"]
188
+ ) # noqa: E501
189
+
190
+ # authentication setting
191
+ _auth_settings = ["HTTPBearer", "APIKeyCookie"] # noqa: E501
192
+
193
+ _response_types_map = {
194
+ "200": "GetMetricHistoryResponse",
195
+ "422": "HTTPValidationError",
196
+ }
197
+
198
+ return self.api_client.call_api(
199
+ "/api/2.0/mlflow/metrics/get-history",
200
+ "GET",
201
+ _path_params,
202
+ _query_params,
203
+ _header_params,
204
+ body=_body_params,
205
+ post_params=_form_params,
206
+ files=_files,
207
+ response_types_map=_response_types_map,
208
+ auth_settings=_auth_settings,
209
+ async_req=_params.get("async_req"),
210
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
211
+ _preload_content=_params.get("_preload_content", True),
212
+ _request_timeout=_params.get("_request_timeout"),
213
+ collection_formats=_collection_formats,
214
+ _request_auth=_params.get("_request_auth"),
215
+ )
216
+
217
+ @validate_arguments
218
+ def list_metric_history_post(
219
+ self, list_metric_history_request_dto: ListMetricHistoryRequestDto, **kwargs
220
+ ) -> ListMetricHistoryResponseDto: # noqa: E501
221
+ """List Metric History # noqa: E501
222
+
223
+ List Metric History # noqa: E501
224
+ This method makes a synchronous HTTP request by default. To make an
225
+ asynchronous HTTP request, please pass async_req=True
226
+
227
+ >>> thread = api.list_metric_history_post(list_metric_history_request_dto, async_req=True)
228
+ >>> result = thread.get()
229
+
230
+ :param list_metric_history_request_dto: (required)
231
+ :type list_metric_history_request_dto: ListMetricHistoryRequestDto
232
+ :param async_req: Whether to execute the request asynchronously.
233
+ :type async_req: bool, optional
234
+ :param _request_timeout: timeout setting for this request.
235
+ If one number provided, it will be total request
236
+ timeout. It can also be a pair (tuple) of
237
+ (connection, read) timeouts.
238
+ :return: Returns the result object.
239
+ If the method is called asynchronously,
240
+ returns the request thread.
241
+ :rtype: ListMetricHistoryResponseDto
242
+ """
243
+ kwargs["_return_http_data_only"] = True
244
+ if "_preload_content" in kwargs:
245
+ message = "Error! Please call the list_metric_history_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
246
+ raise ValueError(message)
247
+ return self.list_metric_history_post_with_http_info(
248
+ list_metric_history_request_dto, **kwargs
249
+ ) # noqa: E501
250
+
251
+ @validate_arguments
252
+ def list_metric_history_post_with_http_info(
253
+ self, list_metric_history_request_dto: ListMetricHistoryRequestDto, **kwargs
254
+ ) -> ApiResponse: # noqa: E501
255
+ """List Metric History # noqa: E501
256
+
257
+ List Metric History # noqa: E501
258
+ This method makes a synchronous HTTP request by default. To make an
259
+ asynchronous HTTP request, please pass async_req=True
260
+
261
+ >>> thread = api.list_metric_history_post_with_http_info(list_metric_history_request_dto, async_req=True)
262
+ >>> result = thread.get()
263
+
264
+ :param list_metric_history_request_dto: (required)
265
+ :type list_metric_history_request_dto: ListMetricHistoryRequestDto
266
+ :param async_req: Whether to execute the request asynchronously.
267
+ :type async_req: bool, optional
268
+ :param _preload_content: if False, the ApiResponse.data will
269
+ be set to none and raw_data will store the
270
+ HTTP response body without reading/decoding.
271
+ Default is True.
272
+ :type _preload_content: bool, optional
273
+ :param _return_http_data_only: response data instead of ApiResponse
274
+ object with status code, headers, etc
275
+ :type _return_http_data_only: bool, optional
276
+ :param _request_timeout: timeout setting for this request. If one
277
+ number provided, it will be total request
278
+ timeout. It can also be a pair (tuple) of
279
+ (connection, read) timeouts.
280
+ :param _request_auth: set to override the auth_settings for an a single
281
+ request; this effectively ignores the authentication
282
+ in the spec for a single request.
283
+ :type _request_auth: dict, optional
284
+ :type _content_type: string, optional: force content-type for the request
285
+ :return: Returns the result object.
286
+ If the method is called asynchronously,
287
+ returns the request thread.
288
+ :rtype: tuple(ListMetricHistoryResponseDto, status_code(int), headers(HTTPHeaderDict))
289
+ """
290
+
291
+ _params = locals()
292
+
293
+ _all_params = ["list_metric_history_request_dto"]
294
+ _all_params.extend(
295
+ [
296
+ "async_req",
297
+ "_return_http_data_only",
298
+ "_preload_content",
299
+ "_request_timeout",
300
+ "_request_auth",
301
+ "_content_type",
302
+ "_headers",
303
+ ]
304
+ )
305
+
306
+ # validate the arguments
307
+ for _key, _val in _params["kwargs"].items():
308
+ if _key not in _all_params:
309
+ raise ApiTypeError(
310
+ "Got an unexpected keyword argument '%s'"
311
+ " to method list_metric_history_post" % _key
312
+ )
313
+ _params[_key] = _val
314
+ del _params["kwargs"]
315
+
316
+ _collection_formats = {}
317
+
318
+ # process the path parameters
319
+ _path_params = {}
320
+
321
+ # process the query parameters
322
+ _query_params = []
323
+ # process the header parameters
324
+ _header_params = dict(_params.get("_headers", {}))
325
+ # process the form parameters
326
+ _form_params = []
327
+ _files = {}
328
+ # process the body parameter
329
+ _body_params = None
330
+ if _params["list_metric_history_request_dto"] is not None:
331
+ _body_params = _params["list_metric_history_request_dto"]
332
+
333
+ # set the HTTP header `Accept`
334
+ _header_params["Accept"] = self.api_client.select_header_accept(
335
+ ["application/json"]
336
+ ) # noqa: E501
337
+
338
+ # set the HTTP header `Content-Type`
339
+ _content_types_list = _params.get(
340
+ "_content_type",
341
+ self.api_client.select_header_content_type(["application/json"]),
342
+ )
343
+ if _content_types_list:
344
+ _header_params["Content-Type"] = _content_types_list
345
+
346
+ # authentication setting
347
+ _auth_settings = ["HTTPBearer", "APIKeyCookie"] # noqa: E501
348
+
349
+ _response_types_map = {
350
+ "200": "ListMetricHistoryResponseDto",
351
+ "422": "HTTPValidationError",
352
+ }
353
+
354
+ return self.api_client.call_api(
355
+ "/api/2.0/mlflow/metrics/list-history",
356
+ "POST",
357
+ _path_params,
358
+ _query_params,
359
+ _header_params,
360
+ body=_body_params,
361
+ post_params=_form_params,
362
+ files=_files,
363
+ response_types_map=_response_types_map,
364
+ auth_settings=_auth_settings,
365
+ async_req=_params.get("async_req"),
366
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
367
+ _preload_content=_params.get("_preload_content", True),
368
+ _request_timeout=_params.get("_request_timeout"),
369
+ collection_formats=_collection_formats,
370
+ _request_auth=_params.get("_request_auth"),
371
+ )