scale-gp-beta 0.1.0a2__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 (78) hide show
  1. scale_gp/__init__.py +96 -0
  2. scale_gp/_base_client.py +2058 -0
  3. scale_gp/_client.py +544 -0
  4. scale_gp/_compat.py +219 -0
  5. scale_gp/_constants.py +14 -0
  6. scale_gp/_exceptions.py +108 -0
  7. scale_gp/_files.py +123 -0
  8. scale_gp/_models.py +801 -0
  9. scale_gp/_qs.py +150 -0
  10. scale_gp/_resource.py +43 -0
  11. scale_gp/_response.py +830 -0
  12. scale_gp/_streaming.py +333 -0
  13. scale_gp/_types.py +217 -0
  14. scale_gp/_utils/__init__.py +57 -0
  15. scale_gp/_utils/_logs.py +25 -0
  16. scale_gp/_utils/_proxy.py +62 -0
  17. scale_gp/_utils/_reflection.py +42 -0
  18. scale_gp/_utils/_streams.py +12 -0
  19. scale_gp/_utils/_sync.py +86 -0
  20. scale_gp/_utils/_transform.py +402 -0
  21. scale_gp/_utils/_typing.py +149 -0
  22. scale_gp/_utils/_utils.py +414 -0
  23. scale_gp/_version.py +4 -0
  24. scale_gp/lib/.keep +4 -0
  25. scale_gp/pagination.py +83 -0
  26. scale_gp/py.typed +0 -0
  27. scale_gp/resources/__init__.py +103 -0
  28. scale_gp/resources/chat/__init__.py +33 -0
  29. scale_gp/resources/chat/chat.py +102 -0
  30. scale_gp/resources/chat/completions.py +1054 -0
  31. scale_gp/resources/completions.py +765 -0
  32. scale_gp/resources/files/__init__.py +33 -0
  33. scale_gp/resources/files/content.py +162 -0
  34. scale_gp/resources/files/files.py +558 -0
  35. scale_gp/resources/inference.py +210 -0
  36. scale_gp/resources/models.py +834 -0
  37. scale_gp/resources/question_sets.py +680 -0
  38. scale_gp/resources/questions.py +396 -0
  39. scale_gp/types/__init__.py +33 -0
  40. scale_gp/types/chat/__init__.py +8 -0
  41. scale_gp/types/chat/chat_completion.py +257 -0
  42. scale_gp/types/chat/chat_completion_chunk.py +240 -0
  43. scale_gp/types/chat/completion_create_params.py +156 -0
  44. scale_gp/types/chat/completion_create_response.py +11 -0
  45. scale_gp/types/completion.py +116 -0
  46. scale_gp/types/completion_create_params.py +108 -0
  47. scale_gp/types/file.py +30 -0
  48. scale_gp/types/file_create_params.py +13 -0
  49. scale_gp/types/file_delete_response.py +16 -0
  50. scale_gp/types/file_list.py +27 -0
  51. scale_gp/types/file_list_params.py +16 -0
  52. scale_gp/types/file_update_params.py +12 -0
  53. scale_gp/types/files/__init__.py +3 -0
  54. scale_gp/types/inference_create_params.py +25 -0
  55. scale_gp/types/inference_create_response.py +11 -0
  56. scale_gp/types/inference_model.py +167 -0
  57. scale_gp/types/inference_model_list.py +27 -0
  58. scale_gp/types/inference_response.py +14 -0
  59. scale_gp/types/inference_response_chunk.py +14 -0
  60. scale_gp/types/model_create_params.py +165 -0
  61. scale_gp/types/model_delete_response.py +16 -0
  62. scale_gp/types/model_list_params.py +20 -0
  63. scale_gp/types/model_update_params.py +161 -0
  64. scale_gp/types/question.py +68 -0
  65. scale_gp/types/question_create_params.py +59 -0
  66. scale_gp/types/question_list.py +27 -0
  67. scale_gp/types/question_list_params.py +16 -0
  68. scale_gp/types/question_set.py +106 -0
  69. scale_gp/types/question_set_create_params.py +115 -0
  70. scale_gp/types/question_set_delete_response.py +16 -0
  71. scale_gp/types/question_set_list.py +27 -0
  72. scale_gp/types/question_set_list_params.py +20 -0
  73. scale_gp/types/question_set_retrieve_params.py +12 -0
  74. scale_gp/types/question_set_update_params.py +23 -0
  75. scale_gp_beta-0.1.0a2.dist-info/METADATA +440 -0
  76. scale_gp_beta-0.1.0a2.dist-info/RECORD +78 -0
  77. scale_gp_beta-0.1.0a2.dist-info/WHEEL +4 -0
  78. scale_gp_beta-0.1.0a2.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,680 @@
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 List, Optional
6
+ from typing_extensions import Literal, overload
7
+
8
+ import httpx
9
+
10
+ from ..types import (
11
+ question_set_list_params,
12
+ question_set_create_params,
13
+ question_set_update_params,
14
+ question_set_retrieve_params,
15
+ )
16
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
17
+ from .._utils import (
18
+ maybe_transform,
19
+ async_maybe_transform,
20
+ )
21
+ from .._compat import cached_property
22
+ from .._resource import SyncAPIResource, AsyncAPIResource
23
+ from .._response import (
24
+ to_raw_response_wrapper,
25
+ to_streamed_response_wrapper,
26
+ async_to_raw_response_wrapper,
27
+ async_to_streamed_response_wrapper,
28
+ )
29
+ from ..pagination import SyncCursorPage, AsyncCursorPage
30
+ from .._base_client import AsyncPaginator, make_request_options
31
+ from ..types.question_set import QuestionSet
32
+ from ..types.question_set_delete_response import QuestionSetDeleteResponse
33
+
34
+ __all__ = ["QuestionSetsResource", "AsyncQuestionSetsResource"]
35
+
36
+
37
+ class QuestionSetsResource(SyncAPIResource):
38
+ @cached_property
39
+ def with_raw_response(self) -> QuestionSetsResourceWithRawResponse:
40
+ """
41
+ This property can be used as a prefix for any HTTP method call to return
42
+ the raw response object instead of the parsed content.
43
+
44
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
45
+ """
46
+ return QuestionSetsResourceWithRawResponse(self)
47
+
48
+ @cached_property
49
+ def with_streaming_response(self) -> QuestionSetsResourceWithStreamingResponse:
50
+ """
51
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
52
+
53
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
54
+ """
55
+ return QuestionSetsResourceWithStreamingResponse(self)
56
+
57
+ def create(
58
+ self,
59
+ *,
60
+ name: str,
61
+ questions: List[question_set_create_params.Question],
62
+ instructions: str | NotGiven = NOT_GIVEN,
63
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
64
+ # The extra values given here take precedence over values defined on the client or passed to this method.
65
+ extra_headers: Headers | None = None,
66
+ extra_query: Query | None = None,
67
+ extra_body: Body | None = None,
68
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
69
+ ) -> QuestionSet:
70
+ """
71
+ Create Question Set
72
+
73
+ Args:
74
+ questions: IDs of existing questions in the question set or new questions to create. You
75
+ can also optionally specify configurations for each question. Example:
76
+ [`question_id`, {'id': 'question_id2', 'configuration': {...}}, {'title': 'New
77
+ question', ...}]
78
+
79
+ instructions: Instructions to answer questions
80
+
81
+ extra_headers: Send extra headers
82
+
83
+ extra_query: Add additional query parameters to the request
84
+
85
+ extra_body: Add additional JSON properties to the request
86
+
87
+ timeout: Override the client-level default timeout for this request, in seconds
88
+ """
89
+ return self._post(
90
+ "/v5/question-sets",
91
+ body=maybe_transform(
92
+ {
93
+ "name": name,
94
+ "questions": questions,
95
+ "instructions": instructions,
96
+ },
97
+ question_set_create_params.QuestionSetCreateParams,
98
+ ),
99
+ options=make_request_options(
100
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
101
+ ),
102
+ cast_to=QuestionSet,
103
+ )
104
+
105
+ def retrieve(
106
+ self,
107
+ question_set_id: str,
108
+ *,
109
+ views: List[Literal["questions"]] | NotGiven = NOT_GIVEN,
110
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111
+ # The extra values given here take precedence over values defined on the client or passed to this method.
112
+ extra_headers: Headers | None = None,
113
+ extra_query: Query | None = None,
114
+ extra_body: Body | None = None,
115
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
116
+ ) -> QuestionSet:
117
+ """
118
+ Get Question Set
119
+
120
+ Args:
121
+ extra_headers: Send extra headers
122
+
123
+ extra_query: Add additional query parameters to the request
124
+
125
+ extra_body: Add additional JSON properties to the request
126
+
127
+ timeout: Override the client-level default timeout for this request, in seconds
128
+ """
129
+ if not question_set_id:
130
+ raise ValueError(f"Expected a non-empty value for `question_set_id` but received {question_set_id!r}")
131
+ return self._get(
132
+ f"/v5/question-sets/{question_set_id}",
133
+ options=make_request_options(
134
+ extra_headers=extra_headers,
135
+ extra_query=extra_query,
136
+ extra_body=extra_body,
137
+ timeout=timeout,
138
+ query=maybe_transform({"views": views}, question_set_retrieve_params.QuestionSetRetrieveParams),
139
+ ),
140
+ cast_to=QuestionSet,
141
+ )
142
+
143
+ @overload
144
+ def update(
145
+ self,
146
+ question_set_id: str,
147
+ *,
148
+ instructions: str | NotGiven = NOT_GIVEN,
149
+ name: str | NotGiven = NOT_GIVEN,
150
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
151
+ # The extra values given here take precedence over values defined on the client or passed to this method.
152
+ extra_headers: Headers | None = None,
153
+ extra_query: Query | None = None,
154
+ extra_body: Body | None = None,
155
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
156
+ ) -> QuestionSet:
157
+ """
158
+ Update Question Set
159
+
160
+ Args:
161
+ instructions: Instructions to answer questions
162
+
163
+ extra_headers: Send extra headers
164
+
165
+ extra_query: Add additional query parameters to the request
166
+
167
+ extra_body: Add additional JSON properties to the request
168
+
169
+ timeout: Override the client-level default timeout for this request, in seconds
170
+ """
171
+ ...
172
+
173
+ @overload
174
+ def update(
175
+ self,
176
+ question_set_id: str,
177
+ *,
178
+ restore: Literal[True],
179
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
180
+ # The extra values given here take precedence over values defined on the client or passed to this method.
181
+ extra_headers: Headers | None = None,
182
+ extra_query: Query | None = None,
183
+ extra_body: Body | None = None,
184
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
185
+ ) -> QuestionSet:
186
+ """
187
+ Update Question Set
188
+
189
+ Args:
190
+ restore: Set to true to restore the entity from the database.
191
+
192
+ extra_headers: Send extra headers
193
+
194
+ extra_query: Add additional query parameters to the request
195
+
196
+ extra_body: Add additional JSON properties to the request
197
+
198
+ timeout: Override the client-level default timeout for this request, in seconds
199
+ """
200
+ ...
201
+
202
+ def update(
203
+ self,
204
+ question_set_id: str,
205
+ *,
206
+ instructions: str | NotGiven = NOT_GIVEN,
207
+ name: str | NotGiven = NOT_GIVEN,
208
+ restore: Literal[True] | NotGiven = NOT_GIVEN,
209
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
210
+ # The extra values given here take precedence over values defined on the client or passed to this method.
211
+ extra_headers: Headers | None = None,
212
+ extra_query: Query | None = None,
213
+ extra_body: Body | None = None,
214
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
215
+ ) -> QuestionSet:
216
+ if not question_set_id:
217
+ raise ValueError(f"Expected a non-empty value for `question_set_id` but received {question_set_id!r}")
218
+ return self._patch(
219
+ f"/v5/question-sets/{question_set_id}",
220
+ body=maybe_transform(
221
+ {
222
+ "instructions": instructions,
223
+ "name": name,
224
+ "restore": restore,
225
+ },
226
+ question_set_update_params.QuestionSetUpdateParams,
227
+ ),
228
+ options=make_request_options(
229
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
230
+ ),
231
+ cast_to=QuestionSet,
232
+ )
233
+
234
+ def list(
235
+ self,
236
+ *,
237
+ ending_before: Optional[str] | NotGiven = NOT_GIVEN,
238
+ include_archived: bool | NotGiven = NOT_GIVEN,
239
+ limit: int | NotGiven = NOT_GIVEN,
240
+ starting_after: Optional[str] | NotGiven = NOT_GIVEN,
241
+ views: List[Literal["questions"]] | NotGiven = NOT_GIVEN,
242
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243
+ # The extra values given here take precedence over values defined on the client or passed to this method.
244
+ extra_headers: Headers | None = None,
245
+ extra_query: Query | None = None,
246
+ extra_body: Body | None = None,
247
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
248
+ ) -> SyncCursorPage[QuestionSet]:
249
+ """
250
+ List Question Sets
251
+
252
+ Args:
253
+ extra_headers: Send extra headers
254
+
255
+ extra_query: Add additional query parameters to the request
256
+
257
+ extra_body: Add additional JSON properties to the request
258
+
259
+ timeout: Override the client-level default timeout for this request, in seconds
260
+ """
261
+ return self._get_api_list(
262
+ "/v5/question-sets",
263
+ page=SyncCursorPage[QuestionSet],
264
+ options=make_request_options(
265
+ extra_headers=extra_headers,
266
+ extra_query=extra_query,
267
+ extra_body=extra_body,
268
+ timeout=timeout,
269
+ query=maybe_transform(
270
+ {
271
+ "ending_before": ending_before,
272
+ "include_archived": include_archived,
273
+ "limit": limit,
274
+ "starting_after": starting_after,
275
+ "views": views,
276
+ },
277
+ question_set_list_params.QuestionSetListParams,
278
+ ),
279
+ ),
280
+ model=QuestionSet,
281
+ )
282
+
283
+ def delete(
284
+ self,
285
+ question_set_id: str,
286
+ *,
287
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
288
+ # The extra values given here take precedence over values defined on the client or passed to this method.
289
+ extra_headers: Headers | None = None,
290
+ extra_query: Query | None = None,
291
+ extra_body: Body | None = None,
292
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
293
+ ) -> QuestionSetDeleteResponse:
294
+ """
295
+ Archive Question Set
296
+
297
+ Args:
298
+ extra_headers: Send extra headers
299
+
300
+ extra_query: Add additional query parameters to the request
301
+
302
+ extra_body: Add additional JSON properties to the request
303
+
304
+ timeout: Override the client-level default timeout for this request, in seconds
305
+ """
306
+ if not question_set_id:
307
+ raise ValueError(f"Expected a non-empty value for `question_set_id` but received {question_set_id!r}")
308
+ return self._delete(
309
+ f"/v5/question-sets/{question_set_id}",
310
+ options=make_request_options(
311
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
312
+ ),
313
+ cast_to=QuestionSetDeleteResponse,
314
+ )
315
+
316
+
317
+ class AsyncQuestionSetsResource(AsyncAPIResource):
318
+ @cached_property
319
+ def with_raw_response(self) -> AsyncQuestionSetsResourceWithRawResponse:
320
+ """
321
+ This property can be used as a prefix for any HTTP method call to return
322
+ the raw response object instead of the parsed content.
323
+
324
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
325
+ """
326
+ return AsyncQuestionSetsResourceWithRawResponse(self)
327
+
328
+ @cached_property
329
+ def with_streaming_response(self) -> AsyncQuestionSetsResourceWithStreamingResponse:
330
+ """
331
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
332
+
333
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
334
+ """
335
+ return AsyncQuestionSetsResourceWithStreamingResponse(self)
336
+
337
+ async def create(
338
+ self,
339
+ *,
340
+ name: str,
341
+ questions: List[question_set_create_params.Question],
342
+ instructions: str | NotGiven = NOT_GIVEN,
343
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
344
+ # The extra values given here take precedence over values defined on the client or passed to this method.
345
+ extra_headers: Headers | None = None,
346
+ extra_query: Query | None = None,
347
+ extra_body: Body | None = None,
348
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
349
+ ) -> QuestionSet:
350
+ """
351
+ Create Question Set
352
+
353
+ Args:
354
+ questions: IDs of existing questions in the question set or new questions to create. You
355
+ can also optionally specify configurations for each question. Example:
356
+ [`question_id`, {'id': 'question_id2', 'configuration': {...}}, {'title': 'New
357
+ question', ...}]
358
+
359
+ instructions: Instructions to answer questions
360
+
361
+ extra_headers: Send extra headers
362
+
363
+ extra_query: Add additional query parameters to the request
364
+
365
+ extra_body: Add additional JSON properties to the request
366
+
367
+ timeout: Override the client-level default timeout for this request, in seconds
368
+ """
369
+ return await self._post(
370
+ "/v5/question-sets",
371
+ body=await async_maybe_transform(
372
+ {
373
+ "name": name,
374
+ "questions": questions,
375
+ "instructions": instructions,
376
+ },
377
+ question_set_create_params.QuestionSetCreateParams,
378
+ ),
379
+ options=make_request_options(
380
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
381
+ ),
382
+ cast_to=QuestionSet,
383
+ )
384
+
385
+ async def retrieve(
386
+ self,
387
+ question_set_id: str,
388
+ *,
389
+ views: List[Literal["questions"]] | NotGiven = NOT_GIVEN,
390
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
391
+ # The extra values given here take precedence over values defined on the client or passed to this method.
392
+ extra_headers: Headers | None = None,
393
+ extra_query: Query | None = None,
394
+ extra_body: Body | None = None,
395
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
396
+ ) -> QuestionSet:
397
+ """
398
+ Get Question Set
399
+
400
+ Args:
401
+ extra_headers: Send extra headers
402
+
403
+ extra_query: Add additional query parameters to the request
404
+
405
+ extra_body: Add additional JSON properties to the request
406
+
407
+ timeout: Override the client-level default timeout for this request, in seconds
408
+ """
409
+ if not question_set_id:
410
+ raise ValueError(f"Expected a non-empty value for `question_set_id` but received {question_set_id!r}")
411
+ return await self._get(
412
+ f"/v5/question-sets/{question_set_id}",
413
+ options=make_request_options(
414
+ extra_headers=extra_headers,
415
+ extra_query=extra_query,
416
+ extra_body=extra_body,
417
+ timeout=timeout,
418
+ query=await async_maybe_transform(
419
+ {"views": views}, question_set_retrieve_params.QuestionSetRetrieveParams
420
+ ),
421
+ ),
422
+ cast_to=QuestionSet,
423
+ )
424
+
425
+ @overload
426
+ async def update(
427
+ self,
428
+ question_set_id: str,
429
+ *,
430
+ instructions: str | NotGiven = NOT_GIVEN,
431
+ name: str | NotGiven = NOT_GIVEN,
432
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
433
+ # The extra values given here take precedence over values defined on the client or passed to this method.
434
+ extra_headers: Headers | None = None,
435
+ extra_query: Query | None = None,
436
+ extra_body: Body | None = None,
437
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
438
+ ) -> QuestionSet:
439
+ """
440
+ Update Question Set
441
+
442
+ Args:
443
+ instructions: Instructions to answer questions
444
+
445
+ extra_headers: Send extra headers
446
+
447
+ extra_query: Add additional query parameters to the request
448
+
449
+ extra_body: Add additional JSON properties to the request
450
+
451
+ timeout: Override the client-level default timeout for this request, in seconds
452
+ """
453
+ ...
454
+
455
+ @overload
456
+ async def update(
457
+ self,
458
+ question_set_id: str,
459
+ *,
460
+ restore: Literal[True],
461
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
462
+ # The extra values given here take precedence over values defined on the client or passed to this method.
463
+ extra_headers: Headers | None = None,
464
+ extra_query: Query | None = None,
465
+ extra_body: Body | None = None,
466
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
467
+ ) -> QuestionSet:
468
+ """
469
+ Update Question Set
470
+
471
+ Args:
472
+ restore: Set to true to restore the entity from the database.
473
+
474
+ extra_headers: Send extra headers
475
+
476
+ extra_query: Add additional query parameters to the request
477
+
478
+ extra_body: Add additional JSON properties to the request
479
+
480
+ timeout: Override the client-level default timeout for this request, in seconds
481
+ """
482
+ ...
483
+
484
+ async def update(
485
+ self,
486
+ question_set_id: str,
487
+ *,
488
+ instructions: str | NotGiven = NOT_GIVEN,
489
+ name: str | NotGiven = NOT_GIVEN,
490
+ restore: Literal[True] | NotGiven = NOT_GIVEN,
491
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
492
+ # The extra values given here take precedence over values defined on the client or passed to this method.
493
+ extra_headers: Headers | None = None,
494
+ extra_query: Query | None = None,
495
+ extra_body: Body | None = None,
496
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
497
+ ) -> QuestionSet:
498
+ if not question_set_id:
499
+ raise ValueError(f"Expected a non-empty value for `question_set_id` but received {question_set_id!r}")
500
+ return await self._patch(
501
+ f"/v5/question-sets/{question_set_id}",
502
+ body=await async_maybe_transform(
503
+ {
504
+ "instructions": instructions,
505
+ "name": name,
506
+ "restore": restore,
507
+ },
508
+ question_set_update_params.QuestionSetUpdateParams,
509
+ ),
510
+ options=make_request_options(
511
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
512
+ ),
513
+ cast_to=QuestionSet,
514
+ )
515
+
516
+ def list(
517
+ self,
518
+ *,
519
+ ending_before: Optional[str] | NotGiven = NOT_GIVEN,
520
+ include_archived: bool | NotGiven = NOT_GIVEN,
521
+ limit: int | NotGiven = NOT_GIVEN,
522
+ starting_after: Optional[str] | NotGiven = NOT_GIVEN,
523
+ views: List[Literal["questions"]] | NotGiven = NOT_GIVEN,
524
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
525
+ # The extra values given here take precedence over values defined on the client or passed to this method.
526
+ extra_headers: Headers | None = None,
527
+ extra_query: Query | None = None,
528
+ extra_body: Body | None = None,
529
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
530
+ ) -> AsyncPaginator[QuestionSet, AsyncCursorPage[QuestionSet]]:
531
+ """
532
+ List Question Sets
533
+
534
+ Args:
535
+ extra_headers: Send extra headers
536
+
537
+ extra_query: Add additional query parameters to the request
538
+
539
+ extra_body: Add additional JSON properties to the request
540
+
541
+ timeout: Override the client-level default timeout for this request, in seconds
542
+ """
543
+ return self._get_api_list(
544
+ "/v5/question-sets",
545
+ page=AsyncCursorPage[QuestionSet],
546
+ options=make_request_options(
547
+ extra_headers=extra_headers,
548
+ extra_query=extra_query,
549
+ extra_body=extra_body,
550
+ timeout=timeout,
551
+ query=maybe_transform(
552
+ {
553
+ "ending_before": ending_before,
554
+ "include_archived": include_archived,
555
+ "limit": limit,
556
+ "starting_after": starting_after,
557
+ "views": views,
558
+ },
559
+ question_set_list_params.QuestionSetListParams,
560
+ ),
561
+ ),
562
+ model=QuestionSet,
563
+ )
564
+
565
+ async def delete(
566
+ self,
567
+ question_set_id: str,
568
+ *,
569
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
570
+ # The extra values given here take precedence over values defined on the client or passed to this method.
571
+ extra_headers: Headers | None = None,
572
+ extra_query: Query | None = None,
573
+ extra_body: Body | None = None,
574
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
575
+ ) -> QuestionSetDeleteResponse:
576
+ """
577
+ Archive Question Set
578
+
579
+ Args:
580
+ extra_headers: Send extra headers
581
+
582
+ extra_query: Add additional query parameters to the request
583
+
584
+ extra_body: Add additional JSON properties to the request
585
+
586
+ timeout: Override the client-level default timeout for this request, in seconds
587
+ """
588
+ if not question_set_id:
589
+ raise ValueError(f"Expected a non-empty value for `question_set_id` but received {question_set_id!r}")
590
+ return await self._delete(
591
+ f"/v5/question-sets/{question_set_id}",
592
+ options=make_request_options(
593
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
594
+ ),
595
+ cast_to=QuestionSetDeleteResponse,
596
+ )
597
+
598
+
599
+ class QuestionSetsResourceWithRawResponse:
600
+ def __init__(self, question_sets: QuestionSetsResource) -> None:
601
+ self._question_sets = question_sets
602
+
603
+ self.create = to_raw_response_wrapper(
604
+ question_sets.create,
605
+ )
606
+ self.retrieve = to_raw_response_wrapper(
607
+ question_sets.retrieve,
608
+ )
609
+ self.update = to_raw_response_wrapper(
610
+ question_sets.update,
611
+ )
612
+ self.list = to_raw_response_wrapper(
613
+ question_sets.list,
614
+ )
615
+ self.delete = to_raw_response_wrapper(
616
+ question_sets.delete,
617
+ )
618
+
619
+
620
+ class AsyncQuestionSetsResourceWithRawResponse:
621
+ def __init__(self, question_sets: AsyncQuestionSetsResource) -> None:
622
+ self._question_sets = question_sets
623
+
624
+ self.create = async_to_raw_response_wrapper(
625
+ question_sets.create,
626
+ )
627
+ self.retrieve = async_to_raw_response_wrapper(
628
+ question_sets.retrieve,
629
+ )
630
+ self.update = async_to_raw_response_wrapper(
631
+ question_sets.update,
632
+ )
633
+ self.list = async_to_raw_response_wrapper(
634
+ question_sets.list,
635
+ )
636
+ self.delete = async_to_raw_response_wrapper(
637
+ question_sets.delete,
638
+ )
639
+
640
+
641
+ class QuestionSetsResourceWithStreamingResponse:
642
+ def __init__(self, question_sets: QuestionSetsResource) -> None:
643
+ self._question_sets = question_sets
644
+
645
+ self.create = to_streamed_response_wrapper(
646
+ question_sets.create,
647
+ )
648
+ self.retrieve = to_streamed_response_wrapper(
649
+ question_sets.retrieve,
650
+ )
651
+ self.update = to_streamed_response_wrapper(
652
+ question_sets.update,
653
+ )
654
+ self.list = to_streamed_response_wrapper(
655
+ question_sets.list,
656
+ )
657
+ self.delete = to_streamed_response_wrapper(
658
+ question_sets.delete,
659
+ )
660
+
661
+
662
+ class AsyncQuestionSetsResourceWithStreamingResponse:
663
+ def __init__(self, question_sets: AsyncQuestionSetsResource) -> None:
664
+ self._question_sets = question_sets
665
+
666
+ self.create = async_to_streamed_response_wrapper(
667
+ question_sets.create,
668
+ )
669
+ self.retrieve = async_to_streamed_response_wrapper(
670
+ question_sets.retrieve,
671
+ )
672
+ self.update = async_to_streamed_response_wrapper(
673
+ question_sets.update,
674
+ )
675
+ self.list = async_to_streamed_response_wrapper(
676
+ question_sets.list,
677
+ )
678
+ self.delete = async_to_streamed_response_wrapper(
679
+ question_sets.delete,
680
+ )