scale-gp-beta 0.1.0a4__py3-none-any.whl → 0.1.0a6__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.
Files changed (42) hide show
  1. scale_gp_beta/_client.py +35 -17
  2. scale_gp_beta/_version.py +1 -1
  3. scale_gp_beta/resources/__init__.py +55 -27
  4. scale_gp_beta/resources/dataset_items.py +586 -0
  5. scale_gp_beta/resources/datasets.py +569 -0
  6. scale_gp_beta/resources/evaluation_items.py +295 -0
  7. scale_gp_beta/resources/{question_sets.py → evaluations.py} +259 -273
  8. scale_gp_beta/types/__init__.py +21 -11
  9. scale_gp_beta/types/dataset.py +27 -0
  10. scale_gp_beta/types/dataset_create_params.py +17 -0
  11. scale_gp_beta/types/{question_set_delete_response.py → dataset_delete_response.py} +3 -3
  12. scale_gp_beta/types/dataset_item.py +27 -0
  13. scale_gp_beta/types/dataset_item_batch_create_params.py +16 -0
  14. scale_gp_beta/types/dataset_item_batch_create_response.py +15 -0
  15. scale_gp_beta/types/dataset_item_delete_response.py +16 -0
  16. scale_gp_beta/types/dataset_item_list_params.py +30 -0
  17. scale_gp_beta/types/dataset_item_retrieve_params.py +13 -0
  18. scale_gp_beta/types/dataset_item_update_params.py +13 -0
  19. scale_gp_beta/types/{question_list_params.py → dataset_list_params.py} +4 -2
  20. scale_gp_beta/types/dataset_retrieve_params.py +11 -0
  21. scale_gp_beta/types/dataset_update_params.py +13 -0
  22. scale_gp_beta/types/evaluation.py +30 -0
  23. scale_gp_beta/types/evaluation_archive_response.py +16 -0
  24. scale_gp_beta/types/evaluation_create_params.py +734 -0
  25. scale_gp_beta/types/evaluation_item.py +29 -0
  26. scale_gp_beta/types/{question_set_list_params.py → evaluation_item_list_params.py} +6 -6
  27. scale_gp_beta/types/evaluation_item_retrieve_params.py +11 -0
  28. scale_gp_beta/types/evaluation_list_params.py +18 -0
  29. scale_gp_beta/types/evaluation_retrieve_params.py +11 -0
  30. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a6.dist-info}/METADATA +1 -1
  31. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a6.dist-info}/RECORD +33 -21
  32. scale_gp_beta/resources/questions.py +0 -396
  33. scale_gp_beta/types/question.py +0 -68
  34. scale_gp_beta/types/question_create_params.py +0 -59
  35. scale_gp_beta/types/question_list.py +0 -27
  36. scale_gp_beta/types/question_set.py +0 -106
  37. scale_gp_beta/types/question_set_create_params.py +0 -115
  38. scale_gp_beta/types/question_set_list.py +0 -27
  39. scale_gp_beta/types/question_set_retrieve_params.py +0 -12
  40. scale_gp_beta/types/question_set_update_params.py +0 -23
  41. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a6.dist-info}/WHEEL +0 -0
  42. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a6.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,295 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+
