scorable 1.6.4__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 scorable might be problematic. Click here for more details.

Files changed (228) hide show
  1. root/__about__.py +4 -0
  2. root/__init__.py +17 -0
  3. root/client.py +207 -0
  4. root/datasets.py +231 -0
  5. root/execution_logs.py +162 -0
  6. root/generated/__init__.py +0 -0
  7. root/generated/openapi_aclient/__init__.py +1 -0
  8. root/generated/openapi_aclient/api/__init__.py +1 -0
  9. root/generated/openapi_aclient/api/datasets_api.py +1274 -0
  10. root/generated/openapi_aclient/api/evaluators_api.py +3641 -0
  11. root/generated/openapi_aclient/api/execution_logs_api.py +751 -0
  12. root/generated/openapi_aclient/api/judges_api.py +3794 -0
  13. root/generated/openapi_aclient/api/models_api.py +1473 -0
  14. root/generated/openapi_aclient/api/objectives_api.py +1767 -0
  15. root/generated/openapi_aclient/api_client.py +662 -0
  16. root/generated/openapi_aclient/api_response.py +22 -0
  17. root/generated/openapi_aclient/configuration.py +470 -0
  18. root/generated/openapi_aclient/exceptions.py +197 -0
  19. root/generated/openapi_aclient/models/__init__.py +122 -0
  20. root/generated/openapi_aclient/models/data_set_create.py +118 -0
  21. root/generated/openapi_aclient/models/data_set_create_request.py +105 -0
  22. root/generated/openapi_aclient/models/data_set_list.py +129 -0
  23. root/generated/openapi_aclient/models/data_set_type.py +36 -0
  24. root/generated/openapi_aclient/models/dataset_range_request.py +93 -0
  25. root/generated/openapi_aclient/models/evaluator.py +273 -0
  26. root/generated/openapi_aclient/models/evaluator_calibration_output.py +101 -0
  27. root/generated/openapi_aclient/models/evaluator_calibration_result.py +134 -0
  28. root/generated/openapi_aclient/models/evaluator_demonstrations.py +107 -0
  29. root/generated/openapi_aclient/models/evaluator_demonstrations_request.py +107 -0
  30. root/generated/openapi_aclient/models/evaluator_execution_function_parameter_property_request.py +86 -0
  31. root/generated/openapi_aclient/models/evaluator_execution_function_parameter_request.py +109 -0
  32. root/generated/openapi_aclient/models/evaluator_execution_function_parameter_type_enum.py +35 -0
  33. root/generated/openapi_aclient/models/evaluator_execution_function_request.py +99 -0
  34. root/generated/openapi_aclient/models/evaluator_execution_functions_request.py +98 -0
  35. root/generated/openapi_aclient/models/evaluator_execution_functions_type_enum.py +35 -0
  36. root/generated/openapi_aclient/models/evaluator_execution_request.py +134 -0
  37. root/generated/openapi_aclient/models/evaluator_execution_result.py +114 -0
  38. root/generated/openapi_aclient/models/evaluator_inputs_value.py +100 -0
  39. root/generated/openapi_aclient/models/evaluator_inputs_value_items.py +89 -0
  40. root/generated/openapi_aclient/models/evaluator_list_output.py +198 -0
  41. root/generated/openapi_aclient/models/evaluator_reference.py +90 -0
  42. root/generated/openapi_aclient/models/evaluator_reference_request.py +90 -0
  43. root/generated/openapi_aclient/models/evaluator_request.py +194 -0
  44. root/generated/openapi_aclient/models/evaluator_result.py +110 -0
  45. root/generated/openapi_aclient/models/execution_log_details.py +291 -0
  46. root/generated/openapi_aclient/models/execution_log_details_evaluation_context.py +83 -0
  47. root/generated/openapi_aclient/models/execution_log_details_evaluator_latencies_inner.py +83 -0
  48. root/generated/openapi_aclient/models/execution_log_list.py +217 -0
  49. root/generated/openapi_aclient/models/execution_log_list_evaluation_context.py +83 -0
  50. root/generated/openapi_aclient/models/generation_model_params_request.py +93 -0
  51. root/generated/openapi_aclient/models/id.py +87 -0
  52. root/generated/openapi_aclient/models/input_variable.py +121 -0
  53. root/generated/openapi_aclient/models/input_variable_request.py +82 -0
  54. root/generated/openapi_aclient/models/judge.py +178 -0
  55. root/generated/openapi_aclient/models/judge_execution_request.py +114 -0
  56. root/generated/openapi_aclient/models/judge_execution_response.py +97 -0
  57. root/generated/openapi_aclient/models/judge_files_inner.py +84 -0
  58. root/generated/openapi_aclient/models/judge_generator_request.py +142 -0
  59. root/generated/openapi_aclient/models/judge_generator_response.py +88 -0
  60. root/generated/openapi_aclient/models/judge_invite_request.py +87 -0
  61. root/generated/openapi_aclient/models/judge_list.py +156 -0
  62. root/generated/openapi_aclient/models/judge_rectifier_request_request.py +114 -0
  63. root/generated/openapi_aclient/models/judge_rectifier_response.py +121 -0
  64. root/generated/openapi_aclient/models/judge_request.py +108 -0
  65. root/generated/openapi_aclient/models/model.py +126 -0
  66. root/generated/openapi_aclient/models/model_list.py +115 -0
  67. root/generated/openapi_aclient/models/model_params.py +89 -0
  68. root/generated/openapi_aclient/models/model_params_request.py +89 -0
  69. root/generated/openapi_aclient/models/model_request.py +118 -0
  70. root/generated/openapi_aclient/models/nested_evaluator.py +110 -0
  71. root/generated/openapi_aclient/models/nested_evaluator_objective.py +87 -0
  72. root/generated/openapi_aclient/models/nested_evaluator_request.py +92 -0
  73. root/generated/openapi_aclient/models/nested_objective_evaluator.py +105 -0
  74. root/generated/openapi_aclient/models/nested_objective_evaluator_request.py +92 -0
  75. root/generated/openapi_aclient/models/nested_objective_list.py +111 -0
  76. root/generated/openapi_aclient/models/nested_user_details.py +88 -0
  77. root/generated/openapi_aclient/models/nested_user_details_request.py +82 -0
  78. root/generated/openapi_aclient/models/nested_vector_objective.py +88 -0
  79. root/generated/openapi_aclient/models/nested_vector_objective_request.py +82 -0
  80. root/generated/openapi_aclient/models/objective.py +157 -0
  81. root/generated/openapi_aclient/models/objective_list.py +128 -0
  82. root/generated/openapi_aclient/models/objective_request.py +113 -0
  83. root/generated/openapi_aclient/models/objective_validator.py +100 -0
  84. root/generated/openapi_aclient/models/objective_validator_request.py +90 -0
  85. root/generated/openapi_aclient/models/paginated_data_set_list_list.py +111 -0
  86. root/generated/openapi_aclient/models/paginated_evaluator_list.py +111 -0
  87. root/generated/openapi_aclient/models/paginated_evaluator_list_output_list.py +111 -0
  88. root/generated/openapi_aclient/models/paginated_execution_log_list_list.py +111 -0
  89. root/generated/openapi_aclient/models/paginated_judge_list_list.py +111 -0
  90. root/generated/openapi_aclient/models/paginated_model_list_list.py +111 -0
  91. root/generated/openapi_aclient/models/paginated_objective_list.py +111 -0
  92. root/generated/openapi_aclient/models/paginated_objective_list_list.py +111 -0
  93. root/generated/openapi_aclient/models/patched_evaluator_request.py +194 -0
  94. root/generated/openapi_aclient/models/patched_judge_request.py +110 -0
  95. root/generated/openapi_aclient/models/patched_model_request.py +118 -0
  96. root/generated/openapi_aclient/models/patched_objective_request.py +113 -0
  97. root/generated/openapi_aclient/models/provider.py +99 -0
  98. root/generated/openapi_aclient/models/reference_variable.py +123 -0
  99. root/generated/openapi_aclient/models/reference_variable_request.py +83 -0
  100. root/generated/openapi_aclient/models/skill_execution_validator_result.py +130 -0
  101. root/generated/openapi_aclient/models/skill_test_data_request.py +107 -0
  102. root/generated/openapi_aclient/models/skill_test_data_request_dataset_range.py +93 -0
  103. root/generated/openapi_aclient/models/skill_test_input_request.py +171 -0
  104. root/generated/openapi_aclient/models/skill_type_enum.py +36 -0
  105. root/generated/openapi_aclient/models/status_change.py +84 -0
  106. root/generated/openapi_aclient/models/status_change_request.py +84 -0
  107. root/generated/openapi_aclient/models/status_change_status_enum.py +36 -0
  108. root/generated/openapi_aclient/models/status_enum.py +38 -0
  109. root/generated/openapi_aclient/models/validation_result_status.py +36 -0
  110. root/generated/openapi_aclient/models/visibility_enum.py +38 -0
  111. root/generated/openapi_aclient/rest.py +166 -0
  112. root/generated/openapi_aclient_README.md +239 -0
  113. root/generated/openapi_client/__init__.py +1 -0
  114. root/generated/openapi_client/api/__init__.py +1 -0
  115. root/generated/openapi_client/api/datasets_api.py +1274 -0
  116. root/generated/openapi_client/api/evaluators_api.py +3641 -0
  117. root/generated/openapi_client/api/execution_logs_api.py +751 -0
  118. root/generated/openapi_client/api/judges_api.py +3794 -0
  119. root/generated/openapi_client/api/models_api.py +1473 -0
  120. root/generated/openapi_client/api/objectives_api.py +1767 -0
  121. root/generated/openapi_client/api_client.py +659 -0
  122. root/generated/openapi_client/api_response.py +22 -0
  123. root/generated/openapi_client/configuration.py +474 -0
  124. root/generated/openapi_client/exceptions.py +197 -0
  125. root/generated/openapi_client/models/__init__.py +120 -0
  126. root/generated/openapi_client/models/data_set_create.py +118 -0
  127. root/generated/openapi_client/models/data_set_create_request.py +105 -0
  128. root/generated/openapi_client/models/data_set_list.py +129 -0
  129. root/generated/openapi_client/models/data_set_type.py +36 -0
  130. root/generated/openapi_client/models/dataset_range_request.py +93 -0
  131. root/generated/openapi_client/models/evaluator.py +273 -0
  132. root/generated/openapi_client/models/evaluator_calibration_output.py +101 -0
  133. root/generated/openapi_client/models/evaluator_calibration_result.py +134 -0
  134. root/generated/openapi_client/models/evaluator_demonstrations.py +107 -0
  135. root/generated/openapi_client/models/evaluator_demonstrations_request.py +107 -0
  136. root/generated/openapi_client/models/evaluator_execution_function_parameter_property_request.py +86 -0
  137. root/generated/openapi_client/models/evaluator_execution_function_parameter_request.py +109 -0
  138. root/generated/openapi_client/models/evaluator_execution_function_parameter_type_enum.py +35 -0
  139. root/generated/openapi_client/models/evaluator_execution_function_request.py +99 -0
  140. root/generated/openapi_client/models/evaluator_execution_functions_request.py +98 -0
  141. root/generated/openapi_client/models/evaluator_execution_functions_type_enum.py +35 -0
  142. root/generated/openapi_client/models/evaluator_execution_request.py +134 -0
  143. root/generated/openapi_client/models/evaluator_execution_result.py +114 -0
  144. root/generated/openapi_client/models/evaluator_inputs_value.py +100 -0
  145. root/generated/openapi_client/models/evaluator_inputs_value_items.py +89 -0
  146. root/generated/openapi_client/models/evaluator_list_output.py +198 -0
  147. root/generated/openapi_client/models/evaluator_reference.py +90 -0
  148. root/generated/openapi_client/models/evaluator_reference_request.py +90 -0
  149. root/generated/openapi_client/models/evaluator_request.py +194 -0
  150. root/generated/openapi_client/models/evaluator_result.py +110 -0
  151. root/generated/openapi_client/models/execution_log_details.py +291 -0
  152. root/generated/openapi_client/models/execution_log_details_evaluation_context.py +83 -0
  153. root/generated/openapi_client/models/execution_log_details_evaluator_latencies_inner.py +83 -0
  154. root/generated/openapi_client/models/execution_log_list.py +215 -0
  155. root/generated/openapi_client/models/execution_log_list_evaluation_context.py +83 -0
  156. root/generated/openapi_client/models/generation_model_params_request.py +93 -0
  157. root/generated/openapi_client/models/id.py +87 -0
  158. root/generated/openapi_client/models/input_variable.py +121 -0
  159. root/generated/openapi_client/models/input_variable_request.py +82 -0
  160. root/generated/openapi_client/models/judge.py +178 -0
  161. root/generated/openapi_client/models/judge_execution_request.py +114 -0
  162. root/generated/openapi_client/models/judge_execution_response.py +97 -0
  163. root/generated/openapi_client/models/judge_files_inner.py +84 -0
  164. root/generated/openapi_client/models/judge_generator_request.py +142 -0
  165. root/generated/openapi_client/models/judge_generator_response.py +88 -0
  166. root/generated/openapi_client/models/judge_invite_request.py +87 -0
  167. root/generated/openapi_client/models/judge_list.py +156 -0
  168. root/generated/openapi_client/models/judge_rectifier_request_request.py +114 -0
  169. root/generated/openapi_client/models/judge_rectifier_response.py +121 -0
  170. root/generated/openapi_client/models/judge_request.py +108 -0
  171. root/generated/openapi_client/models/model.py +126 -0
  172. root/generated/openapi_client/models/model_list.py +115 -0
  173. root/generated/openapi_client/models/model_params.py +89 -0
  174. root/generated/openapi_client/models/model_params_request.py +89 -0
  175. root/generated/openapi_client/models/model_request.py +118 -0
  176. root/generated/openapi_client/models/nested_evaluator.py +110 -0
  177. root/generated/openapi_client/models/nested_evaluator_objective.py +87 -0
  178. root/generated/openapi_client/models/nested_evaluator_request.py +92 -0
  179. root/generated/openapi_client/models/nested_objective_evaluator.py +105 -0
  180. root/generated/openapi_client/models/nested_objective_evaluator_request.py +92 -0
  181. root/generated/openapi_client/models/nested_objective_list.py +111 -0
  182. root/generated/openapi_client/models/nested_user_details.py +88 -0
  183. root/generated/openapi_client/models/nested_user_details_request.py +82 -0
  184. root/generated/openapi_client/models/nested_vector_objective.py +88 -0
  185. root/generated/openapi_client/models/nested_vector_objective_request.py +82 -0
  186. root/generated/openapi_client/models/objective.py +157 -0
  187. root/generated/openapi_client/models/objective_list.py +128 -0
  188. root/generated/openapi_client/models/objective_request.py +113 -0
  189. root/generated/openapi_client/models/objective_validator.py +100 -0
  190. root/generated/openapi_client/models/objective_validator_request.py +90 -0
  191. root/generated/openapi_client/models/paginated_data_set_list_list.py +111 -0
  192. root/generated/openapi_client/models/paginated_evaluator_list.py +111 -0
  193. root/generated/openapi_client/models/paginated_evaluator_list_output_list.py +111 -0
  194. root/generated/openapi_client/models/paginated_execution_log_list_list.py +111 -0
  195. root/generated/openapi_client/models/paginated_judge_list_list.py +111 -0
  196. root/generated/openapi_client/models/paginated_model_list_list.py +111 -0
  197. root/generated/openapi_client/models/paginated_objective_list.py +111 -0
  198. root/generated/openapi_client/models/paginated_objective_list_list.py +111 -0
  199. root/generated/openapi_client/models/patched_evaluator_request.py +194 -0
  200. root/generated/openapi_client/models/patched_judge_request.py +110 -0
  201. root/generated/openapi_client/models/patched_model_request.py +118 -0
  202. root/generated/openapi_client/models/patched_objective_request.py +113 -0
  203. root/generated/openapi_client/models/provider.py +99 -0
  204. root/generated/openapi_client/models/reference_variable.py +123 -0
  205. root/generated/openapi_client/models/reference_variable_request.py +83 -0
  206. root/generated/openapi_client/models/skill_execution_validator_result.py +130 -0
  207. root/generated/openapi_client/models/skill_test_data_request.py +107 -0
  208. root/generated/openapi_client/models/skill_test_data_request_dataset_range.py +93 -0
  209. root/generated/openapi_client/models/skill_test_input_request.py +171 -0
  210. root/generated/openapi_client/models/skill_type_enum.py +36 -0
  211. root/generated/openapi_client/models/status_change.py +84 -0
  212. root/generated/openapi_client/models/status_change_request.py +84 -0
  213. root/generated/openapi_client/models/status_change_status_enum.py +36 -0
  214. root/generated/openapi_client/models/status_enum.py +38 -0
  215. root/generated/openapi_client/models/validation_result_status.py +36 -0
  216. root/generated/openapi_client/models/visibility_enum.py +38 -0
  217. root/generated/openapi_client/rest.py +203 -0
  218. root/generated/openapi_client_README.md +238 -0
  219. root/judges.py +681 -0
  220. root/models.py +197 -0
  221. root/objectives.py +343 -0
  222. root/py.typed +0 -0
  223. root/skills.py +1707 -0
  224. root/utils.py +90 -0
  225. scorable-1.6.4.dist-info/METADATA +395 -0
  226. scorable-1.6.4.dist-info/RECORD +228 -0
  227. scorable-1.6.4.dist-info/WHEEL +4 -0
  228. scorable-1.6.4.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,1473 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Root Signals API
