orca-sdk 0.0.93__py3-none-any.whl → 0.0.94__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.
- orca_sdk/_generated_api_client/api/__init__.py +4 -0
- orca_sdk/_generated_api_client/api/datasource/download_datasource_datasource_name_or_id_download_get.py +148 -0
- orca_sdk/_generated_api_client/api/task/list_tasks_task_get.py +60 -10
- orca_sdk/_generated_api_client/api/telemetry/count_predictions_telemetry_prediction_count_post.py +10 -10
- orca_sdk/_generated_api_client/models/__init__.py +6 -0
- orca_sdk/_generated_api_client/models/count_predictions_request.py +195 -0
- orca_sdk/_generated_api_client/models/http_validation_error.py +86 -0
- orca_sdk/_generated_api_client/models/list_predictions_request.py +62 -0
- orca_sdk/_generated_api_client/models/memoryset_analysis_configs.py +0 -20
- orca_sdk/_generated_api_client/models/pretrained_embedding_model_name.py +5 -0
- orca_sdk/_generated_api_client/models/validation_error.py +99 -0
- orca_sdk/classification_model.py +5 -3
- orca_sdk/classification_model_test.py +46 -0
- orca_sdk/conftest.py +1 -0
- orca_sdk/datasource.py +34 -0
- orca_sdk/datasource_test.py +9 -0
- orca_sdk/memoryset_test.py +2 -0
- orca_sdk/telemetry.py +5 -3
- {orca_sdk-0.0.93.dist-info → orca_sdk-0.0.94.dist-info}/METADATA +1 -1
- {orca_sdk-0.0.93.dist-info → orca_sdk-0.0.94.dist-info}/RECORD +21 -17
- {orca_sdk-0.0.93.dist-info → orca_sdk-0.0.94.dist-info}/WHEEL +0 -0
|
@@ -42,6 +42,9 @@ from .datasource.create_embedding_evaluation_datasource_name_or_id_embedding_eva
|
|
|
42
42
|
from .datasource.delete_datasource_datasource_name_or_id_delete import (
|
|
43
43
|
sync as delete_datasource,
|
|
44
44
|
)
|
|
45
|
+
from .datasource.download_datasource_datasource_name_or_id_download_get import (
|
|
46
|
+
sync as download_datasource,
|
|
47
|
+
)
|
|
45
48
|
from .datasource.get_datasource_datasource_name_or_id_get import sync as get_datasource
|
|
46
49
|
from .datasource.get_embedding_evaluation_datasource_name_or_id_embedding_evaluation_task_id_get import (
|
|
47
50
|
sync as get_embedding_evaluation,
|
|
@@ -190,6 +193,7 @@ __all__ = [
|
|
|
190
193
|
"delete_memoryset",
|
|
191
194
|
"delete_model",
|
|
192
195
|
"delete_org",
|
|
196
|
+
"download_datasource",
|
|
193
197
|
"drop_feedback_category_with_data",
|
|
194
198
|
"embed_with_finetuned_model_gpu",
|
|
195
199
|
"embed_with_pretrained_model_gpu",
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file is generated by the openapi-python-client tool via the generate_api_client.py script
|
|
3
|
+
|
|
4
|
+
It is a customized template from the openapi-python-client tool's default template:
|
|
5
|
+
https://github.com/openapi-generators/openapi-python-client/blob/861ef5622f10fc96d240dc9becb0edf94e61446c/openapi_python_client/templates/endpoint_module.py.jinja
|
|
6
|
+
|
|
7
|
+
The main changes are:
|
|
8
|
+
- Update the API call responses to either return the successful response type or raise an error by:
|
|
9
|
+
- Updating the _parse_response function to raise an error if the response status code is not in the 2xx range
|
|
10
|
+
- Inject a client into every method via a context manager
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from http import HTTPStatus
|
|
14
|
+
from typing import Any
|
|
15
|
+
|
|
16
|
+
import httpx
|
|
17
|
+
|
|
18
|
+
from ...client import _client_context
|
|
19
|
+
from ...errors import get_error_for_response
|
|
20
|
+
from ...types import Response
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _get_kwargs(
|
|
24
|
+
name_or_id: str,
|
|
25
|
+
) -> dict[str, Any]:
|
|
26
|
+
_kwargs: dict[str, Any] = {
|
|
27
|
+
"method": "get",
|
|
28
|
+
"url": f"/datasource/{name_or_id}/download",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(*, response: httpx.Response) -> None:
|
|
35
|
+
if response.status_code == 200:
|
|
36
|
+
response_200 = response.json()
|
|
37
|
+
return response_200
|
|
38
|
+
if response.status_code == 422:
|
|
39
|
+
raise get_error_for_response(response)
|
|
40
|
+
else:
|
|
41
|
+
raise get_error_for_response(response)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(*, response: httpx.Response) -> Response[None]:
|
|
45
|
+
return Response(
|
|
46
|
+
status_code=HTTPStatus(response.status_code),
|
|
47
|
+
content=response.content,
|
|
48
|
+
headers=response.headers,
|
|
49
|
+
parsed=_parse_response(response=response),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def sync_detailed(
|
|
54
|
+
name_or_id: str,
|
|
55
|
+
) -> Response[None]:
|
|
56
|
+
"""Download Datasource
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
name_or_id (str):
|
|
60
|
+
|
|
61
|
+
Raises:
|
|
62
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
63
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Response[None]
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
kwargs = _get_kwargs(
|
|
70
|
+
name_or_id=name_or_id,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
with _client_context() as client:
|
|
74
|
+
response = client.get_httpx_client().request(
|
|
75
|
+
**kwargs,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return _build_response(response=response)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def sync(
|
|
82
|
+
name_or_id: str,
|
|
83
|
+
) -> None:
|
|
84
|
+
"""Download Datasource
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
name_or_id (str):
|
|
88
|
+
|
|
89
|
+
Raises:
|
|
90
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
91
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
None
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
return sync_detailed(
|
|
98
|
+
name_or_id=name_or_id,
|
|
99
|
+
).parsed
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
async def asyncio_detailed(
|
|
103
|
+
name_or_id: str,
|
|
104
|
+
) -> Response[None]:
|
|
105
|
+
"""Download Datasource
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
name_or_id (str):
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
112
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
Response[None]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
kwargs = _get_kwargs(
|
|
119
|
+
name_or_id=name_or_id,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
with _client_context() as client:
|
|
123
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
124
|
+
|
|
125
|
+
return _build_response(response=response)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
async def asyncio(
|
|
129
|
+
name_or_id: str,
|
|
130
|
+
) -> None:
|
|
131
|
+
"""Download Datasource
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
name_or_id (str):
|
|
135
|
+
|
|
136
|
+
Raises:
|
|
137
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
138
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
None
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
await asyncio_detailed(
|
|
146
|
+
name_or_id=name_or_id,
|
|
147
|
+
)
|
|
148
|
+
).parsed
|
|
@@ -10,6 +10,7 @@ The main changes are:
|
|
|
10
10
|
- Inject a client into every method via a context manager
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
+
import datetime
|
|
13
14
|
from enum import Enum
|
|
14
15
|
from http import HTTPStatus
|
|
15
16
|
from typing import Any, Dict, List, Union
|
|
@@ -27,8 +28,10 @@ def _get_kwargs(
|
|
|
27
28
|
*,
|
|
28
29
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
29
30
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
30
|
-
limit: Union[Unset, int] =
|
|
31
|
+
limit: Union[None, Unset, int] = UNSET,
|
|
31
32
|
offset: Union[Unset, int] = 0,
|
|
33
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
34
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
32
35
|
) -> dict[str, Any]:
|
|
33
36
|
params: Dict[str, Any] = {}
|
|
34
37
|
|
|
@@ -59,10 +62,33 @@ def _get_kwargs(
|
|
|
59
62
|
json_type = type
|
|
60
63
|
params["type"] = json_type
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
json_limit: Union[None, Unset, int]
|
|
66
|
+
if isinstance(limit, Unset):
|
|
67
|
+
json_limit = UNSET
|
|
68
|
+
else:
|
|
69
|
+
json_limit = limit
|
|
70
|
+
params["limit"] = json_limit
|
|
63
71
|
|
|
64
72
|
params["offset"] = offset
|
|
65
73
|
|
|
74
|
+
json_start_timestamp: Union[None, Unset, str]
|
|
75
|
+
if isinstance(start_timestamp, Unset):
|
|
76
|
+
json_start_timestamp = UNSET
|
|
77
|
+
elif isinstance(start_timestamp, datetime.datetime):
|
|
78
|
+
json_start_timestamp = start_timestamp.isoformat()
|
|
79
|
+
else:
|
|
80
|
+
json_start_timestamp = start_timestamp
|
|
81
|
+
params["start_timestamp"] = json_start_timestamp
|
|
82
|
+
|
|
83
|
+
json_end_timestamp: Union[None, Unset, str]
|
|
84
|
+
if isinstance(end_timestamp, Unset):
|
|
85
|
+
json_end_timestamp = UNSET
|
|
86
|
+
elif isinstance(end_timestamp, datetime.datetime):
|
|
87
|
+
json_end_timestamp = end_timestamp.isoformat()
|
|
88
|
+
else:
|
|
89
|
+
json_end_timestamp = end_timestamp
|
|
90
|
+
params["end_timestamp"] = json_end_timestamp
|
|
91
|
+
|
|
66
92
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
67
93
|
|
|
68
94
|
_kwargs: dict[str, Any] = {
|
|
@@ -109,16 +135,20 @@ def sync_detailed(
|
|
|
109
135
|
*,
|
|
110
136
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
111
137
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
112
|
-
limit: Union[Unset, int] =
|
|
138
|
+
limit: Union[None, Unset, int] = UNSET,
|
|
113
139
|
offset: Union[Unset, int] = 0,
|
|
140
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
141
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
114
142
|
) -> Response[List["Task"]]:
|
|
115
143
|
"""List Tasks
|
|
116
144
|
|
|
117
145
|
Args:
|
|
118
146
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
119
147
|
type (Union[List[str], None, Unset, str]):
|
|
120
|
-
limit (Union[Unset, int]):
|
|
148
|
+
limit (Union[None, Unset, int]):
|
|
121
149
|
offset (Union[Unset, int]): Default: 0.
|
|
150
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
151
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
122
152
|
|
|
123
153
|
Raises:
|
|
124
154
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -133,6 +163,8 @@ def sync_detailed(
|
|
|
133
163
|
type=type,
|
|
134
164
|
limit=limit,
|
|
135
165
|
offset=offset,
|
|
166
|
+
start_timestamp=start_timestamp,
|
|
167
|
+
end_timestamp=end_timestamp,
|
|
136
168
|
)
|
|
137
169
|
|
|
138
170
|
with _client_context() as client:
|
|
@@ -147,16 +179,20 @@ def sync(
|
|
|
147
179
|
*,
|
|
148
180
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
149
181
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
150
|
-
limit: Union[Unset, int] =
|
|
182
|
+
limit: Union[None, Unset, int] = UNSET,
|
|
151
183
|
offset: Union[Unset, int] = 0,
|
|
184
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
185
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
152
186
|
) -> List["Task"]:
|
|
153
187
|
"""List Tasks
|
|
154
188
|
|
|
155
189
|
Args:
|
|
156
190
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
157
191
|
type (Union[List[str], None, Unset, str]):
|
|
158
|
-
limit (Union[Unset, int]):
|
|
192
|
+
limit (Union[None, Unset, int]):
|
|
159
193
|
offset (Union[Unset, int]): Default: 0.
|
|
194
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
195
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
160
196
|
|
|
161
197
|
Raises:
|
|
162
198
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -171,6 +207,8 @@ def sync(
|
|
|
171
207
|
type=type,
|
|
172
208
|
limit=limit,
|
|
173
209
|
offset=offset,
|
|
210
|
+
start_timestamp=start_timestamp,
|
|
211
|
+
end_timestamp=end_timestamp,
|
|
174
212
|
).parsed
|
|
175
213
|
|
|
176
214
|
|
|
@@ -178,16 +216,20 @@ async def asyncio_detailed(
|
|
|
178
216
|
*,
|
|
179
217
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
180
218
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
181
|
-
limit: Union[Unset, int] =
|
|
219
|
+
limit: Union[None, Unset, int] = UNSET,
|
|
182
220
|
offset: Union[Unset, int] = 0,
|
|
221
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
222
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
183
223
|
) -> Response[List["Task"]]:
|
|
184
224
|
"""List Tasks
|
|
185
225
|
|
|
186
226
|
Args:
|
|
187
227
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
188
228
|
type (Union[List[str], None, Unset, str]):
|
|
189
|
-
limit (Union[Unset, int]):
|
|
229
|
+
limit (Union[None, Unset, int]):
|
|
190
230
|
offset (Union[Unset, int]): Default: 0.
|
|
231
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
232
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
191
233
|
|
|
192
234
|
Raises:
|
|
193
235
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -202,6 +244,8 @@ async def asyncio_detailed(
|
|
|
202
244
|
type=type,
|
|
203
245
|
limit=limit,
|
|
204
246
|
offset=offset,
|
|
247
|
+
start_timestamp=start_timestamp,
|
|
248
|
+
end_timestamp=end_timestamp,
|
|
205
249
|
)
|
|
206
250
|
|
|
207
251
|
with _client_context() as client:
|
|
@@ -214,16 +258,20 @@ async def asyncio(
|
|
|
214
258
|
*,
|
|
215
259
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
216
260
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
217
|
-
limit: Union[Unset, int] =
|
|
261
|
+
limit: Union[None, Unset, int] = UNSET,
|
|
218
262
|
offset: Union[Unset, int] = 0,
|
|
263
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
264
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
219
265
|
) -> List["Task"]:
|
|
220
266
|
"""List Tasks
|
|
221
267
|
|
|
222
268
|
Args:
|
|
223
269
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
224
270
|
type (Union[List[str], None, Unset, str]):
|
|
225
|
-
limit (Union[Unset, int]):
|
|
271
|
+
limit (Union[None, Unset, int]):
|
|
226
272
|
offset (Union[Unset, int]): Default: 0.
|
|
273
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
274
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
227
275
|
|
|
228
276
|
Raises:
|
|
229
277
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -239,5 +287,7 @@ async def asyncio(
|
|
|
239
287
|
type=type,
|
|
240
288
|
limit=limit,
|
|
241
289
|
offset=offset,
|
|
290
|
+
start_timestamp=start_timestamp,
|
|
291
|
+
end_timestamp=end_timestamp,
|
|
242
292
|
)
|
|
243
293
|
).parsed
|
orca_sdk/_generated_api_client/api/telemetry/count_predictions_telemetry_prediction_count_post.py
CHANGED
|
@@ -17,13 +17,13 @@ import httpx
|
|
|
17
17
|
|
|
18
18
|
from ...client import _client_context
|
|
19
19
|
from ...errors import get_error_for_response
|
|
20
|
-
from ...models.
|
|
20
|
+
from ...models.count_predictions_request import CountPredictionsRequest
|
|
21
21
|
from ...types import Response
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def _get_kwargs(
|
|
25
25
|
*,
|
|
26
|
-
body:
|
|
26
|
+
body: CountPredictionsRequest,
|
|
27
27
|
) -> dict[str, Any]:
|
|
28
28
|
headers: Dict[str, Any] = {}
|
|
29
29
|
|
|
@@ -68,12 +68,12 @@ def _build_response(*, response: httpx.Response) -> Response[int]:
|
|
|
68
68
|
|
|
69
69
|
def sync_detailed(
|
|
70
70
|
*,
|
|
71
|
-
body:
|
|
71
|
+
body: CountPredictionsRequest,
|
|
72
72
|
) -> Response[int]:
|
|
73
73
|
"""Count Predictions
|
|
74
74
|
|
|
75
75
|
Args:
|
|
76
|
-
body (
|
|
76
|
+
body (CountPredictionsRequest):
|
|
77
77
|
|
|
78
78
|
Raises:
|
|
79
79
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -97,12 +97,12 @@ def sync_detailed(
|
|
|
97
97
|
|
|
98
98
|
def sync(
|
|
99
99
|
*,
|
|
100
|
-
body:
|
|
100
|
+
body: CountPredictionsRequest,
|
|
101
101
|
) -> int:
|
|
102
102
|
"""Count Predictions
|
|
103
103
|
|
|
104
104
|
Args:
|
|
105
|
-
body (
|
|
105
|
+
body (CountPredictionsRequest):
|
|
106
106
|
|
|
107
107
|
Raises:
|
|
108
108
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -119,12 +119,12 @@ def sync(
|
|
|
119
119
|
|
|
120
120
|
async def asyncio_detailed(
|
|
121
121
|
*,
|
|
122
|
-
body:
|
|
122
|
+
body: CountPredictionsRequest,
|
|
123
123
|
) -> Response[int]:
|
|
124
124
|
"""Count Predictions
|
|
125
125
|
|
|
126
126
|
Args:
|
|
127
|
-
body (
|
|
127
|
+
body (CountPredictionsRequest):
|
|
128
128
|
|
|
129
129
|
Raises:
|
|
130
130
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -146,12 +146,12 @@ async def asyncio_detailed(
|
|
|
146
146
|
|
|
147
147
|
async def asyncio(
|
|
148
148
|
*,
|
|
149
|
-
body:
|
|
149
|
+
body: CountPredictionsRequest,
|
|
150
150
|
) -> int:
|
|
151
151
|
"""Count Predictions
|
|
152
152
|
|
|
153
153
|
Args:
|
|
154
|
-
body (
|
|
154
|
+
body (CountPredictionsRequest):
|
|
155
155
|
|
|
156
156
|
Raises:
|
|
157
157
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -14,6 +14,7 @@ from .cluster_metrics import ClusterMetrics
|
|
|
14
14
|
from .column_info import ColumnInfo
|
|
15
15
|
from .column_type import ColumnType
|
|
16
16
|
from .constraint_violation_error_response import ConstraintViolationErrorResponse
|
|
17
|
+
from .count_predictions_request import CountPredictionsRequest
|
|
17
18
|
from .create_api_key_request import CreateApiKeyRequest
|
|
18
19
|
from .create_api_key_request_scope_item import CreateApiKeyRequestScopeItem
|
|
19
20
|
from .create_api_key_response import CreateApiKeyResponse
|
|
@@ -41,6 +42,7 @@ from .finetune_embedding_model_request import FinetuneEmbeddingModelRequest
|
|
|
41
42
|
from .finetune_embedding_model_request_training_args import FinetuneEmbeddingModelRequestTrainingArgs
|
|
42
43
|
from .finetuned_embedding_model_metadata import FinetunedEmbeddingModelMetadata
|
|
43
44
|
from .get_memories_request import GetMemoriesRequest
|
|
45
|
+
from .http_validation_error import HTTPValidationError
|
|
44
46
|
from .internal_server_error_response import InternalServerErrorResponse
|
|
45
47
|
from .label_class_metrics import LabelClassMetrics
|
|
46
48
|
from .label_prediction_memory_lookup import LabelPredictionMemoryLookup
|
|
@@ -112,6 +114,7 @@ from .telemetry_sort_options_direction import TelemetrySortOptionsDirection
|
|
|
112
114
|
from .unauthenticated_error_response import UnauthenticatedErrorResponse
|
|
113
115
|
from .unauthorized_error_response import UnauthorizedErrorResponse
|
|
114
116
|
from .update_prediction_request import UpdatePredictionRequest
|
|
117
|
+
from .validation_error import ValidationError
|
|
115
118
|
|
|
116
119
|
__all__ = (
|
|
117
120
|
"AnalyzeNeighborLabelsResult",
|
|
@@ -128,6 +131,7 @@ __all__ = (
|
|
|
128
131
|
"ColumnInfo",
|
|
129
132
|
"ColumnType",
|
|
130
133
|
"ConstraintViolationErrorResponse",
|
|
134
|
+
"CountPredictionsRequest",
|
|
131
135
|
"CreateApiKeyRequest",
|
|
132
136
|
"CreateApiKeyRequestScopeItem",
|
|
133
137
|
"CreateApiKeyResponse",
|
|
@@ -155,6 +159,7 @@ __all__ = (
|
|
|
155
159
|
"FinetuneEmbeddingModelRequest",
|
|
156
160
|
"FinetuneEmbeddingModelRequestTrainingArgs",
|
|
157
161
|
"GetMemoriesRequest",
|
|
162
|
+
"HTTPValidationError",
|
|
158
163
|
"InternalServerErrorResponse",
|
|
159
164
|
"LabelClassMetrics",
|
|
160
165
|
"LabeledMemory",
|
|
@@ -226,4 +231,5 @@ __all__ = (
|
|
|
226
231
|
"UnauthenticatedErrorResponse",
|
|
227
232
|
"UnauthorizedErrorResponse",
|
|
228
233
|
"UpdatePredictionRequest",
|
|
234
|
+
"ValidationError",
|
|
229
235
|
)
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file is generated by the openapi-python-client tool via the generate_api_client.py script
|
|
3
|
+
|
|
4
|
+
It is a customized template from the openapi-python-client tool's default template:
|
|
5
|
+
https://github.com/openapi-generators/openapi-python-client/blob/861ef5622f10fc96d240dc9becb0edf94e61446c/openapi_python_client/templates/model.py.jinja
|
|
6
|
+
|
|
7
|
+
The main change is:
|
|
8
|
+
- Fix typing issues
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
# flake8: noqa: C901
|
|
12
|
+
|
|
13
|
+
import datetime
|
|
14
|
+
from typing import Any, List, Type, TypeVar, Union, cast
|
|
15
|
+
|
|
16
|
+
from attrs import define as _attrs_define
|
|
17
|
+
from attrs import field as _attrs_field
|
|
18
|
+
from dateutil.parser import isoparse
|
|
19
|
+
|
|
20
|
+
from ..types import UNSET, Unset
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="CountPredictionsRequest")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class CountPredictionsRequest:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
model_id (Union[None, Unset, str]):
|
|
30
|
+
tag (Union[None, Unset, str]):
|
|
31
|
+
prediction_ids (Union[List[str], None, Unset]):
|
|
32
|
+
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
33
|
+
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
model_id: Union[None, Unset, str] = UNSET
|
|
37
|
+
tag: Union[None, Unset, str] = UNSET
|
|
38
|
+
prediction_ids: Union[List[str], None, Unset] = UNSET
|
|
39
|
+
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET
|
|
40
|
+
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET
|
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
model_id: Union[None, Unset, str]
|
|
45
|
+
if isinstance(self.model_id, Unset):
|
|
46
|
+
model_id = UNSET
|
|
47
|
+
else:
|
|
48
|
+
model_id = self.model_id
|
|
49
|
+
|
|
50
|
+
tag: Union[None, Unset, str]
|
|
51
|
+
if isinstance(self.tag, Unset):
|
|
52
|
+
tag = UNSET
|
|
53
|
+
else:
|
|
54
|
+
tag = self.tag
|
|
55
|
+
|
|
56
|
+
prediction_ids: Union[List[str], None, Unset]
|
|
57
|
+
if isinstance(self.prediction_ids, Unset):
|
|
58
|
+
prediction_ids = UNSET
|
|
59
|
+
elif isinstance(self.prediction_ids, list):
|
|
60
|
+
prediction_ids = self.prediction_ids
|
|
61
|
+
|
|
62
|
+
else:
|
|
63
|
+
prediction_ids = self.prediction_ids
|
|
64
|
+
|
|
65
|
+
start_timestamp: Union[None, Unset, str]
|
|
66
|
+
if isinstance(self.start_timestamp, Unset):
|
|
67
|
+
start_timestamp = UNSET
|
|
68
|
+
elif isinstance(self.start_timestamp, datetime.datetime):
|
|
69
|
+
start_timestamp = self.start_timestamp.isoformat()
|
|
70
|
+
else:
|
|
71
|
+
start_timestamp = self.start_timestamp
|
|
72
|
+
|
|
73
|
+
end_timestamp: Union[None, Unset, str]
|
|
74
|
+
if isinstance(self.end_timestamp, Unset):
|
|
75
|
+
end_timestamp = UNSET
|
|
76
|
+
elif isinstance(self.end_timestamp, datetime.datetime):
|
|
77
|
+
end_timestamp = self.end_timestamp.isoformat()
|
|
78
|
+
else:
|
|
79
|
+
end_timestamp = self.end_timestamp
|
|
80
|
+
|
|
81
|
+
field_dict: dict[str, Any] = {}
|
|
82
|
+
field_dict.update(self.additional_properties)
|
|
83
|
+
field_dict.update({})
|
|
84
|
+
if model_id is not UNSET:
|
|
85
|
+
field_dict["model_id"] = model_id
|
|
86
|
+
if tag is not UNSET:
|
|
87
|
+
field_dict["tag"] = tag
|
|
88
|
+
if prediction_ids is not UNSET:
|
|
89
|
+
field_dict["prediction_ids"] = prediction_ids
|
|
90
|
+
if start_timestamp is not UNSET:
|
|
91
|
+
field_dict["start_timestamp"] = start_timestamp
|
|
92
|
+
if end_timestamp is not UNSET:
|
|
93
|
+
field_dict["end_timestamp"] = end_timestamp
|
|
94
|
+
|
|
95
|
+
return field_dict
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
|
99
|
+
d = src_dict.copy()
|
|
100
|
+
|
|
101
|
+
def _parse_model_id(data: object) -> Union[None, Unset, str]:
|
|
102
|
+
if data is None:
|
|
103
|
+
return data
|
|
104
|
+
if isinstance(data, Unset):
|
|
105
|
+
return data
|
|
106
|
+
return cast(Union[None, Unset, str], data)
|
|
107
|
+
|
|
108
|
+
model_id = _parse_model_id(d.pop("model_id", UNSET))
|
|
109
|
+
|
|
110
|
+
def _parse_tag(data: object) -> Union[None, Unset, str]:
|
|
111
|
+
if data is None:
|
|
112
|
+
return data
|
|
113
|
+
if isinstance(data, Unset):
|
|
114
|
+
return data
|
|
115
|
+
return cast(Union[None, Unset, str], data)
|
|
116
|
+
|
|
117
|
+
tag = _parse_tag(d.pop("tag", UNSET))
|
|
118
|
+
|
|
119
|
+
def _parse_prediction_ids(data: object) -> Union[List[str], None, Unset]:
|
|
120
|
+
if data is None:
|
|
121
|
+
return data
|
|
122
|
+
if isinstance(data, Unset):
|
|
123
|
+
return data
|
|
124
|
+
try:
|
|
125
|
+
if not isinstance(data, list):
|
|
126
|
+
raise TypeError()
|
|
127
|
+
prediction_ids_type_0 = cast(List[str], data)
|
|
128
|
+
|
|
129
|
+
return prediction_ids_type_0
|
|
130
|
+
except: # noqa: E722
|
|
131
|
+
pass
|
|
132
|
+
return cast(Union[List[str], None, Unset], data)
|
|
133
|
+
|
|
134
|
+
prediction_ids = _parse_prediction_ids(d.pop("prediction_ids", UNSET))
|
|
135
|
+
|
|
136
|
+
def _parse_start_timestamp(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
137
|
+
if data is None:
|
|
138
|
+
return data
|
|
139
|
+
if isinstance(data, Unset):
|
|
140
|
+
return data
|
|
141
|
+
try:
|
|
142
|
+
if not isinstance(data, str):
|
|
143
|
+
raise TypeError()
|
|
144
|
+
start_timestamp_type_0 = isoparse(data)
|
|
145
|
+
|
|
146
|
+
return start_timestamp_type_0
|
|
147
|
+
except: # noqa: E722
|
|
148
|
+
pass
|
|
149
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
150
|
+
|
|
151
|
+
start_timestamp = _parse_start_timestamp(d.pop("start_timestamp", UNSET))
|
|
152
|
+
|
|
153
|
+
def _parse_end_timestamp(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
154
|
+
if data is None:
|
|
155
|
+
return data
|
|
156
|
+
if isinstance(data, Unset):
|
|
157
|
+
return data
|
|
158
|
+
try:
|
|
159
|
+
if not isinstance(data, str):
|
|
160
|
+
raise TypeError()
|
|
161
|
+
end_timestamp_type_0 = isoparse(data)
|
|
162
|
+
|
|
163
|
+
return end_timestamp_type_0
|
|
164
|
+
except: # noqa: E722
|
|
165
|
+
pass
|
|
166
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
167
|
+
|
|
168
|
+
end_timestamp = _parse_end_timestamp(d.pop("end_timestamp", UNSET))
|
|
169
|
+
|
|
170
|
+
count_predictions_request = cls(
|
|
171
|
+
model_id=model_id,
|
|
172
|
+
tag=tag,
|
|
173
|
+
prediction_ids=prediction_ids,
|
|
174
|
+
start_timestamp=start_timestamp,
|
|
175
|
+
end_timestamp=end_timestamp,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
count_predictions_request.additional_properties = d
|
|
179
|
+
return count_predictions_request
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def additional_keys(self) -> list[str]:
|
|
183
|
+
return list(self.additional_properties.keys())
|
|
184
|
+
|
|
185
|
+
def __getitem__(self, key: str) -> Any:
|
|
186
|
+
return self.additional_properties[key]
|
|
187
|
+
|
|
188
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
189
|
+
self.additional_properties[key] = value
|
|
190
|
+
|
|
191
|
+
def __delitem__(self, key: str) -> None:
|
|
192
|
+
del self.additional_properties[key]
|
|
193
|
+
|
|
194
|
+
def __contains__(self, key: str) -> bool:
|
|
195
|
+
return key in self.additional_properties
|