7
+ import httpx
8
+
9
+ from ..types import evaluation_item_list_params, evaluation_item_retrieve_params
10
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._utils import (
12
+ maybe_transform,
13
+ async_maybe_transform,
14
+ )
15
+ from .._compat import cached_property
16
+ from .._resource import SyncAPIResource, AsyncAPIResource
17
+ from .._response import (
18
+ to_raw_response_wrapper,
19
+ to_streamed_response_wrapper,
20
+ async_to_raw_response_wrapper,
21
+ async_to_streamed_response_wrapper,
22
+ )
23
+ from ..pagination import SyncCursorPage, AsyncCursorPage
24
+ from .._base_client import AsyncPaginator, make_request_options
25
+ from ..types.evaluation_item import EvaluationItem
26
+
27
+ __all__ = ["EvaluationItemsResource", "AsyncEvaluationItemsResource"]
28
+
29
+
30
+ class EvaluationItemsResource(SyncAPIResource):
31
+ @cached_property
32
+ def with_raw_response(self) -> EvaluationItemsResourceWithRawResponse:
33
+ """
34
+ This property can be used as a prefix for any HTTP method call to return
35
+ the raw response object instead of the parsed content.
36
+
37
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
38
+ """
39
+ return EvaluationItemsResourceWithRawResponse(self)
40
+
41
+ @cached_property
42
+ def with_streaming_response(self) -> EvaluationItemsResourceWithStreamingResponse:
43
+ """
44
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
45
+
46
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
47
+ """
48
+ return EvaluationItemsResourceWithStreamingResponse(self)
49
+
50
+ def retrieve(
51
+ self,
52
+ evaluation_item_id: str,
53
+ *,
54
+ include_archived: bool | NotGiven = NOT_GIVEN,
55
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
+ # The extra values given here take precedence over values defined on the client or passed to this method.
57
+ extra_headers: Headers | None = None,
58
+ extra_query: Query | None = None,
59
+ extra_body: Body | None = None,
60
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
+ ) -> EvaluationItem:
62
+ """
63
+ Get Evaluation Item
64
+
65
+ Args:
66
+ extra_headers: Send extra headers
67
+
68
+ extra_query: Add additional query parameters to the request
69
+
70
+ extra_body: Add additional JSON properties to the request
71
+
72
+ timeout: Override the client-level default timeout for this request, in seconds
73
+ """
74
+ if not evaluation_item_id:
75
+ raise ValueError(f"Expected a non-empty value for `evaluation_item_id` but received {evaluation_item_id!r}")
76
+ return self._get(
77
+ f"/v5/evaluation-items/{evaluation_item_id}",
78
+ options=make_request_options(
79
+ extra_headers=extra_headers,
80
+ extra_query=extra_query,
81
+ extra_body=extra_body,
82
+ timeout=timeout,
83
+ query=maybe_transform(
84
+ {"include_archived": include_archived}, evaluation_item_retrieve_params.EvaluationItemRetrieveParams
85
+ ),
86
+ ),
87
+ cast_to=EvaluationItem,
88
+ )
89
+
90
+ def list(
91
+ self,
92
+ *,
93
+ ending_before: Optional[str] | NotGiven = NOT_GIVEN,
94
+ evaluation_id: Optional[str] | NotGiven = NOT_GIVEN,
95
+ include_archived: bool | NotGiven = NOT_GIVEN,
96
+ limit: int | NotGiven = NOT_GIVEN,
97
+ starting_after: Optional[str] | NotGiven = NOT_GIVEN,
98
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99
+ # The extra values given here take precedence over values defined on the client or passed to this method.
100
+ extra_headers: Headers | None = None,
101
+ extra_query: Query | None = None,
102
+ extra_body: Body | None = None,
103
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
104
+ ) -> SyncCursorPage[EvaluationItem]:
105
+ """
106
+ List Evaluation Items
107
+
108
+ Args:
109
+ extra_headers: Send extra headers
110
+
111
+ extra_query: Add additional query parameters to the request
112
+
113
+ extra_body: Add additional JSON properties to the request
114
+
115
+ timeout: Override the client-level default timeout for this request, in seconds
116
+ """
117
+ return self._get_api_list(
118
+ "/v5/evaluation-items",
119
+ page=SyncCursorPage[EvaluationItem],
120
+ options=make_request_options(
121
+ extra_headers=extra_headers,
122
+ extra_query=extra_query,
123
+ extra_body=extra_body,
124
+ timeout=timeout,
125
+ query=maybe_transform(
126
+ {
127
+ "ending_before": ending_before,
128
+ "evaluation_id": evaluation_id,
129
+ "include_archived": include_archived,
130
+ "limit": limit,
131
+ "starting_after": starting_after,
132
+ },
133
+ evaluation_item_list_params.EvaluationItemListParams,
134
+ ),
135
+ ),
136
+ model=EvaluationItem,
137
+ )
138
+
139
+
140
+ class AsyncEvaluationItemsResource(AsyncAPIResource):
141
+ @cached_property
142
+ def with_raw_response(self) -> AsyncEvaluationItemsResourceWithRawResponse:
143
+ """
144
+ This property can be used as a prefix for any HTTP method call to return
145
+ the raw response object instead of the parsed content.
146
+
147
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
148
+ """
149
+ return AsyncEvaluationItemsResourceWithRawResponse(self)
150
+
151
+ @cached_property
152
+ def with_streaming_response(self) -> AsyncEvaluationItemsResourceWithStreamingResponse:
153
+ """
154
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
155
+
156
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
157
+ """
158
+ return AsyncEvaluationItemsResourceWithStreamingResponse(self)
159
+
160
+ async def retrieve(
161
+ self,
162
+ evaluation_item_id: str,
163
+ *,
164
+ include_archived: bool | NotGiven = NOT_GIVEN,
165
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166
+ # The extra values given here take precedence over values defined on the client or passed to this method.
167
+ extra_headers: Headers | None = None,
168
+ extra_query: Query | None = None,
169
+ extra_body: Body | None = None,
170
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
171
+ ) -> EvaluationItem:
172
+ """
173
+ Get Evaluation Item
174
+
175
+ Args:
176
+ extra_headers: Send extra headers
177
+
178
+ extra_query: Add additional query parameters to the request
179
+
180
+ extra_body: Add additional JSON properties to the request
181
+
182
+ timeout: Override the client-level default timeout for this request, in seconds
183
+ """
184
+ if not evaluation_item_id:
185
+ raise ValueError(f"Expected a non-empty value for `evaluation_item_id` but received {evaluation_item_id!r}")
186
+ return await self._get(
187
+ f"/v5/evaluation-items/{evaluation_item_id}",
188
+ options=make_request_options(
189
+ extra_headers=extra_headers,
190
+ extra_query=extra_query,
191
+ extra_body=extra_body,
192
+ timeout=timeout,
193
+ query=await async_maybe_transform(
194
+ {"include_archived": include_archived}, evaluation_item_retrieve_params.EvaluationItemRetrieveParams
195
+ ),
196
+ ),
197
+ cast_to=EvaluationItem,
198
+ )
199
+
200
+ def list(
201
+ self,
202
+ *,
203
+ ending_before: Optional[str] | NotGiven = NOT_GIVEN,
204
+ evaluation_id: Optional[str] | NotGiven = NOT_GIVEN,
205
+ include_archived: bool | NotGiven = NOT_GIVEN,
206
+ limit: int | NotGiven = NOT_GIVEN,
207
+ starting_after: Optional[str] | NotGiven = NOT_GIVEN,
208
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
209
+ # The extra values given here take precedence over values defined on the client or passed to this method.
210
+ extra_headers: Headers | None = None,
211
+ extra_query: Query | None = None,
212
+ extra_body: Body | None = None,
213
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
214
+ ) -> AsyncPaginator[EvaluationItem, AsyncCursorPage[EvaluationItem]]:
215
+ """
216
+ List Evaluation Items
217
+
218
+ Args:
219
+ extra_headers: Send extra headers
220
+
221
+ extra_query: Add additional query parameters to the request
222
+
223
+ extra_body: Add additional JSON properties to the request
224
+
225
+ timeout: Override the client-level default timeout for this request, in seconds
226
+ """
227
+ return self._get_api_list(
228
+ "/v5/evaluation-items",
229
+ page=AsyncCursorPage[EvaluationItem],
230
+ options=make_request_options(
231
+ extra_headers=extra_headers,
232
+ extra_query=extra_query,
233
+ extra_body=extra_body,
234
+ timeout=timeout,
235
+ query=maybe_transform(
236
+ {
237
+ "ending_before": ending_before,
238
+ "evaluation_id": evaluation_id,
239
+ "include_archived": include_archived,
240
+ "limit": limit,
241
+ "starting_after": starting_after,
242
+ },
243
+ evaluation_item_list_params.EvaluationItemListParams,
244
+ ),
245
+ ),
246
+ model=EvaluationItem,
247
+ )
248
+
249
+
250
+ class EvaluationItemsResourceWithRawResponse:
251
+ def __init__(self, evaluation_items: EvaluationItemsResource) -> None:
252
+ self._evaluation_items = evaluation_items
253
+
254
+ self.retrieve = to_raw_response_wrapper(
255
+ evaluation_items.retrieve,
256
+ )
257
+ self.list = to_raw_response_wrapper(
258
+ evaluation_items.list,
259
+ )
260
+
261
+
262
+ class AsyncEvaluationItemsResourceWithRawResponse:
263
+ def __init__(self, evaluation_items: AsyncEvaluationItemsResource) -> None:
264
+ self._evaluation_items = evaluation_items
265
+
266
+ self.retrieve = async_to_raw_response_wrapper(
267
+ evaluation_items.retrieve,
268
+ )
269
+ self.list = async_to_raw_response_wrapper(
270
+ evaluation_items.list,
271
+ )
272
+
273
+
274
+ class EvaluationItemsResourceWithStreamingResponse:
275
+ def __init__(self, evaluation_items: EvaluationItemsResource) -> None:
276
+ self._evaluation_items = evaluation_items
277
+
278
+ self.retrieve = to_streamed_response_wrapper(
279
+ evaluation_items.retrieve,
280
+ )
281
+ self.list = to_streamed_response_wrapper(
282
+ evaluation_items.list,
283
+ )
284
+
285
+
286
+ class AsyncEvaluationItemsResourceWithStreamingResponse:
287
+ def __init__(self, evaluation_items: AsyncEvaluationItemsResource) -> None:
288
+ self._evaluation_items = evaluation_items
289
+
290
+ self.retrieve = async_to_streamed_response_wrapper(
291
+ evaluation_items.retrieve,
292
+ )
293
+ self.list = async_to_streamed_response_wrapper(
294
+ evaluation_items.list,
295
+ )