5
+
6
+ Root Signals JSON API provides a way to access Root Signals using provisioned API token
7
+
8
+ The version of the OpenAPI document: 1.0.0 (latest)
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+
17
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
+ from typing_extensions import Annotated
19
+
20
+ from root.generated.openapi_client.api_client import ApiClient, RequestSerialized
21
+ from root.generated.openapi_client.api_response import ApiResponse
22
+ from root.generated.openapi_client.models.model import Model
23
+ from root.generated.openapi_client.models.model_request import ModelRequest
24
+ from root.generated.openapi_client.models.paginated_model_list_list import PaginatedModelListList
25
+ from root.generated.openapi_client.models.patched_model_request import PatchedModelRequest
26
+ from root.generated.openapi_client.rest import RESTResponseType
27
+
28
+
29
+ class ModelsApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+ @validate_call
42
+ def models_create(
43
+ self,
44
+ model_request: ModelRequest,
45
+ _request_timeout: Union[
46
+ None,
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
49
+ ] = None,
50
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
51
+ _content_type: Optional[StrictStr] = None,
52
+ _headers: Optional[Dict[StrictStr, Any]] = None,
53
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
54
+ ) -> Model:
55
+ """models_create
56
+
57
+ Create a custom LLM model.
58
+
59
+ :param model_request: (required)
60
+ :type model_request: ModelRequest
61
+ :param _request_timeout: timeout setting for this request. If one
62
+ number provided, it will be total request
63
+ timeout. It can also be a pair (tuple) of
64
+ (connection, read) timeouts.
65
+ :type _request_timeout: int, tuple(int, int), optional
66
+ :param _request_auth: set to override the auth_settings for an a single
67
+ request; this effectively ignores the
68
+ authentication in the spec for a single request.
69
+ :type _request_auth: dict, optional
70
+ :param _content_type: force content-type for the request.
71
+ :type _content_type: str, Optional
72
+ :param _headers: set to override the headers for a single
73
+ request; this effectively ignores the headers
74
+ in the spec for a single request.
75
+ :type _headers: dict, optional
76
+ :param _host_index: set to override the host_index for a single
77
+ request; this effectively ignores the host_index
78
+ in the spec for a single request.
79
+ :type _host_index: int, optional
80
+ :return: Returns the result object.
81
+ """ # noqa: E501
82
+
83
+ _param = self._models_create_serialize(
84
+ model_request=model_request,
85
+ _request_auth=_request_auth,
86
+ _content_type=_content_type,
87
+ _headers=_headers,
88
+ _host_index=_host_index,
89
+ )
90
+
91
+ _response_types_map: Dict[str, Optional[str]] = {
92
+ "201": "Model",
93
+ }
94
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
95
+ response_data.read()
96
+ return self.api_client.response_deserialize(
97
+ response_data=response_data,
98
+ response_types_map=_response_types_map,
99
+ ).data
100
+
101
+ @validate_call
102
+ def models_create_with_http_info(
103
+ self,
104
+ model_request: ModelRequest,
105
+ _request_timeout: Union[
106
+ None,
107
+ Annotated[StrictFloat, Field(gt=0)],
108
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
109
+ ] = None,
110
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
111
+ _content_type: Optional[StrictStr] = None,
112
+ _headers: Optional[Dict[StrictStr, Any]] = None,
113
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
114
+ ) -> ApiResponse[Model]:
115
+ """models_create
116
+
117
+ Create a custom LLM model.
118
+
119
+ :param model_request: (required)
120
+ :type model_request: ModelRequest
121
+ :param _request_timeout: timeout setting for this request. If one
122
+ number provided, it will be total request
123
+ timeout. It can also be a pair (tuple) of
124
+ (connection, read) timeouts.
125
+ :type _request_timeout: int, tuple(int, int), optional
126
+ :param _request_auth: set to override the auth_settings for an a single
127
+ request; this effectively ignores the
128
+ authentication in the spec for a single request.
129
+ :type _request_auth: dict, optional
130
+ :param _content_type: force content-type for the request.
131
+ :type _content_type: str, Optional
132
+ :param _headers: set to override the headers for a single
133
+ request; this effectively ignores the headers
134
+ in the spec for a single request.
135
+ :type _headers: dict, optional
136
+ :param _host_index: set to override the host_index for a single
137
+ request; this effectively ignores the host_index
138
+ in the spec for a single request.
139
+ :type _host_index: int, optional
140
+ :return: Returns the result object.
141
+ """ # noqa: E501
142
+
143
+ _param = self._models_create_serialize(
144
+ model_request=model_request,
145
+ _request_auth=_request_auth,
146
+ _content_type=_content_type,
147
+ _headers=_headers,
148
+ _host_index=_host_index,
149
+ )
150
+
151
+ _response_types_map: Dict[str, Optional[str]] = {
152
+ "201": "Model",
153
+ }
154
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
155
+ response_data.read()
156
+ return self.api_client.response_deserialize(
157
+ response_data=response_data,
158
+ response_types_map=_response_types_map,
159
+ )
160
+
161
+ @validate_call
162
+ def models_create_without_preload_content(
163
+ self,
164
+ model_request: ModelRequest,
165
+ _request_timeout: Union[
166
+ None,
167
+ Annotated[StrictFloat, Field(gt=0)],
168
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
169
+ ] = None,
170
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
171
+ _content_type: Optional[StrictStr] = None,
172
+ _headers: Optional[Dict[StrictStr, Any]] = None,
173
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
174
+ ) -> RESTResponseType:
175
+ """models_create
176
+
177
+ Create a custom LLM model.
178
+
179
+ :param model_request: (required)
180
+ :type model_request: ModelRequest
181
+ :param _request_timeout: timeout setting for this request. If one
182
+ number provided, it will be total request
183
+ timeout. It can also be a pair (tuple) of
184
+ (connection, read) timeouts.
185
+ :type _request_timeout: int, tuple(int, int), optional
186
+ :param _request_auth: set to override the auth_settings for an a single
187
+ request; this effectively ignores the
188
+ authentication in the spec for a single request.
189
+ :type _request_auth: dict, optional
190
+ :param _content_type: force content-type for the request.
191
+ :type _content_type: str, Optional
192
+ :param _headers: set to override the headers for a single
193
+ request; this effectively ignores the headers
194
+ in the spec for a single request.
195
+ :type _headers: dict, optional
196
+ :param _host_index: set to override the host_index for a single
197
+ request; this effectively ignores the host_index
198
+ in the spec for a single request.
199
+ :type _host_index: int, optional
200
+ :return: Returns the result object.
201
+ """ # noqa: E501
202
+
203
+ _param = self._models_create_serialize(
204
+ model_request=model_request,
205
+ _request_auth=_request_auth,
206
+ _content_type=_content_type,
207
+ _headers=_headers,
208
+ _host_index=_host_index,
209
+ )
210
+
211
+ _response_types_map: Dict[str, Optional[str]] = {
212
+ "201": "Model",
213
+ }
214
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
215
+ return response_data.response
216
+
217
+ def _models_create_serialize(
218
+ self,
219
+ model_request,
220
+ _request_auth,
221
+ _content_type,
222
+ _headers,
223
+ _host_index,
224
+ ) -> RequestSerialized:
225
+ _host = None
226
+
227
+ _collection_formats: Dict[str, str] = {}
228
+
229
+ _path_params: Dict[str, str] = {}
230
+ _query_params: List[Tuple[str, str]] = []
231
+ _header_params: Dict[str, Optional[str]] = _headers or {}
232
+ _form_params: List[Tuple[str, str]] = []
233
+ _files: Dict[str, str] = {}
234
+ _body_params: Optional[bytes] = None
235
+
236
+ # process the path parameters
237
+ # process the query parameters
238
+ # process the header parameters
239
+ # process the form parameters
240
+ # process the body parameter
241
+ if model_request is not None:
242
+ _body_params = model_request
243
+
244
+ # set the HTTP header `Accept`
245
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
246
+
247
+ # set the HTTP header `Content-Type`
248
+ if _content_type:
249
+ _header_params["Content-Type"] = _content_type
250
+ else:
251
+ _default_content_type = self.api_client.select_header_content_type(
252
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
253
+ )
254
+ if _default_content_type is not None:
255
+ _header_params["Content-Type"] = _default_content_type
256
+
257
+ # authentication setting
258
+ _auth_settings: List[str] = ["publicApiKey"]
259
+
260
+ return self.api_client.param_serialize(
261
+ method="POST",
262
+ resource_path="/v1/models/",
263
+ path_params=_path_params,
264
+ query_params=_query_params,
265
+ header_params=_header_params,
266
+ body=_body_params,
267
+ post_params=_form_params,
268
+ files=_files,
269
+ auth_settings=_auth_settings,
270
+ collection_formats=_collection_formats,
271
+ _host=_host,
272
+ _request_auth=_request_auth,
273
+ )
274
+
275
+ @validate_call
276
+ def models_destroy(
277
+ self,
278
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
279
+ _request_timeout: Union[
280
+ None,
281
+ Annotated[StrictFloat, Field(gt=0)],
282
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
283
+ ] = None,
284
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
285
+ _content_type: Optional[StrictStr] = None,
286
+ _headers: Optional[Dict[StrictStr, Any]] = None,
287
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
288
+ ) -> None:
289
+ """models_destroy
290
+
291
+
292
+ :param id: A UUID string identifying this model. (required)
293
+ :type id: str
294
+ :param _request_timeout: timeout setting for this request. If one
295
+ number provided, it will be total request
296
+ timeout. It can also be a pair (tuple) of
297
+ (connection, read) timeouts.
298
+ :type _request_timeout: int, tuple(int, int), optional
299
+ :param _request_auth: set to override the auth_settings for an a single
300
+ request; this effectively ignores the
301
+ authentication in the spec for a single request.
302
+ :type _request_auth: dict, optional
303
+ :param _content_type: force content-type for the request.
304
+ :type _content_type: str, Optional
305
+ :param _headers: set to override the headers for a single
306
+ request; this effectively ignores the headers
307
+ in the spec for a single request.
308
+ :type _headers: dict, optional
309
+ :param _host_index: set to override the host_index for a single
310
+ request; this effectively ignores the host_index
311
+ in the spec for a single request.
312
+ :type _host_index: int, optional
313
+ :return: Returns the result object.
314
+ """ # noqa: E501
315
+
316
+ _param = self._models_destroy_serialize(
317
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
318
+ )
319
+
320
+ _response_types_map: Dict[str, Optional[str]] = {
321
+ "204": None,
322
+ }
323
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
324
+ response_data.read()
325
+ return self.api_client.response_deserialize(
326
+ response_data=response_data,
327
+ response_types_map=_response_types_map,
328
+ ).data
329
+
330
+ @validate_call
331
+ def models_destroy_with_http_info(
332
+ self,
333
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
334
+ _request_timeout: Union[
335
+ None,
336
+ Annotated[StrictFloat, Field(gt=0)],
337
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
338
+ ] = None,
339
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
340
+ _content_type: Optional[StrictStr] = None,
341
+ _headers: Optional[Dict[StrictStr, Any]] = None,
342
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
343
+ ) -> ApiResponse[None]:
344
+ """models_destroy
345
+
346
+
347
+ :param id: A UUID string identifying this model. (required)
348
+ :type id: str
349
+ :param _request_timeout: timeout setting for this request. If one
350
+ number provided, it will be total request
351
+ timeout. It can also be a pair (tuple) of
352
+ (connection, read) timeouts.
353
+ :type _request_timeout: int, tuple(int, int), optional
354
+ :param _request_auth: set to override the auth_settings for an a single
355
+ request; this effectively ignores the
356
+ authentication in the spec for a single request.
357
+ :type _request_auth: dict, optional
358
+ :param _content_type: force content-type for the request.
359
+ :type _content_type: str, Optional
360
+ :param _headers: set to override the headers for a single
361
+ request; this effectively ignores the headers
362
+ in the spec for a single request.
363
+ :type _headers: dict, optional
364
+ :param _host_index: set to override the host_index for a single
365
+ request; this effectively ignores the host_index
366
+ in the spec for a single request.
367
+ :type _host_index: int, optional
368
+ :return: Returns the result object.
369
+ """ # noqa: E501
370
+
371
+ _param = self._models_destroy_serialize(
372
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
373
+ )
374
+
375
+ _response_types_map: Dict[str, Optional[str]] = {
376
+ "204": None,
377
+ }
378
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
379
+ response_data.read()
380
+ return self.api_client.response_deserialize(
381
+ response_data=response_data,
382
+ response_types_map=_response_types_map,
383
+ )
384
+
385
+ @validate_call
386
+ def models_destroy_without_preload_content(
387
+ self,
388
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
389
+ _request_timeout: Union[
390
+ None,
391
+ Annotated[StrictFloat, Field(gt=0)],
392
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
393
+ ] = None,
394
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
395
+ _content_type: Optional[StrictStr] = None,
396
+ _headers: Optional[Dict[StrictStr, Any]] = None,
397
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
398
+ ) -> RESTResponseType:
399
+ """models_destroy
400
+
401
+
402
+ :param id: A UUID string identifying this model. (required)
403
+ :type id: str
404
+ :param _request_timeout: timeout setting for this request. If one
405
+ number provided, it will be total request
406
+ timeout. It can also be a pair (tuple) of
407
+ (connection, read) timeouts.
408
+ :type _request_timeout: int, tuple(int, int), optional
409
+ :param _request_auth: set to override the auth_settings for an a single
410
+ request; this effectively ignores the
411
+ authentication in the spec for a single request.
412
+ :type _request_auth: dict, optional
413
+ :param _content_type: force content-type for the request.
414
+ :type _content_type: str, Optional
415
+ :param _headers: set to override the headers for a single
416
+ request; this effectively ignores the headers
417
+ in the spec for a single request.
418
+ :type _headers: dict, optional
419
+ :param _host_index: set to override the host_index for a single
420
+ request; this effectively ignores the host_index
421
+ in the spec for a single request.
422
+ :type _host_index: int, optional
423
+ :return: Returns the result object.
424
+ """ # noqa: E501
425
+
426
+ _param = self._models_destroy_serialize(
427
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
428
+ )
429
+
430
+ _response_types_map: Dict[str, Optional[str]] = {
431
+ "204": None,
432
+ }
433
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
434
+ return response_data.response
435
+
436
+ def _models_destroy_serialize(
437
+ self,
438
+ id,
439
+ _request_auth,
440
+ _content_type,
441
+ _headers,
442
+ _host_index,
443
+ ) -> RequestSerialized:
444
+ _host = None
445
+
446
+ _collection_formats: Dict[str, str] = {}
447
+
448
+ _path_params: Dict[str, str] = {}
449
+ _query_params: List[Tuple[str, str]] = []
450
+ _header_params: Dict[str, Optional[str]] = _headers or {}
451
+ _form_params: List[Tuple[str, str]] = []
452
+ _files: Dict[str, str] = {}
453
+ _body_params: Optional[bytes] = None
454
+
455
+ # process the path parameters
456
+ if id is not None:
457
+ _path_params["id"] = id
458
+ # process the query parameters
459
+ # process the header parameters
460
+ # process the form parameters
461
+ # process the body parameter
462
+
463
+ # authentication setting
464
+ _auth_settings: List[str] = ["publicApiKey"]
465
+
466
+ return self.api_client.param_serialize(
467
+ method="DELETE",
468
+ resource_path="/v1/models/{id}/",
469
+ path_params=_path_params,
470
+ query_params=_query_params,
471
+ header_params=_header_params,
472
+ body=_body_params,
473
+ post_params=_form_params,
474
+ files=_files,
475
+ auth_settings=_auth_settings,
476
+ collection_formats=_collection_formats,
477
+ _host=_host,
478
+ _request_auth=_request_auth,
479
+ )
480
+
481
+ @validate_call
482
+ def models_list(
483
+ self,
484
+ capable_of: Annotated[
485
+ Optional[List[StrictStr]], Field(description="Search for models by capabilities.")
486
+ ] = None,
487
+ cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None,
488
+ ordering: Annotated[
489
+ Optional[StrictStr], Field(description="Which field to use when ordering the results.")
490
+ ] = None,
491
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
492
+ _request_timeout: Union[
493
+ None,
494
+ Annotated[StrictFloat, Field(gt=0)],
495
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
496
+ ] = None,
497
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
498
+ _content_type: Optional[StrictStr] = None,
499
+ _headers: Optional[Dict[StrictStr, Any]] = None,
500
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
501
+ ) -> PaginatedModelListList:
502
+ """models_list
503
+
504
+ Get all available LLM models.
505
+
506
+ :param capable_of: Search for models by capabilities.
507
+ :type capable_of: List[str]
508
+ :param cursor: The pagination cursor value.
509
+ :type cursor: str
510
+ :param ordering: Which field to use when ordering the results.
511
+ :type ordering: str
512
+ :param page_size: Number of results to return per page.
513
+ :type page_size: int
514
+ :param _request_timeout: timeout setting for this request. If one
515
+ number provided, it will be total request
516
+ timeout. It can also be a pair (tuple) of
517
+ (connection, read) timeouts.
518
+ :type _request_timeout: int, tuple(int, int), optional
519
+ :param _request_auth: set to override the auth_settings for an a single
520
+ request; this effectively ignores the
521
+ authentication in the spec for a single request.
522
+ :type _request_auth: dict, optional
523
+ :param _content_type: force content-type for the request.
524
+ :type _content_type: str, Optional
525
+ :param _headers: set to override the headers for a single
526
+ request; this effectively ignores the headers
527
+ in the spec for a single request.
528
+ :type _headers: dict, optional
529
+ :param _host_index: set to override the host_index for a single
530
+ request; this effectively ignores the host_index
531
+ in the spec for a single request.
532
+ :type _host_index: int, optional
533
+ :return: Returns the result object.
534
+ """ # noqa: E501
535
+
536
+ _param = self._models_list_serialize(
537
+ capable_of=capable_of,
538
+ cursor=cursor,
539
+ ordering=ordering,
540
+ page_size=page_size,
541
+ _request_auth=_request_auth,
542
+ _content_type=_content_type,
543
+ _headers=_headers,
544
+ _host_index=_host_index,
545
+ )
546
+
547
+ _response_types_map: Dict[str, Optional[str]] = {
548
+ "200": "PaginatedModelListList",
549
+ }
550
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
551
+ response_data.read()
552
+ return self.api_client.response_deserialize(
553
+ response_data=response_data,
554
+ response_types_map=_response_types_map,
555
+ ).data
556
+
557
+ @validate_call
558
+ def models_list_with_http_info(
559
+ self,
560
+ capable_of: Annotated[
561
+ Optional[List[StrictStr]], Field(description="Search for models by capabilities.")
562
+ ] = None,
563
+ cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None,
564
+ ordering: Annotated[
565
+ Optional[StrictStr], Field(description="Which field to use when ordering the results.")
566
+ ] = None,
567
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
568
+ _request_timeout: Union[
569
+ None,
570
+ Annotated[StrictFloat, Field(gt=0)],
571
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
572
+ ] = None,
573
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
574
+ _content_type: Optional[StrictStr] = None,
575
+ _headers: Optional[Dict[StrictStr, Any]] = None,
576
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
577
+ ) -> ApiResponse[PaginatedModelListList]:
578
+ """models_list
579
+
580
+ Get all available LLM models.
581
+
582
+ :param capable_of: Search for models by capabilities.
583
+ :type capable_of: List[str]
584
+ :param cursor: The pagination cursor value.
585
+ :type cursor: str
586
+ :param ordering: Which field to use when ordering the results.
587
+ :type ordering: str
588
+ :param page_size: Number of results to return per page.
589
+ :type page_size: int
590
+ :param _request_timeout: timeout setting for this request. If one
591
+ number provided, it will be total request
592
+ timeout. It can also be a pair (tuple) of
593
+ (connection, read) timeouts.
594
+ :type _request_timeout: int, tuple(int, int), optional
595
+ :param _request_auth: set to override the auth_settings for an a single
596
+ request; this effectively ignores the
597
+ authentication in the spec for a single request.
598
+ :type _request_auth: dict, optional
599
+ :param _content_type: force content-type for the request.
600
+ :type _content_type: str, Optional
601
+ :param _headers: set to override the headers for a single
602
+ request; this effectively ignores the headers
603
+ in the spec for a single request.
604
+ :type _headers: dict, optional
605
+ :param _host_index: set to override the host_index for a single
606
+ request; this effectively ignores the host_index
607
+ in the spec for a single request.
608
+ :type _host_index: int, optional
609
+ :return: Returns the result object.
610
+ """ # noqa: E501
611
+
612
+ _param = self._models_list_serialize(
613
+ capable_of=capable_of,
614
+ cursor=cursor,
615
+ ordering=ordering,
616
+ page_size=page_size,
617
+ _request_auth=_request_auth,
618
+ _content_type=_content_type,
619
+ _headers=_headers,
620
+ _host_index=_host_index,
621
+ )
622
+
623
+ _response_types_map: Dict[str, Optional[str]] = {
624
+ "200": "PaginatedModelListList",
625
+ }
626
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
627
+ response_data.read()
628
+ return self.api_client.response_deserialize(
629
+ response_data=response_data,
630
+ response_types_map=_response_types_map,
631
+ )
632
+
633
+ @validate_call
634
+ def models_list_without_preload_content(
635
+ self,
636
+ capable_of: Annotated[
637
+ Optional[List[StrictStr]], Field(description="Search for models by capabilities.")
638
+ ] = None,
639
+ cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None,
640
+ ordering: Annotated[
641
+ Optional[StrictStr], Field(description="Which field to use when ordering the results.")
642
+ ] = None,
643
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
644
+ _request_timeout: Union[
645
+ None,
646
+ Annotated[StrictFloat, Field(gt=0)],
647
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
648
+ ] = None,
649
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
650
+ _content_type: Optional[StrictStr] = None,
651
+ _headers: Optional[Dict[StrictStr, Any]] = None,
652
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
653
+ ) -> RESTResponseType:
654
+ """models_list
655
+
656
+ Get all available LLM models.
657
+
658
+ :param capable_of: Search for models by capabilities.
659
+ :type capable_of: List[str]
660
+ :param cursor: The pagination cursor value.
661
+ :type cursor: str
662
+ :param ordering: Which field to use when ordering the results.
663
+ :type ordering: str
664
+ :param page_size: Number of results to return per page.
665
+ :type page_size: int
666
+ :param _request_timeout: timeout setting for this request. If one
667
+ number provided, it will be total request
668
+ timeout. It can also be a pair (tuple) of
669
+ (connection, read) timeouts.
670
+ :type _request_timeout: int, tuple(int, int), optional
671
+ :param _request_auth: set to override the auth_settings for an a single
672
+ request; this effectively ignores the
673
+ authentication in the spec for a single request.
674
+ :type _request_auth: dict, optional
675
+ :param _content_type: force content-type for the request.
676
+ :type _content_type: str, Optional
677
+ :param _headers: set to override the headers for a single
678
+ request; this effectively ignores the headers
679
+ in the spec for a single request.
680
+ :type _headers: dict, optional
681
+ :param _host_index: set to override the host_index for a single
682
+ request; this effectively ignores the host_index
683
+ in the spec for a single request.
684
+ :type _host_index: int, optional
685
+ :return: Returns the result object.
686
+ """ # noqa: E501
687
+
688
+ _param = self._models_list_serialize(
689
+ capable_of=capable_of,
690
+ cursor=cursor,
691
+ ordering=ordering,
692
+ page_size=page_size,
693
+ _request_auth=_request_auth,
694
+ _content_type=_content_type,
695
+ _headers=_headers,
696
+ _host_index=_host_index,
697
+ )
698
+
699
+ _response_types_map: Dict[str, Optional[str]] = {
700
+ "200": "PaginatedModelListList",
701
+ }
702
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
703
+ return response_data.response
704
+
705
+ def _models_list_serialize(
706
+ self,
707
+ capable_of,
708
+ cursor,
709
+ ordering,
710
+ page_size,
711
+ _request_auth,
712
+ _content_type,
713
+ _headers,
714
+ _host_index,
715
+ ) -> RequestSerialized:
716
+ _host = None
717
+
718
+ _collection_formats: Dict[str, str] = {
719
+ "capable_of": "csv",
720
+ }
721
+
722
+ _path_params: Dict[str, str] = {}
723
+ _query_params: List[Tuple[str, str]] = []
724
+ _header_params: Dict[str, Optional[str]] = _headers or {}
725
+ _form_params: List[Tuple[str, str]] = []
726
+ _files: Dict[str, str] = {}
727
+ _body_params: Optional[bytes] = None
728
+
729
+ # process the path parameters
730
+ # process the query parameters
731
+ if capable_of is not None:
732
+ _query_params.append(("capable_of", capable_of))
733
+
734
+ if cursor is not None:
735
+ _query_params.append(("cursor", cursor))
736
+
737
+ if ordering is not None:
738
+ _query_params.append(("ordering", ordering))
739
+
740
+ if page_size is not None:
741
+ _query_params.append(("page_size", page_size))
742
+
743
+ # process the header parameters
744
+ # process the form parameters
745
+ # process the body parameter
746
+
747
+ # set the HTTP header `Accept`
748
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
749
+
750
+ # authentication setting
751
+ _auth_settings: List[str] = ["publicApiKey"]
752
+
753
+ return self.api_client.param_serialize(
754
+ method="GET",
755
+ resource_path="/v1/models/",
756
+ path_params=_path_params,
757
+ query_params=_query_params,
758
+ header_params=_header_params,
759
+ body=_body_params,
760
+ post_params=_form_params,
761
+ files=_files,
762
+ auth_settings=_auth_settings,
763
+ collection_formats=_collection_formats,
764
+ _host=_host,
765
+ _request_auth=_request_auth,
766
+ )
767
+
768
+ @validate_call
769
+ def models_partial_update(
770
+ self,
771
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
772
+ patched_model_request: Optional[PatchedModelRequest] = None,
773
+ _request_timeout: Union[
774
+ None,
775
+ Annotated[StrictFloat, Field(gt=0)],
776
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
777
+ ] = None,
778
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
779
+ _content_type: Optional[StrictStr] = None,
780
+ _headers: Optional[Dict[StrictStr, Any]] = None,
781
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
782
+ ) -> Model:
783
+ """models_partial_update
784
+
785
+
786
+ :param id: A UUID string identifying this model. (required)
787
+ :type id: str
788
+ :param patched_model_request:
789
+ :type patched_model_request: PatchedModelRequest
790
+ :param _request_timeout: timeout setting for this request. If one
791
+ number provided, it will be total request
792
+ timeout. It can also be a pair (tuple) of
793
+ (connection, read) timeouts.
794
+ :type _request_timeout: int, tuple(int, int), optional
795
+ :param _request_auth: set to override the auth_settings for an a single
796
+ request; this effectively ignores the
797
+ authentication in the spec for a single request.
798
+ :type _request_auth: dict, optional
799
+ :param _content_type: force content-type for the request.
800
+ :type _content_type: str, Optional
801
+ :param _headers: set to override the headers for a single
802
+ request; this effectively ignores the headers
803
+ in the spec for a single request.
804
+ :type _headers: dict, optional
805
+ :param _host_index: set to override the host_index for a single
806
+ request; this effectively ignores the host_index
807
+ in the spec for a single request.
808
+ :type _host_index: int, optional
809
+ :return: Returns the result object.
810
+ """ # noqa: E501
811
+
812
+ _param = self._models_partial_update_serialize(
813
+ id=id,
814
+ patched_model_request=patched_model_request,
815
+ _request_auth=_request_auth,
816
+ _content_type=_content_type,
817
+ _headers=_headers,
818
+ _host_index=_host_index,
819
+ )
820
+
821
+ _response_types_map: Dict[str, Optional[str]] = {
822
+ "200": "Model",
823
+ }
824
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
825
+ response_data.read()
826
+ return self.api_client.response_deserialize(
827
+ response_data=response_data,
828
+ response_types_map=_response_types_map,
829
+ ).data
830
+
831
+ @validate_call
832
+ def models_partial_update_with_http_info(
833
+ self,
834
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
835
+ patched_model_request: Optional[PatchedModelRequest] = None,
836
+ _request_timeout: Union[
837
+ None,
838
+ Annotated[StrictFloat, Field(gt=0)],
839
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
840
+ ] = None,
841
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
842
+ _content_type: Optional[StrictStr] = None,
843
+ _headers: Optional[Dict[StrictStr, Any]] = None,
844
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
845
+ ) -> ApiResponse[Model]:
846
+ """models_partial_update
847
+
848
+
849
+ :param id: A UUID string identifying this model. (required)
850
+ :type id: str
851
+ :param patched_model_request:
852
+ :type patched_model_request: PatchedModelRequest
853
+ :param _request_timeout: timeout setting for this request. If one
854
+ number provided, it will be total request
855
+ timeout. It can also be a pair (tuple) of
856
+ (connection, read) timeouts.
857
+ :type _request_timeout: int, tuple(int, int), optional
858
+ :param _request_auth: set to override the auth_settings for an a single
859
+ request; this effectively ignores the
860
+ authentication in the spec for a single request.
861
+ :type _request_auth: dict, optional
862
+ :param _content_type: force content-type for the request.
863
+ :type _content_type: str, Optional
864
+ :param _headers: set to override the headers for a single
865
+ request; this effectively ignores the headers
866
+ in the spec for a single request.
867
+ :type _headers: dict, optional
868
+ :param _host_index: set to override the host_index for a single
869
+ request; this effectively ignores the host_index
870
+ in the spec for a single request.
871
+ :type _host_index: int, optional
872
+ :return: Returns the result object.
873
+ """ # noqa: E501
874
+
875
+ _param = self._models_partial_update_serialize(
876
+ id=id,
877
+ patched_model_request=patched_model_request,
878
+ _request_auth=_request_auth,
879
+ _content_type=_content_type,
880
+ _headers=_headers,
881
+ _host_index=_host_index,
882
+ )
883
+
884
+ _response_types_map: Dict[str, Optional[str]] = {
885
+ "200": "Model",
886
+ }
887
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
888
+ response_data.read()
889
+ return self.api_client.response_deserialize(
890
+ response_data=response_data,
891
+ response_types_map=_response_types_map,
892
+ )
893
+
894
+ @validate_call
895
+ def models_partial_update_without_preload_content(
896
+ self,
897
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
898
+ patched_model_request: Optional[PatchedModelRequest] = None,
899
+ _request_timeout: Union[
900
+ None,
901
+ Annotated[StrictFloat, Field(gt=0)],
902
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
903
+ ] = None,
904
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
905
+ _content_type: Optional[StrictStr] = None,
906
+ _headers: Optional[Dict[StrictStr, Any]] = None,
907
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
908
+ ) -> RESTResponseType:
909
+ """models_partial_update
910
+
911
+
912
+ :param id: A UUID string identifying this model. (required)
913
+ :type id: str
914
+ :param patched_model_request:
915
+ :type patched_model_request: PatchedModelRequest
916
+ :param _request_timeout: timeout setting for this request. If one
917
+ number provided, it will be total request
918
+ timeout. It can also be a pair (tuple) of
919
+ (connection, read) timeouts.
920
+ :type _request_timeout: int, tuple(int, int), optional
921
+ :param _request_auth: set to override the auth_settings for an a single
922
+ request; this effectively ignores the
923
+ authentication in the spec for a single request.
924
+ :type _request_auth: dict, optional
925
+ :param _content_type: force content-type for the request.
926
+ :type _content_type: str, Optional
927
+ :param _headers: set to override the headers for a single
928
+ request; this effectively ignores the headers
929
+ in the spec for a single request.
930
+ :type _headers: dict, optional
931
+ :param _host_index: set to override the host_index for a single
932
+ request; this effectively ignores the host_index
933
+ in the spec for a single request.
934
+ :type _host_index: int, optional
935
+ :return: Returns the result object.
936
+ """ # noqa: E501
937
+
938
+ _param = self._models_partial_update_serialize(
939
+ id=id,
940
+ patched_model_request=patched_model_request,
941
+ _request_auth=_request_auth,
942
+ _content_type=_content_type,
943
+ _headers=_headers,
944
+ _host_index=_host_index,
945
+ )
946
+
947
+ _response_types_map: Dict[str, Optional[str]] = {
948
+ "200": "Model",
949
+ }
950
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
951
+ return response_data.response
952
+
953
+ def _models_partial_update_serialize(
954
+ self,
955
+ id,
956
+ patched_model_request,
957
+ _request_auth,
958
+ _content_type,
959
+ _headers,
960
+ _host_index,
961
+ ) -> RequestSerialized:
962
+ _host = None
963
+
964
+ _collection_formats: Dict[str, str] = {}
965
+
966
+ _path_params: Dict[str, str] = {}
967
+ _query_params: List[Tuple[str, str]] = []
968
+ _header_params: Dict[str, Optional[str]] = _headers or {}
969
+ _form_params: List[Tuple[str, str]] = []
970
+ _files: Dict[str, str] = {}
971
+ _body_params: Optional[bytes] = None
972
+
973
+ # process the path parameters
974
+ if id is not None:
975
+ _path_params["id"] = id
976
+ # process the query parameters
977
+ # process the header parameters
978
+ # process the form parameters
979
+ # process the body parameter
980
+ if patched_model_request is not None:
981
+ _body_params = patched_model_request
982
+
983
+ # set the HTTP header `Accept`
984
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
985
+
986
+ # set the HTTP header `Content-Type`
987
+ if _content_type:
988
+ _header_params["Content-Type"] = _content_type
989
+ else:
990
+ _default_content_type = self.api_client.select_header_content_type(
991
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
992
+ )
993
+ if _default_content_type is not None:
994
+ _header_params["Content-Type"] = _default_content_type
995
+
996
+ # authentication setting
997
+ _auth_settings: List[str] = ["publicApiKey"]
998
+
999
+ return self.api_client.param_serialize(
1000
+ method="PATCH",
1001
+ resource_path="/v1/models/{id}/",
1002
+ path_params=_path_params,
1003
+ query_params=_query_params,
1004
+ header_params=_header_params,
1005
+ body=_body_params,
1006
+ post_params=_form_params,
1007
+ files=_files,
1008
+ auth_settings=_auth_settings,
1009
+ collection_formats=_collection_formats,
1010
+ _host=_host,
1011
+ _request_auth=_request_auth,
1012
+ )
1013
+
1014
+ @validate_call
1015
+ def models_retrieve(
1016
+ self,
1017
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
1018
+ _request_timeout: Union[
1019
+ None,
1020
+ Annotated[StrictFloat, Field(gt=0)],
1021
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1022
+ ] = None,
1023
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1024
+ _content_type: Optional[StrictStr] = None,
1025
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1026
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1027
+ ) -> Model:
1028
+ """models_retrieve
1029
+
1030
+ Get model details.
1031
+
1032
+ :param id: A UUID string identifying this model. (required)
1033
+ :type id: str
1034
+ :param _request_timeout: timeout setting for this request. If one
1035
+ number provided, it will be total request
1036
+ timeout. It can also be a pair (tuple) of
1037
+ (connection, read) timeouts.
1038
+ :type _request_timeout: int, tuple(int, int), optional
1039
+ :param _request_auth: set to override the auth_settings for an a single
1040
+ request; this effectively ignores the
1041
+ authentication in the spec for a single request.
1042
+ :type _request_auth: dict, optional
1043
+ :param _content_type: force content-type for the request.
1044
+ :type _content_type: str, Optional
1045
+ :param _headers: set to override the headers for a single
1046
+ request; this effectively ignores the headers
1047
+ in the spec for a single request.
1048
+ :type _headers: dict, optional
1049
+ :param _host_index: set to override the host_index for a single
1050
+ request; this effectively ignores the host_index
1051
+ in the spec for a single request.
1052
+ :type _host_index: int, optional
1053
+ :return: Returns the result object.
1054
+ """ # noqa: E501
1055
+
1056
+ _param = self._models_retrieve_serialize(
1057
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
1058
+ )
1059
+
1060
+ _response_types_map: Dict[str, Optional[str]] = {
1061
+ "200": "Model",
1062
+ }
1063
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1064
+ response_data.read()
1065
+ return self.api_client.response_deserialize(
1066
+ response_data=response_data,
1067
+ response_types_map=_response_types_map,
1068
+ ).data
1069
+
1070
+ @validate_call
1071
+ def models_retrieve_with_http_info(
1072
+ self,
1073
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
1074
+ _request_timeout: Union[
1075
+ None,
1076
+ Annotated[StrictFloat, Field(gt=0)],
1077
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1078
+ ] = None,
1079
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1080
+ _content_type: Optional[StrictStr] = None,
1081
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1082
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1083
+ ) -> ApiResponse[Model]:
1084
+ """models_retrieve
1085
+
1086
+ Get model details.
1087
+
1088
+ :param id: A UUID string identifying this model. (required)
1089
+ :type id: str
1090
+ :param _request_timeout: timeout setting for this request. If one
1091
+ number provided, it will be total request
1092
+ timeout. It can also be a pair (tuple) of
1093
+ (connection, read) timeouts.
1094
+ :type _request_timeout: int, tuple(int, int), optional
1095
+ :param _request_auth: set to override the auth_settings for an a single
1096
+ request; this effectively ignores the
1097
+ authentication in the spec for a single request.
1098
+ :type _request_auth: dict, optional
1099
+ :param _content_type: force content-type for the request.
1100
+ :type _content_type: str, Optional
1101
+ :param _headers: set to override the headers for a single
1102
+ request; this effectively ignores the headers
1103
+ in the spec for a single request.
1104
+ :type _headers: dict, optional
1105
+ :param _host_index: set to override the host_index for a single
1106
+ request; this effectively ignores the host_index
1107
+ in the spec for a single request.
1108
+ :type _host_index: int, optional
1109
+ :return: Returns the result object.
1110
+ """ # noqa: E501
1111
+
1112
+ _param = self._models_retrieve_serialize(
1113
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
1114
+ )
1115
+
1116
+ _response_types_map: Dict[str, Optional[str]] = {
1117
+ "200": "Model",
1118
+ }
1119
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1120
+ response_data.read()
1121
+ return self.api_client.response_deserialize(
1122
+ response_data=response_data,
1123
+ response_types_map=_response_types_map,
1124
+ )
1125
+
1126
+ @validate_call
1127
+ def models_retrieve_without_preload_content(
1128
+ self,
1129
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
1130
+ _request_timeout: Union[
1131
+ None,
1132
+ Annotated[StrictFloat, Field(gt=0)],
1133
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1134
+ ] = None,
1135
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1136
+ _content_type: Optional[StrictStr] = None,
1137
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1138
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1139
+ ) -> RESTResponseType:
1140
+ """models_retrieve
1141
+
1142
+ Get model details.
1143
+
1144
+ :param id: A UUID string identifying this model. (required)
1145
+ :type id: str
1146
+ :param _request_timeout: timeout setting for this request. If one
1147
+ number provided, it will be total request
1148
+ timeout. It can also be a pair (tuple) of
1149
+ (connection, read) timeouts.
1150
+ :type _request_timeout: int, tuple(int, int), optional
1151
+ :param _request_auth: set to override the auth_settings for an a single
1152
+ request; this effectively ignores the
1153
+ authentication in the spec for a single request.
1154
+ :type _request_auth: dict, optional
1155
+ :param _content_type: force content-type for the request.
1156
+ :type _content_type: str, Optional
1157
+ :param _headers: set to override the headers for a single
1158
+ request; this effectively ignores the headers
1159
+ in the spec for a single request.
1160
+ :type _headers: dict, optional
1161
+ :param _host_index: set to override the host_index for a single
1162
+ request; this effectively ignores the host_index
1163
+ in the spec for a single request.
1164
+ :type _host_index: int, optional
1165
+ :return: Returns the result object.
1166
+ """ # noqa: E501
1167
+
1168
+ _param = self._models_retrieve_serialize(
1169
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
1170
+ )
1171
+
1172
+ _response_types_map: Dict[str, Optional[str]] = {
1173
+ "200": "Model",
1174
+ }
1175
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1176
+ return response_data.response
1177
+
1178
+ def _models_retrieve_serialize(
1179
+ self,
1180
+ id,
1181
+ _request_auth,
1182
+ _content_type,
1183
+ _headers,
1184
+ _host_index,
1185
+ ) -> RequestSerialized:
1186
+ _host = None
1187
+
1188
+ _collection_formats: Dict[str, str] = {}
1189
+
1190
+ _path_params: Dict[str, str] = {}
1191
+ _query_params: List[Tuple[str, str]] = []
1192
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1193
+ _form_params: List[Tuple[str, str]] = []
1194
+ _files: Dict[str, str] = {}
1195
+ _body_params: Optional[bytes] = None
1196
+
1197
+ # process the path parameters
1198
+ if id is not None:
1199
+ _path_params["id"] = id
1200
+ # process the query parameters
1201
+ # process the header parameters
1202
+ # process the form parameters
1203
+ # process the body parameter
1204
+
1205
+ # set the HTTP header `Accept`
1206
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1207
+
1208
+ # authentication setting
1209
+ _auth_settings: List[str] = ["publicApiKey"]
1210
+
1211
+ return self.api_client.param_serialize(
1212
+ method="GET",
1213
+ resource_path="/v1/models/{id}/",
1214
+ path_params=_path_params,
1215
+ query_params=_query_params,
1216
+ header_params=_header_params,
1217
+ body=_body_params,
1218
+ post_params=_form_params,
1219
+ files=_files,
1220
+ auth_settings=_auth_settings,
1221
+ collection_formats=_collection_formats,
1222
+ _host=_host,
1223
+ _request_auth=_request_auth,
1224
+ )
1225
+
1226
+ @validate_call
1227
+ def models_update(
1228
+ self,
1229
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
1230
+ model_request: ModelRequest,
1231
+ _request_timeout: Union[
1232
+ None,
1233
+ Annotated[StrictFloat, Field(gt=0)],
1234
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1235
+ ] = None,
1236
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1237
+ _content_type: Optional[StrictStr] = None,
1238
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1239
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1240
+ ) -> Model:
1241
+ """models_update
1242
+
1243
+ Update a custom LLM model.
1244
+
1245
+ :param id: A UUID string identifying this model. (required)
1246
+ :type id: str
1247
+ :param model_request: (required)
1248
+ :type model_request: ModelRequest
1249
+ :param _request_timeout: timeout setting for this request. If one
1250
+ number provided, it will be total request
1251
+ timeout. It can also be a pair (tuple) of
1252
+ (connection, read) timeouts.
1253
+ :type _request_timeout: int, tuple(int, int), optional
1254
+ :param _request_auth: set to override the auth_settings for an a single
1255
+ request; this effectively ignores the
1256
+ authentication in the spec for a single request.
1257
+ :type _request_auth: dict, optional
1258
+ :param _content_type: force content-type for the request.
1259
+ :type _content_type: str, Optional
1260
+ :param _headers: set to override the headers for a single
1261
+ request; this effectively ignores the headers
1262
+ in the spec for a single request.
1263
+ :type _headers: dict, optional
1264
+ :param _host_index: set to override the host_index for a single
1265
+ request; this effectively ignores the host_index
1266
+ in the spec for a single request.
1267
+ :type _host_index: int, optional
1268
+ :return: Returns the result object.
1269
+ """ # noqa: E501
1270
+
1271
+ _param = self._models_update_serialize(
1272
+ id=id,
1273
+ model_request=model_request,
1274
+ _request_auth=_request_auth,
1275
+ _content_type=_content_type,
1276
+ _headers=_headers,
1277
+ _host_index=_host_index,
1278
+ )
1279
+
1280
+ _response_types_map: Dict[str, Optional[str]] = {
1281
+ "200": "Model",
1282
+ }
1283
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1284
+ response_data.read()
1285
+ return self.api_client.response_deserialize(
1286
+ response_data=response_data,
1287
+ response_types_map=_response_types_map,
1288
+ ).data
1289
+
1290
+ @validate_call
1291
+ def models_update_with_http_info(
1292
+ self,
1293
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
1294
+ model_request: ModelRequest,
1295
+ _request_timeout: Union[
1296
+ None,
1297
+ Annotated[StrictFloat, Field(gt=0)],
1298
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1299
+ ] = None,
1300
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1301
+ _content_type: Optional[StrictStr] = None,
1302
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1303
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1304
+ ) -> ApiResponse[Model]:
1305
+ """models_update
1306
+
1307
+ Update a custom LLM model.
1308
+
1309
+ :param id: A UUID string identifying this model. (required)
1310
+ :type id: str
1311
+ :param model_request: (required)
1312
+ :type model_request: ModelRequest
1313
+ :param _request_timeout: timeout setting for this request. If one
1314
+ number provided, it will be total request
1315
+ timeout. It can also be a pair (tuple) of
1316
+ (connection, read) timeouts.
1317
+ :type _request_timeout: int, tuple(int, int), optional
1318
+ :param _request_auth: set to override the auth_settings for an a single
1319
+ request; this effectively ignores the
1320
+ authentication in the spec for a single request.
1321
+ :type _request_auth: dict, optional
1322
+ :param _content_type: force content-type for the request.
1323
+ :type _content_type: str, Optional
1324
+ :param _headers: set to override the headers for a single
1325
+ request; this effectively ignores the headers
1326
+ in the spec for a single request.
1327
+ :type _headers: dict, optional
1328
+ :param _host_index: set to override the host_index for a single
1329
+ request; this effectively ignores the host_index
1330
+ in the spec for a single request.
1331
+ :type _host_index: int, optional
1332
+ :return: Returns the result object.
1333
+ """ # noqa: E501
1334
+
1335
+ _param = self._models_update_serialize(
1336
+ id=id,
1337
+ model_request=model_request,
1338
+ _request_auth=_request_auth,
1339
+ _content_type=_content_type,
1340
+ _headers=_headers,
1341
+ _host_index=_host_index,
1342
+ )
1343
+
1344
+ _response_types_map: Dict[str, Optional[str]] = {
1345
+ "200": "Model",
1346
+ }
1347
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1348
+ response_data.read()
1349
+ return self.api_client.response_deserialize(
1350
+ response_data=response_data,
1351
+ response_types_map=_response_types_map,
1352
+ )
1353
+
1354
+ @validate_call
1355
+ def models_update_without_preload_content(
1356
+ self,
1357
+ id: Annotated[StrictStr, Field(description="A UUID string identifying this model.")],
1358
+ model_request: ModelRequest,
1359
+ _request_timeout: Union[
1360
+ None,
1361
+ Annotated[StrictFloat, Field(gt=0)],
1362
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1363
+ ] = None,
1364
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1365
+ _content_type: Optional[StrictStr] = None,
1366
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1367
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1368
+ ) -> RESTResponseType:
1369
+ """models_update
1370
+
1371
+ Update a custom LLM model.
1372
+
1373
+ :param id: A UUID string identifying this model. (required)
1374
+ :type id: str
1375
+ :param model_request: (required)
1376
+ :type model_request: ModelRequest
1377
+ :param _request_timeout: timeout setting for this request. If one
1378
+ number provided, it will be total request
1379
+ timeout. It can also be a pair (tuple) of
1380
+ (connection, read) timeouts.
1381
+ :type _request_timeout: int, tuple(int, int), optional
1382
+ :param _request_auth: set to override the auth_settings for an a single
1383
+ request; this effectively ignores the
1384
+ authentication in the spec for a single request.
1385
+ :type _request_auth: dict, optional
1386
+ :param _content_type: force content-type for the request.
1387
+ :type _content_type: str, Optional
1388
+ :param _headers: set to override the headers for a single
1389
+ request; this effectively ignores the headers
1390
+ in the spec for a single request.
1391
+ :type _headers: dict, optional
1392
+ :param _host_index: set to override the host_index for a single
1393
+ request; this effectively ignores the host_index
1394
+ in the spec for a single request.
1395
+ :type _host_index: int, optional
1396
+ :return: Returns the result object.
1397
+ """ # noqa: E501
1398
+
1399
+ _param = self._models_update_serialize(
1400
+ id=id,
1401
+ model_request=model_request,
1402
+ _request_auth=_request_auth,
1403
+ _content_type=_content_type,
1404
+ _headers=_headers,
1405
+ _host_index=_host_index,
1406
+ )
1407
+
1408
+ _response_types_map: Dict[str, Optional[str]] = {
1409
+ "200": "Model",
1410
+ }
1411
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1412
+ return response_data.response
1413
+
1414
+ def _models_update_serialize(
1415
+ self,
1416
+ id,
1417
+ model_request,
1418
+ _request_auth,
1419
+ _content_type,
1420
+ _headers,
1421
+ _host_index,
1422
+ ) -> RequestSerialized:
1423
+ _host = None
1424
+
1425
+ _collection_formats: Dict[str, str] = {}
1426
+
1427
+ _path_params: Dict[str, str] = {}
1428
+ _query_params: List[Tuple[str, str]] = []
1429
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1430
+ _form_params: List[Tuple[str, str]] = []
1431
+ _files: Dict[str, str] = {}
1432
+ _body_params: Optional[bytes] = None
1433
+
1434
+ # process the path parameters
1435
+ if id is not None:
1436
+ _path_params["id"] = id
1437
+ # process the query parameters
1438
+ # process the header parameters
1439
+ # process the form parameters
1440
+ # process the body parameter
1441
+ if model_request is not None:
1442
+ _body_params = model_request
1443
+
1444
+ # set the HTTP header `Accept`
1445
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1446
+
1447
+ # set the HTTP header `Content-Type`
1448
+ if _content_type:
1449
+ _header_params["Content-Type"] = _content_type
1450
+ else:
1451
+ _default_content_type = self.api_client.select_header_content_type(
1452
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
1453
+ )
1454
+ if _default_content_type is not None:
1455
+ _header_params["Content-Type"] = _default_content_type
1456
+
1457
+ # authentication setting
1458
+ _auth_settings: List[str] = ["publicApiKey"]
1459
+
1460
+ return self.api_client.param_serialize(
1461
+ method="PUT",
1462
+ resource_path="/v1/models/{id}/",
1463
+ path_params=_path_params,
1464
+ query_params=_query_params,
1465
+ header_params=_header_params,
1466
+ body=_body_params,
1467
+ post_params=_form_params,
1468
+ files=_files,
1469
+ auth_settings=_auth_settings,
1470
+ collection_formats=_collection_formats,
1471
+ _host=_host,
1472
+ _request_auth=_request_auth,
1473
+ )