orca-sdk 0.0.96__py3-none-any.whl → 0.0.97__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/__init__.py +1 -5
- orca_sdk/_generated_api_client/api/__init__.py +28 -8
- orca_sdk/_generated_api_client/api/{datasource/create_datasource_datasource_post.py → auth/create_org_plan_auth_org_plan_post.py} +32 -31
- orca_sdk/_generated_api_client/api/auth/get_org_plan_auth_org_plan_get.py +122 -0
- orca_sdk/_generated_api_client/api/auth/update_org_plan_auth_org_plan_put.py +168 -0
- orca_sdk/_generated_api_client/api/classification_model/{create_classification_model_gpu_classification_model_post.py → create_classification_model_classification_model_post.py} +1 -1
- orca_sdk/_generated_api_client/api/datasource/create_datasource_from_content_datasource_post.py +224 -0
- orca_sdk/_generated_api_client/api/datasource/create_datasource_from_files_datasource_upload_post.py +229 -0
- orca_sdk/_generated_api_client/api/regression_model/{create_regression_model_gpu_regression_model_post.py → create_regression_model_regression_model_post.py} +1 -1
- orca_sdk/_generated_api_client/api/task/list_tasks_task_get.py +21 -26
- orca_sdk/_generated_api_client/api/telemetry/generate_memory_suggestions_telemetry_prediction_prediction_id_memory_suggestions_post.py +239 -0
- orca_sdk/_generated_api_client/api/telemetry/get_action_recommendation_telemetry_prediction_prediction_id_action_get.py +192 -0
- orca_sdk/_generated_api_client/models/__init__.py +54 -4
- orca_sdk/_generated_api_client/models/action_recommendation.py +82 -0
- orca_sdk/_generated_api_client/models/action_recommendation_action.py +11 -0
- orca_sdk/_generated_api_client/models/add_memory_recommendations.py +85 -0
- orca_sdk/_generated_api_client/models/add_memory_suggestion.py +79 -0
- orca_sdk/_generated_api_client/models/body_create_datasource_from_files_datasource_upload_post.py +145 -0
- orca_sdk/_generated_api_client/models/class_representatives.py +92 -0
- orca_sdk/_generated_api_client/models/classification_model_metadata.py +14 -0
- orca_sdk/_generated_api_client/models/clone_memoryset_request.py +40 -0
- orca_sdk/_generated_api_client/models/constraint_violation_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/constraint_violation_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/create_classification_model_request.py +40 -0
- orca_sdk/_generated_api_client/models/create_datasource_from_content_request.py +101 -0
- orca_sdk/_generated_api_client/models/create_memoryset_request.py +40 -0
- orca_sdk/_generated_api_client/models/create_org_plan_request.py +73 -0
- orca_sdk/_generated_api_client/models/create_org_plan_request_tier.py +11 -0
- orca_sdk/_generated_api_client/models/create_regression_model_request.py +20 -0
- orca_sdk/_generated_api_client/models/embed_request.py +20 -0
- orca_sdk/_generated_api_client/models/embedding_evaluation_payload.py +28 -10
- orca_sdk/_generated_api_client/models/embedding_evaluation_request.py +28 -10
- orca_sdk/_generated_api_client/models/embedding_model_result.py +9 -0
- orca_sdk/_generated_api_client/models/filter_item.py +31 -23
- orca_sdk/_generated_api_client/models/filter_item_field_type_1_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/filter_item_field_type_2_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/filter_item_field_type_2_item_type_1.py +2 -0
- orca_sdk/_generated_api_client/models/internal_server_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/internal_server_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/labeled_memory.py +5 -5
- orca_sdk/_generated_api_client/models/labeled_memory_update.py +16 -16
- orca_sdk/_generated_api_client/models/labeled_memory_with_feedback_metrics.py +5 -5
- orca_sdk/_generated_api_client/models/lookup_request.py +20 -0
- orca_sdk/_generated_api_client/models/memory_metrics.py +98 -0
- orca_sdk/_generated_api_client/models/memoryset_analysis_configs.py +33 -0
- orca_sdk/_generated_api_client/models/memoryset_class_patterns_analysis_config.py +79 -0
- orca_sdk/_generated_api_client/models/memoryset_class_patterns_metrics.py +138 -0
- orca_sdk/_generated_api_client/models/memoryset_metadata.py +42 -0
- orca_sdk/_generated_api_client/models/memoryset_metrics.py +33 -0
- orca_sdk/_generated_api_client/models/memoryset_update.py +20 -0
- orca_sdk/_generated_api_client/models/not_found_error_response.py +6 -7
- orca_sdk/_generated_api_client/models/not_found_error_response_resource_type_0.py +1 -0
- orca_sdk/_generated_api_client/models/not_found_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/org_plan.py +99 -0
- orca_sdk/_generated_api_client/models/org_plan_tier.py +11 -0
- orca_sdk/_generated_api_client/models/paginated_task.py +108 -0
- orca_sdk/_generated_api_client/models/predictive_model_update.py +20 -0
- orca_sdk/_generated_api_client/models/pretrained_embedding_model_metadata.py +8 -0
- orca_sdk/_generated_api_client/models/regression_model_metadata.py +14 -0
- orca_sdk/_generated_api_client/models/scored_memory_update.py +9 -9
- orca_sdk/_generated_api_client/models/service_unavailable_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/service_unavailable_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_field_type_0_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_field_type_1_item_type_0.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_field_type_1_item_type_1.py +8 -0
- orca_sdk/_generated_api_client/models/telemetry_filter_item.py +42 -30
- orca_sdk/_generated_api_client/models/telemetry_sort_options.py +42 -30
- orca_sdk/_generated_api_client/models/unauthenticated_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/unauthenticated_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/unauthorized_error_response.py +8 -7
- orca_sdk/_generated_api_client/models/unauthorized_error_response_status_code.py +8 -0
- orca_sdk/_generated_api_client/models/update_org_plan_request.py +73 -0
- orca_sdk/_generated_api_client/models/update_org_plan_request_tier.py +11 -0
- orca_sdk/_shared/metrics.py +1 -1
- orca_sdk/classification_model.py +2 -2
- orca_sdk/classification_model_test.py +53 -0
- orca_sdk/credentials.py +15 -1
- orca_sdk/datasource.py +180 -41
- orca_sdk/datasource_test.py +194 -0
- orca_sdk/embedding_model.py +51 -13
- orca_sdk/embedding_model_test.py +27 -0
- orca_sdk/job.py +15 -14
- orca_sdk/job_test.py +34 -0
- orca_sdk/memoryset.py +47 -7
- orca_sdk/regression_model.py +2 -2
- orca_sdk/telemetry.py +94 -3
- {orca_sdk-0.0.96.dist-info → orca_sdk-0.0.97.dist-info}/METADATA +18 -1
- {orca_sdk-0.0.96.dist-info → orca_sdk-0.0.97.dist-info}/RECORD +89 -58
- orca_sdk/_generated_api_client/models/body_create_datasource_datasource_post.py +0 -207
- orca_sdk/_generated_api_client/models/labeled_memory_metrics.py +0 -246
- {orca_sdk-0.0.96.dist-info → orca_sdk-0.0.97.dist-info}/WHEEL +0 -0
orca_sdk/_generated_api_client/api/datasource/create_datasource_from_content_datasource_post.py
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
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, Dict
|
|
15
|
+
|
|
16
|
+
import httpx
|
|
17
|
+
|
|
18
|
+
from ...client import _client_context
|
|
19
|
+
from ...errors import get_error_for_response
|
|
20
|
+
from ...models.create_datasource_from_content_request import CreateDatasourceFromContentRequest
|
|
21
|
+
from ...models.datasource_metadata import DatasourceMetadata
|
|
22
|
+
from ...types import Response
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _get_kwargs(
|
|
26
|
+
*,
|
|
27
|
+
body: CreateDatasourceFromContentRequest,
|
|
28
|
+
) -> dict[str, Any]:
|
|
29
|
+
headers: Dict[str, Any] = {}
|
|
30
|
+
|
|
31
|
+
_kwargs: dict[str, Any] = {
|
|
32
|
+
"method": "post",
|
|
33
|
+
"url": "/datasource/",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_body = body.to_dict()
|
|
37
|
+
|
|
38
|
+
_kwargs["json"] = _body
|
|
39
|
+
headers["Content-Type"] = "application/json"
|
|
40
|
+
|
|
41
|
+
_kwargs["headers"] = headers
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _parse_response(*, response: httpx.Response) -> DatasourceMetadata:
|
|
46
|
+
if response.status_code == 201:
|
|
47
|
+
response_201 = DatasourceMetadata.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_201
|
|
50
|
+
if response.status_code == 401:
|
|
51
|
+
raise get_error_for_response(response)
|
|
52
|
+
if response.status_code == 500:
|
|
53
|
+
raise get_error_for_response(response)
|
|
54
|
+
if response.status_code == 503:
|
|
55
|
+
raise get_error_for_response(response)
|
|
56
|
+
else:
|
|
57
|
+
raise get_error_for_response(response)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _build_response(*, response: httpx.Response) -> Response[DatasourceMetadata]:
|
|
61
|
+
return Response(
|
|
62
|
+
status_code=HTTPStatus(response.status_code),
|
|
63
|
+
content=response.content,
|
|
64
|
+
headers=response.headers,
|
|
65
|
+
parsed=_parse_response(response=response),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def sync_detailed(
|
|
70
|
+
*,
|
|
71
|
+
body: CreateDatasourceFromContentRequest,
|
|
72
|
+
) -> Response[DatasourceMetadata]:
|
|
73
|
+
r"""Create Datasource From Content
|
|
74
|
+
|
|
75
|
+
Create a datasource from JSON content.
|
|
76
|
+
|
|
77
|
+
Automatically detects and supports multiple JSON formats:
|
|
78
|
+
- List of records: [{\"col1\": val1, \"col2\": val2}, {\"col1\": val3, \"col2\": val4}, ...]
|
|
79
|
+
- Dictionary of columns: {\"col1\": [val1, val3, ...], \"col2\": [val2, val4, ...]}
|
|
80
|
+
|
|
81
|
+
Params:
|
|
82
|
+
auth_context: Authentication context
|
|
83
|
+
request: Request containing name, description, and JSON content
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Metadata for the created datasource
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
body (CreateDatasourceFromContentRequest): Request model for creating a datasource from
|
|
90
|
+
JSON content.
|
|
91
|
+
|
|
92
|
+
Raises:
|
|
93
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
94
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
Response[DatasourceMetadata]
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
kwargs = _get_kwargs(
|
|
101
|
+
body=body,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
with _client_context() as client:
|
|
105
|
+
response = client.get_httpx_client().request(
|
|
106
|
+
**kwargs,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return _build_response(response=response)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def sync(
|
|
113
|
+
*,
|
|
114
|
+
body: CreateDatasourceFromContentRequest,
|
|
115
|
+
) -> DatasourceMetadata:
|
|
116
|
+
r"""Create Datasource From Content
|
|
117
|
+
|
|
118
|
+
Create a datasource from JSON content.
|
|
119
|
+
|
|
120
|
+
Automatically detects and supports multiple JSON formats:
|
|
121
|
+
- List of records: [{\"col1\": val1, \"col2\": val2}, {\"col1\": val3, \"col2\": val4}, ...]
|
|
122
|
+
- Dictionary of columns: {\"col1\": [val1, val3, ...], \"col2\": [val2, val4, ...]}
|
|
123
|
+
|
|
124
|
+
Params:
|
|
125
|
+
auth_context: Authentication context
|
|
126
|
+
request: Request containing name, description, and JSON content
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
Metadata for the created datasource
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
body (CreateDatasourceFromContentRequest): Request model for creating a datasource from
|
|
133
|
+
JSON content.
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
DatasourceMetadata
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
return sync_detailed(
|
|
144
|
+
body=body,
|
|
145
|
+
).parsed
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
async def asyncio_detailed(
|
|
149
|
+
*,
|
|
150
|
+
body: CreateDatasourceFromContentRequest,
|
|
151
|
+
) -> Response[DatasourceMetadata]:
|
|
152
|
+
r"""Create Datasource From Content
|
|
153
|
+
|
|
154
|
+
Create a datasource from JSON content.
|
|
155
|
+
|
|
156
|
+
Automatically detects and supports multiple JSON formats:
|
|
157
|
+
- List of records: [{\"col1\": val1, \"col2\": val2}, {\"col1\": val3, \"col2\": val4}, ...]
|
|
158
|
+
- Dictionary of columns: {\"col1\": [val1, val3, ...], \"col2\": [val2, val4, ...]}
|
|
159
|
+
|
|
160
|
+
Params:
|
|
161
|
+
auth_context: Authentication context
|
|
162
|
+
request: Request containing name, description, and JSON content
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Metadata for the created datasource
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
body (CreateDatasourceFromContentRequest): Request model for creating a datasource from
|
|
169
|
+
JSON content.
|
|
170
|
+
|
|
171
|
+
Raises:
|
|
172
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
173
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
Response[DatasourceMetadata]
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
kwargs = _get_kwargs(
|
|
180
|
+
body=body,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
with _client_context() as client:
|
|
184
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
185
|
+
|
|
186
|
+
return _build_response(response=response)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
async def asyncio(
|
|
190
|
+
*,
|
|
191
|
+
body: CreateDatasourceFromContentRequest,
|
|
192
|
+
) -> DatasourceMetadata:
|
|
193
|
+
r"""Create Datasource From Content
|
|
194
|
+
|
|
195
|
+
Create a datasource from JSON content.
|
|
196
|
+
|
|
197
|
+
Automatically detects and supports multiple JSON formats:
|
|
198
|
+
- List of records: [{\"col1\": val1, \"col2\": val2}, {\"col1\": val3, \"col2\": val4}, ...]
|
|
199
|
+
- Dictionary of columns: {\"col1\": [val1, val3, ...], \"col2\": [val2, val4, ...]}
|
|
200
|
+
|
|
201
|
+
Params:
|
|
202
|
+
auth_context: Authentication context
|
|
203
|
+
request: Request containing name, description, and JSON content
|
|
204
|
+
|
|
205
|
+
Returns:
|
|
206
|
+
Metadata for the created datasource
|
|
207
|
+
|
|
208
|
+
Args:
|
|
209
|
+
body (CreateDatasourceFromContentRequest): Request model for creating a datasource from
|
|
210
|
+
JSON content.
|
|
211
|
+
|
|
212
|
+
Raises:
|
|
213
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
214
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
215
|
+
|
|
216
|
+
Returns:
|
|
217
|
+
DatasourceMetadata
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
await asyncio_detailed(
|
|
222
|
+
body=body,
|
|
223
|
+
)
|
|
224
|
+
).parsed
|
orca_sdk/_generated_api_client/api/datasource/create_datasource_from_files_datasource_upload_post.py
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
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, Dict
|
|
15
|
+
|
|
16
|
+
import httpx
|
|
17
|
+
|
|
18
|
+
from ...client import _client_context
|
|
19
|
+
from ...errors import get_error_for_response
|
|
20
|
+
from ...models.body_create_datasource_from_files_datasource_upload_post import (
|
|
21
|
+
BodyCreateDatasourceFromFilesDatasourceUploadPost,
|
|
22
|
+
)
|
|
23
|
+
from ...models.datasource_metadata import DatasourceMetadata
|
|
24
|
+
from ...types import Response
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _get_kwargs(
|
|
28
|
+
*,
|
|
29
|
+
body: BodyCreateDatasourceFromFilesDatasourceUploadPost,
|
|
30
|
+
) -> dict[str, Any]:
|
|
31
|
+
headers: Dict[str, Any] = {}
|
|
32
|
+
|
|
33
|
+
_kwargs: dict[str, Any] = {
|
|
34
|
+
"method": "post",
|
|
35
|
+
"url": "/datasource/upload",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_body = body.to_multipart()
|
|
39
|
+
|
|
40
|
+
_kwargs["files"] = _body
|
|
41
|
+
|
|
42
|
+
_kwargs["headers"] = headers
|
|
43
|
+
return _kwargs
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _parse_response(*, response: httpx.Response) -> DatasourceMetadata:
|
|
47
|
+
if response.status_code == 201:
|
|
48
|
+
response_201 = DatasourceMetadata.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_201
|
|
51
|
+
if response.status_code == 401:
|
|
52
|
+
raise get_error_for_response(response)
|
|
53
|
+
if response.status_code == 500:
|
|
54
|
+
raise get_error_for_response(response)
|
|
55
|
+
if response.status_code == 503:
|
|
56
|
+
raise get_error_for_response(response)
|
|
57
|
+
else:
|
|
58
|
+
raise get_error_for_response(response)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _build_response(*, response: httpx.Response) -> Response[DatasourceMetadata]:
|
|
62
|
+
return Response(
|
|
63
|
+
status_code=HTTPStatus(response.status_code),
|
|
64
|
+
content=response.content,
|
|
65
|
+
headers=response.headers,
|
|
66
|
+
parsed=_parse_response(response=response),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync_detailed(
|
|
71
|
+
*,
|
|
72
|
+
body: BodyCreateDatasourceFromFilesDatasourceUploadPost,
|
|
73
|
+
) -> Response[DatasourceMetadata]:
|
|
74
|
+
"""Create Datasource From Files
|
|
75
|
+
|
|
76
|
+
Create a datasource by uploading files.
|
|
77
|
+
|
|
78
|
+
Supports multiple file upload scenarios:
|
|
79
|
+
- Multiple files: HuggingFace Dataset format (dataset_info.json, state.json, .arrow files, etc.)
|
|
80
|
+
- Single file: CSV, JSON, JSONL, Parquet, or Pickle files
|
|
81
|
+
|
|
82
|
+
Params:
|
|
83
|
+
auth_context: Authentication context
|
|
84
|
+
files: List of files to upload
|
|
85
|
+
name: Name for the datasource
|
|
86
|
+
description: Optional description for the datasource
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
Metadata for the created datasource
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
body (BodyCreateDatasourceFromFilesDatasourceUploadPost):
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
96
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Response[DatasourceMetadata]
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
kwargs = _get_kwargs(
|
|
103
|
+
body=body,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
with _client_context() as client:
|
|
107
|
+
response = client.get_httpx_client().request(
|
|
108
|
+
**kwargs,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
return _build_response(response=response)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def sync(
|
|
115
|
+
*,
|
|
116
|
+
body: BodyCreateDatasourceFromFilesDatasourceUploadPost,
|
|
117
|
+
) -> DatasourceMetadata:
|
|
118
|
+
"""Create Datasource From Files
|
|
119
|
+
|
|
120
|
+
Create a datasource by uploading files.
|
|
121
|
+
|
|
122
|
+
Supports multiple file upload scenarios:
|
|
123
|
+
- Multiple files: HuggingFace Dataset format (dataset_info.json, state.json, .arrow files, etc.)
|
|
124
|
+
- Single file: CSV, JSON, JSONL, Parquet, or Pickle files
|
|
125
|
+
|
|
126
|
+
Params:
|
|
127
|
+
auth_context: Authentication context
|
|
128
|
+
files: List of files to upload
|
|
129
|
+
name: Name for the datasource
|
|
130
|
+
description: Optional description for the datasource
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
Metadata for the created datasource
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
body (BodyCreateDatasourceFromFilesDatasourceUploadPost):
|
|
137
|
+
|
|
138
|
+
Raises:
|
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
DatasourceMetadata
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
return sync_detailed(
|
|
147
|
+
body=body,
|
|
148
|
+
).parsed
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
async def asyncio_detailed(
|
|
152
|
+
*,
|
|
153
|
+
body: BodyCreateDatasourceFromFilesDatasourceUploadPost,
|
|
154
|
+
) -> Response[DatasourceMetadata]:
|
|
155
|
+
"""Create Datasource From Files
|
|
156
|
+
|
|
157
|
+
Create a datasource by uploading files.
|
|
158
|
+
|
|
159
|
+
Supports multiple file upload scenarios:
|
|
160
|
+
- Multiple files: HuggingFace Dataset format (dataset_info.json, state.json, .arrow files, etc.)
|
|
161
|
+
- Single file: CSV, JSON, JSONL, Parquet, or Pickle files
|
|
162
|
+
|
|
163
|
+
Params:
|
|
164
|
+
auth_context: Authentication context
|
|
165
|
+
files: List of files to upload
|
|
166
|
+
name: Name for the datasource
|
|
167
|
+
description: Optional description for the datasource
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Metadata for the created datasource
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
body (BodyCreateDatasourceFromFilesDatasourceUploadPost):
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
Response[DatasourceMetadata]
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
kwargs = _get_kwargs(
|
|
184
|
+
body=body,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
with _client_context() as client:
|
|
188
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
189
|
+
|
|
190
|
+
return _build_response(response=response)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
async def asyncio(
|
|
194
|
+
*,
|
|
195
|
+
body: BodyCreateDatasourceFromFilesDatasourceUploadPost,
|
|
196
|
+
) -> DatasourceMetadata:
|
|
197
|
+
"""Create Datasource From Files
|
|
198
|
+
|
|
199
|
+
Create a datasource by uploading files.
|
|
200
|
+
|
|
201
|
+
Supports multiple file upload scenarios:
|
|
202
|
+
- Multiple files: HuggingFace Dataset format (dataset_info.json, state.json, .arrow files, etc.)
|
|
203
|
+
- Single file: CSV, JSON, JSONL, Parquet, or Pickle files
|
|
204
|
+
|
|
205
|
+
Params:
|
|
206
|
+
auth_context: Authentication context
|
|
207
|
+
files: List of files to upload
|
|
208
|
+
name: Name for the datasource
|
|
209
|
+
description: Optional description for the datasource
|
|
210
|
+
|
|
211
|
+
Returns:
|
|
212
|
+
Metadata for the created datasource
|
|
213
|
+
|
|
214
|
+
Args:
|
|
215
|
+
body (BodyCreateDatasourceFromFilesDatasourceUploadPost):
|
|
216
|
+
|
|
217
|
+
Raises:
|
|
218
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
219
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
DatasourceMetadata
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
await asyncio_detailed(
|
|
227
|
+
body=body,
|
|
228
|
+
)
|
|
229
|
+
).parsed
|
|
@@ -19,7 +19,7 @@ import httpx
|
|
|
19
19
|
|
|
20
20
|
from ...client import _client_context
|
|
21
21
|
from ...errors import get_error_for_response
|
|
22
|
-
from ...models.
|
|
22
|
+
from ...models.paginated_task import PaginatedTask
|
|
23
23
|
from ...models.task_status import TaskStatus
|
|
24
24
|
from ...types import UNSET, Response, Unset
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ def _get_kwargs(
|
|
|
28
28
|
*,
|
|
29
29
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
30
30
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
31
|
-
limit: Union[None, Unset, int] =
|
|
31
|
+
limit: Union[None, Unset, int] = 50,
|
|
32
32
|
offset: Union[Unset, int] = 0,
|
|
33
33
|
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
34
34
|
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
@@ -100,14 +100,9 @@ def _get_kwargs(
|
|
|
100
100
|
return _kwargs
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
def _parse_response(*, response: httpx.Response) ->
|
|
103
|
+
def _parse_response(*, response: httpx.Response) -> PaginatedTask:
|
|
104
104
|
if response.status_code == 200:
|
|
105
|
-
response_200 =
|
|
106
|
-
_response_200 = response.json()
|
|
107
|
-
for response_200_item_data in _response_200:
|
|
108
|
-
response_200_item = Task.from_dict(response_200_item_data)
|
|
109
|
-
|
|
110
|
-
response_200.append(response_200_item)
|
|
105
|
+
response_200 = PaginatedTask.from_dict(response.json())
|
|
111
106
|
|
|
112
107
|
return response_200
|
|
113
108
|
if response.status_code == 401:
|
|
@@ -122,7 +117,7 @@ def _parse_response(*, response: httpx.Response) -> List["Task"]:
|
|
|
122
117
|
raise get_error_for_response(response)
|
|
123
118
|
|
|
124
119
|
|
|
125
|
-
def _build_response(*, response: httpx.Response) -> Response[
|
|
120
|
+
def _build_response(*, response: httpx.Response) -> Response[PaginatedTask]:
|
|
126
121
|
return Response(
|
|
127
122
|
status_code=HTTPStatus(response.status_code),
|
|
128
123
|
content=response.content,
|
|
@@ -135,17 +130,17 @@ def sync_detailed(
|
|
|
135
130
|
*,
|
|
136
131
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
137
132
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
138
|
-
limit: Union[None, Unset, int] =
|
|
133
|
+
limit: Union[None, Unset, int] = 50,
|
|
139
134
|
offset: Union[Unset, int] = 0,
|
|
140
135
|
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
141
136
|
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
142
|
-
) -> Response[
|
|
137
|
+
) -> Response[PaginatedTask]:
|
|
143
138
|
"""List Tasks
|
|
144
139
|
|
|
145
140
|
Args:
|
|
146
141
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
147
142
|
type (Union[List[str], None, Unset, str]):
|
|
148
|
-
limit (Union[None, Unset, int]):
|
|
143
|
+
limit (Union[None, Unset, int]): Default: 50.
|
|
149
144
|
offset (Union[Unset, int]): Default: 0.
|
|
150
145
|
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
151
146
|
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
@@ -155,7 +150,7 @@ def sync_detailed(
|
|
|
155
150
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
151
|
|
|
157
152
|
Returns:
|
|
158
|
-
Response[
|
|
153
|
+
Response[PaginatedTask]
|
|
159
154
|
"""
|
|
160
155
|
|
|
161
156
|
kwargs = _get_kwargs(
|
|
@@ -179,17 +174,17 @@ def sync(
|
|
|
179
174
|
*,
|
|
180
175
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
181
176
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
182
|
-
limit: Union[None, Unset, int] =
|
|
177
|
+
limit: Union[None, Unset, int] = 50,
|
|
183
178
|
offset: Union[Unset, int] = 0,
|
|
184
179
|
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
185
180
|
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
186
|
-
) ->
|
|
181
|
+
) -> PaginatedTask:
|
|
187
182
|
"""List Tasks
|
|
188
183
|
|
|
189
184
|
Args:
|
|
190
185
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
191
186
|
type (Union[List[str], None, Unset, str]):
|
|
192
|
-
limit (Union[None, Unset, int]):
|
|
187
|
+
limit (Union[None, Unset, int]): Default: 50.
|
|
193
188
|
offset (Union[Unset, int]): Default: 0.
|
|
194
189
|
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
195
190
|
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
@@ -199,7 +194,7 @@ def sync(
|
|
|
199
194
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
200
195
|
|
|
201
196
|
Returns:
|
|
202
|
-
|
|
197
|
+
PaginatedTask
|
|
203
198
|
"""
|
|
204
199
|
|
|
205
200
|
return sync_detailed(
|
|
@@ -216,17 +211,17 @@ async def asyncio_detailed(
|
|
|
216
211
|
*,
|
|
217
212
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
218
213
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
219
|
-
limit: Union[None, Unset, int] =
|
|
214
|
+
limit: Union[None, Unset, int] = 50,
|
|
220
215
|
offset: Union[Unset, int] = 0,
|
|
221
216
|
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
222
217
|
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
223
|
-
) -> Response[
|
|
218
|
+
) -> Response[PaginatedTask]:
|
|
224
219
|
"""List Tasks
|
|
225
220
|
|
|
226
221
|
Args:
|
|
227
222
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
228
223
|
type (Union[List[str], None, Unset, str]):
|
|
229
|
-
limit (Union[None, Unset, int]):
|
|
224
|
+
limit (Union[None, Unset, int]): Default: 50.
|
|
230
225
|
offset (Union[Unset, int]): Default: 0.
|
|
231
226
|
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
232
227
|
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
@@ -236,7 +231,7 @@ async def asyncio_detailed(
|
|
|
236
231
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
237
232
|
|
|
238
233
|
Returns:
|
|
239
|
-
Response[
|
|
234
|
+
Response[PaginatedTask]
|
|
240
235
|
"""
|
|
241
236
|
|
|
242
237
|
kwargs = _get_kwargs(
|
|
@@ -258,17 +253,17 @@ async def asyncio(
|
|
|
258
253
|
*,
|
|
259
254
|
status: Union[List[TaskStatus], None, TaskStatus, Unset] = UNSET,
|
|
260
255
|
type: Union[List[str], None, Unset, str] = UNSET,
|
|
261
|
-
limit: Union[None, Unset, int] =
|
|
256
|
+
limit: Union[None, Unset, int] = 50,
|
|
262
257
|
offset: Union[Unset, int] = 0,
|
|
263
258
|
start_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
264
259
|
end_timestamp: Union[None, Unset, datetime.datetime] = UNSET,
|
|
265
|
-
) ->
|
|
260
|
+
) -> PaginatedTask:
|
|
266
261
|
"""List Tasks
|
|
267
262
|
|
|
268
263
|
Args:
|
|
269
264
|
status (Union[List[TaskStatus], None, TaskStatus, Unset]):
|
|
270
265
|
type (Union[List[str], None, Unset, str]):
|
|
271
|
-
limit (Union[None, Unset, int]):
|
|
266
|
+
limit (Union[None, Unset, int]): Default: 50.
|
|
272
267
|
offset (Union[Unset, int]): Default: 0.
|
|
273
268
|
start_timestamp (Union[None, Unset, datetime.datetime]):
|
|
274
269
|
end_timestamp (Union[None, Unset, datetime.datetime]):
|
|
@@ -278,7 +273,7 @@ async def asyncio(
|
|
|
278
273
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
279
274
|
|
|
280
275
|
Returns:
|
|
281
|
-
|
|
276
|
+
PaginatedTask
|
|
282
277
|
"""
|
|
283
278
|
|
|
284
279
|
return (
|