studyfetch-sdk 0.1.0a19__py3-none-any.whl → 0.1.0a21__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 (87) hide show
  1. studyfetch_sdk/_models.py +23 -2
  2. studyfetch_sdk/_version.py +1 -1
  3. studyfetch_sdk/resources/v1/__init__.py +6 -104
  4. studyfetch_sdk/resources/v1/chat.py +246 -0
  5. studyfetch_sdk/resources/v1/materials/materials.py +304 -0
  6. studyfetch_sdk/resources/v1/materials/upload.py +30 -14
  7. studyfetch_sdk/resources/v1/v1.py +20 -244
  8. studyfetch_sdk/types/v1/__init__.py +3 -22
  9. studyfetch_sdk/types/v1/chat_stream_params.py +39 -7
  10. studyfetch_sdk/types/v1/component_create_params.py +24 -0
  11. studyfetch_sdk/types/v1/component_generate_embed_params.py +7 -1
  12. studyfetch_sdk/types/v1/generated_material.py +65 -0
  13. studyfetch_sdk/types/v1/material_generate_and_process_params.py +38 -0
  14. studyfetch_sdk/types/v1/material_generate_params.py +32 -0
  15. studyfetch_sdk/types/v1/materials/upload_complete_upload_params.py +2 -5
  16. studyfetch_sdk/types/v1/materials/upload_create_presigned_url_params.py +3 -0
  17. studyfetch_sdk/types/v1/materials/upload_upload_file_and_process_params.py +4 -1
  18. studyfetch_sdk/types/v1/materials/upload_upload_file_params.py +3 -0
  19. {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/METADATA +1 -1
  20. {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/RECORD +22 -83
  21. studyfetch_sdk/resources/v1/audio_recaps/__init__.py +0 -33
  22. studyfetch_sdk/resources/v1/audio_recaps/audio_recaps.py +0 -328
  23. studyfetch_sdk/resources/v1/audio_recaps/sections.py +0 -250
  24. studyfetch_sdk/resources/v1/chat/__init__.py +0 -47
  25. studyfetch_sdk/resources/v1/chat/chat.py +0 -574
  26. studyfetch_sdk/resources/v1/chat/sessions.py +0 -222
  27. studyfetch_sdk/resources/v1/chat/test.py +0 -190
  28. studyfetch_sdk/resources/v1/data_analyst/__init__.py +0 -47
  29. studyfetch_sdk/resources/v1/data_analyst/data_analyst.py +0 -582
  30. studyfetch_sdk/resources/v1/data_analyst/sessions.py +0 -222
  31. studyfetch_sdk/resources/v1/data_analyst/test.py +0 -190
  32. studyfetch_sdk/resources/v1/explainers.py +0 -441
  33. studyfetch_sdk/resources/v1/flashcards.py +0 -783
  34. studyfetch_sdk/resources/v1/scenarios/__init__.py +0 -61
  35. studyfetch_sdk/resources/v1/scenarios/component.py +0 -426
  36. studyfetch_sdk/resources/v1/scenarios/scenarios.py +0 -936
  37. studyfetch_sdk/resources/v1/scenarios/sessions.py +0 -236
  38. studyfetch_sdk/resources/v1/scenarios/submissions/__init__.py +0 -33
  39. studyfetch_sdk/resources/v1/scenarios/submissions/submissions.py +0 -102
  40. studyfetch_sdk/resources/v1/scenarios/submissions/user.py +0 -210
  41. studyfetch_sdk/resources/v1/tests/__init__.py +0 -33
  42. studyfetch_sdk/resources/v1/tests/component.py +0 -160
  43. studyfetch_sdk/resources/v1/tests/tests.py +0 -682
  44. studyfetch_sdk/resources/v1/upload/__init__.py +0 -33
  45. studyfetch_sdk/resources/v1/upload/component.py +0 -572
  46. studyfetch_sdk/resources/v1/upload/upload.py +0 -102
  47. studyfetch_sdk/types/v1/audio_recaps/__init__.py +0 -3
  48. studyfetch_sdk/types/v1/chat/__init__.py +0 -5
  49. studyfetch_sdk/types/v1/chat/session_retrieve_params.py +0 -11
  50. studyfetch_sdk/types/v1/chat_get_session_params.py +0 -13
  51. studyfetch_sdk/types/v1/chat_send_message_params.py +0 -54
  52. studyfetch_sdk/types/v1/data_analyst/__init__.py +0 -5
  53. studyfetch_sdk/types/v1/data_analyst/session_retrieve_params.py +0 -11
  54. studyfetch_sdk/types/v1/data_analyst_retrieve_session_params.py +0 -13
  55. studyfetch_sdk/types/v1/data_analyst_send_message_params.py +0 -54
  56. studyfetch_sdk/types/v1/data_analyst_stream_params.py +0 -28
  57. studyfetch_sdk/types/v1/explainer_create_params.py +0 -45
  58. studyfetch_sdk/types/v1/explainer_handle_webhook_params.py +0 -53
  59. studyfetch_sdk/types/v1/flashcard_batch_process_params.py +0 -36
  60. studyfetch_sdk/types/v1/flashcard_batch_process_response.py +0 -39
  61. studyfetch_sdk/types/v1/flashcard_get_algorithm_response.py +0 -37
  62. studyfetch_sdk/types/v1/flashcard_get_all_params.py +0 -23
  63. studyfetch_sdk/types/v1/flashcard_get_due_params.py +0 -19
  64. studyfetch_sdk/types/v1/flashcard_get_stats_params.py +0 -17
  65. studyfetch_sdk/types/v1/flashcard_get_types_response.py +0 -14
  66. studyfetch_sdk/types/v1/flashcard_rate_params.py +0 -23
  67. studyfetch_sdk/types/v1/scenario_create_params.py +0 -48
  68. studyfetch_sdk/types/v1/scenario_submit_answer_params.py +0 -18
  69. studyfetch_sdk/types/v1/scenario_update_params.py +0 -45
  70. studyfetch_sdk/types/v1/scenarios/__init__.py +0 -5
  71. studyfetch_sdk/types/v1/scenarios/component_update_params.py +0 -45
  72. studyfetch_sdk/types/v1/scenarios/submissions/__init__.py +0 -3
  73. studyfetch_sdk/types/v1/test_create_params.py +0 -20
  74. studyfetch_sdk/types/v1/test_retake_params.py +0 -14
  75. studyfetch_sdk/types/v1/test_submit_answer_params.py +0 -20
  76. studyfetch_sdk/types/v1/test_submit_params.py +0 -14
  77. studyfetch_sdk/types/v1/tests/__init__.py +0 -3
  78. studyfetch_sdk/types/v1/upload/__init__.py +0 -11
  79. studyfetch_sdk/types/v1/upload/component_complete_upload_params.py +0 -20
  80. studyfetch_sdk/types/v1/upload/component_complete_upload_response.py +0 -16
  81. studyfetch_sdk/types/v1/upload/component_get_presigned_url_params.py +0 -23
  82. studyfetch_sdk/types/v1/upload/component_get_presigned_url_response.py +0 -15
  83. studyfetch_sdk/types/v1/upload/component_upload_file_params.py +0 -21
  84. studyfetch_sdk/types/v1/upload/component_upload_url_params.py +0 -23
  85. studyfetch_sdk/types/v1/upload/file_upload_response.py +0 -24
  86. {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/WHEEL +0 -0
  87. {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/licenses/LICENSE +0 -0
@@ -1,783 +0,0 @@
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 Iterable
6
-
7
- import httpx
8
-
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
10
- from ..._utils import maybe_transform, async_maybe_transform
11
- from ..._compat import cached_property
12
- from ...types.v1 import (
13
- flashcard_rate_params,
14
- flashcard_get_all_params,
15
- flashcard_get_due_params,
16
- flashcard_get_stats_params,
17
- flashcard_batch_process_params,
18
- )
19
- from ..._resource import SyncAPIResource, AsyncAPIResource
20
- from ..._response import (
21
- to_raw_response_wrapper,
22
- to_streamed_response_wrapper,
23
- async_to_raw_response_wrapper,
24
- async_to_streamed_response_wrapper,
25
- )
26
- from ..._base_client import make_request_options
27
- from ...types.v1.flashcard_get_types_response import FlashcardGetTypesResponse
28
- from ...types.v1.flashcard_batch_process_response import FlashcardBatchProcessResponse
29
- from ...types.v1.flashcard_get_algorithm_response import FlashcardGetAlgorithmResponse
30
-
31
- __all__ = ["FlashcardsResource", "AsyncFlashcardsResource"]
32
-
33
-
34
- class FlashcardsResource(SyncAPIResource):
35
- @cached_property
36
- def with_raw_response(self) -> FlashcardsResourceWithRawResponse:
37
- """
38
- This property can be used as a prefix for any HTTP method call to return
39
- the raw response object instead of the parsed content.
40
-
41
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
42
- """
43
- return FlashcardsResourceWithRawResponse(self)
44
-
45
- @cached_property
46
- def with_streaming_response(self) -> FlashcardsResourceWithStreamingResponse:
47
- """
48
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
49
-
50
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
51
- """
52
- return FlashcardsResourceWithStreamingResponse(self)
53
-
54
- def batch_process(
55
- self,
56
- component_id: str,
57
- *,
58
- operations: Iterable[flashcard_batch_process_params.Operation],
59
- group_id: str | NotGiven = NOT_GIVEN,
60
- user_id: str | NotGiven = NOT_GIVEN,
61
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
- # The extra values given here take precedence over values defined on the client or passed to this method.
63
- extra_headers: Headers | None = None,
64
- extra_query: Query | None = None,
65
- extra_body: Body | None = None,
66
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
67
- ) -> FlashcardBatchProcessResponse:
68
- """
69
- Process multiple flashcard operations
70
-
71
- Args:
72
- group_id: Group ID (optional)
73
-
74
- user_id: User ID (optional)
75
-
76
- extra_headers: Send extra headers
77
-
78
- extra_query: Add additional query parameters to the request
79
-
80
- extra_body: Add additional JSON properties to the request
81
-
82
- timeout: Override the client-level default timeout for this request, in seconds
83
- """
84
- if not component_id:
85
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
86
- return self._post(
87
- f"/api/v1/flashcards/{component_id}/batch",
88
- body=maybe_transform(
89
- {
90
- "operations": operations,
91
- "group_id": group_id,
92
- "user_id": user_id,
93
- },
94
- flashcard_batch_process_params.FlashcardBatchProcessParams,
95
- ),
96
- options=make_request_options(
97
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
98
- ),
99
- cast_to=FlashcardBatchProcessResponse,
100
- )
101
-
102
- def get_algorithm(
103
- self,
104
- *,
105
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
106
- # The extra values given here take precedence over values defined on the client or passed to this method.
107
- extra_headers: Headers | None = None,
108
- extra_query: Query | None = None,
109
- extra_body: Body | None = None,
110
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
111
- ) -> FlashcardGetAlgorithmResponse:
112
- """Get spaced repetition algorithm info"""
113
- return self._get(
114
- "/api/v1/flashcards/algorithm",
115
- options=make_request_options(
116
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
117
- ),
118
- cast_to=FlashcardGetAlgorithmResponse,
119
- )
120
-
121
- def get_all(
122
- self,
123
- component_id: str,
124
- *,
125
- group_ids: str | NotGiven = NOT_GIVEN,
126
- limit: float | NotGiven = NOT_GIVEN,
127
- offset: float | NotGiven = NOT_GIVEN,
128
- user_id: str | NotGiven = NOT_GIVEN,
129
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130
- # The extra values given here take precedence over values defined on the client or passed to this method.
131
- extra_headers: Headers | None = None,
132
- extra_query: Query | None = None,
133
- extra_body: Body | None = None,
134
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
135
- ) -> None:
136
- """
137
- Get all flashcards for component
138
-
139
- Args:
140
- group_ids: Group IDs (comma-separated)
141
-
142
- limit: Max number of cards
143
-
144
- offset: Offset
145
-
146
- user_id: User ID
147
-
148
- extra_headers: Send extra headers
149
-
150
- extra_query: Add additional query parameters to the request
151
-
152
- extra_body: Add additional JSON properties to the request
153
-
154
- timeout: Override the client-level default timeout for this request, in seconds
155
- """
156
- if not component_id:
157
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
158
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
159
- return self._get(
160
- f"/api/v1/flashcards/{component_id}/all",
161
- options=make_request_options(
162
- extra_headers=extra_headers,
163
- extra_query=extra_query,
164
- extra_body=extra_body,
165
- timeout=timeout,
166
- query=maybe_transform(
167
- {
168
- "group_ids": group_ids,
169
- "limit": limit,
170
- "offset": offset,
171
- "user_id": user_id,
172
- },
173
- flashcard_get_all_params.FlashcardGetAllParams,
174
- ),
175
- ),
176
- cast_to=NoneType,
177
- )
178
-
179
- def get_due(
180
- self,
181
- component_id: str,
182
- *,
183
- group_ids: str,
184
- limit: float | NotGiven = NOT_GIVEN,
185
- user_id: str | NotGiven = NOT_GIVEN,
186
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
187
- # The extra values given here take precedence over values defined on the client or passed to this method.
188
- extra_headers: Headers | None = None,
189
- extra_query: Query | None = None,
190
- extra_body: Body | None = None,
191
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
192
- ) -> None:
193
- """
194
- Get due flashcards for review
195
-
196
- Args:
197
- limit: Max number of cards
198
-
199
- user_id: User ID
200
-
201
- extra_headers: Send extra headers
202
-
203
- extra_query: Add additional query parameters to the request
204
-
205
- extra_body: Add additional JSON properties to the request
206
-
207
- timeout: Override the client-level default timeout for this request, in seconds
208
- """
209
- if not component_id:
210
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
211
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
212
- return self._get(
213
- f"/api/v1/flashcards/{component_id}/due",
214
- options=make_request_options(
215
- extra_headers=extra_headers,
216
- extra_query=extra_query,
217
- extra_body=extra_body,
218
- timeout=timeout,
219
- query=maybe_transform(
220
- {
221
- "group_ids": group_ids,
222
- "limit": limit,
223
- "user_id": user_id,
224
- },
225
- flashcard_get_due_params.FlashcardGetDueParams,
226
- ),
227
- ),
228
- cast_to=NoneType,
229
- )
230
-
231
- def get_stats(
232
- self,
233
- component_id: str,
234
- *,
235
- group_ids: str | NotGiven = NOT_GIVEN,
236
- user_id: str | NotGiven = NOT_GIVEN,
237
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
238
- # The extra values given here take precedence over values defined on the client or passed to this method.
239
- extra_headers: Headers | None = None,
240
- extra_query: Query | None = None,
241
- extra_body: Body | None = None,
242
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
243
- ) -> None:
244
- """
245
- Get flashcard statistics
246
-
247
- Args:
248
- group_ids: Group IDs (comma-separated)
249
-
250
- user_id: User ID
251
-
252
- extra_headers: Send extra headers
253
-
254
- extra_query: Add additional query parameters to the request
255
-
256
- extra_body: Add additional JSON properties to the request
257
-
258
- timeout: Override the client-level default timeout for this request, in seconds
259
- """
260
- if not component_id:
261
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
262
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
263
- return self._get(
264
- f"/api/v1/flashcards/{component_id}/stats",
265
- options=make_request_options(
266
- extra_headers=extra_headers,
267
- extra_query=extra_query,
268
- extra_body=extra_body,
269
- timeout=timeout,
270
- query=maybe_transform(
271
- {
272
- "group_ids": group_ids,
273
- "user_id": user_id,
274
- },
275
- flashcard_get_stats_params.FlashcardGetStatsParams,
276
- ),
277
- ),
278
- cast_to=NoneType,
279
- )
280
-
281
- def get_types(
282
- self,
283
- *,
284
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
285
- # The extra values given here take precedence over values defined on the client or passed to this method.
286
- extra_headers: Headers | None = None,
287
- extra_query: Query | None = None,
288
- extra_body: Body | None = None,
289
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
290
- ) -> FlashcardGetTypesResponse:
291
- """Get available flashcard types"""
292
- return self._get(
293
- "/api/v1/flashcards/types",
294
- options=make_request_options(
295
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
296
- ),
297
- cast_to=FlashcardGetTypesResponse,
298
- )
299
-
300
- def rate(
301
- self,
302
- component_id: str,
303
- *,
304
- card_id: str,
305
- rating: float,
306
- group_id: str | NotGiven = NOT_GIVEN,
307
- user_id: str | NotGiven = NOT_GIVEN,
308
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
309
- # The extra values given here take precedence over values defined on the client or passed to this method.
310
- extra_headers: Headers | None = None,
311
- extra_query: Query | None = None,
312
- extra_body: Body | None = None,
313
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
314
- ) -> None:
315
- """
316
- Rate a flashcard
317
-
318
- Args:
319
- card_id: Flashcard ID
320
-
321
- rating: Rating (0-3)
322
-
323
- group_id: Group ID (optional)
324
-
325
- user_id: User ID (optional)
326
-
327
- extra_headers: Send extra headers
328
-
329
- extra_query: Add additional query parameters to the request
330
-
331
- extra_body: Add additional JSON properties to the request
332
-
333
- timeout: Override the client-level default timeout for this request, in seconds
334
- """
335
- if not component_id:
336
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
337
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
338
- return self._post(
339
- f"/api/v1/flashcards/{component_id}/rate",
340
- body=maybe_transform(
341
- {
342
- "card_id": card_id,
343
- "rating": rating,
344
- "group_id": group_id,
345
- "user_id": user_id,
346
- },
347
- flashcard_rate_params.FlashcardRateParams,
348
- ),
349
- options=make_request_options(
350
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
351
- ),
352
- cast_to=NoneType,
353
- )
354
-
355
-
356
- class AsyncFlashcardsResource(AsyncAPIResource):
357
- @cached_property
358
- def with_raw_response(self) -> AsyncFlashcardsResourceWithRawResponse:
359
- """
360
- This property can be used as a prefix for any HTTP method call to return
361
- the raw response object instead of the parsed content.
362
-
363
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
364
- """
365
- return AsyncFlashcardsResourceWithRawResponse(self)
366
-
367
- @cached_property
368
- def with_streaming_response(self) -> AsyncFlashcardsResourceWithStreamingResponse:
369
- """
370
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
371
-
372
- For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
373
- """
374
- return AsyncFlashcardsResourceWithStreamingResponse(self)
375
-
376
- async def batch_process(
377
- self,
378
- component_id: str,
379
- *,
380
- operations: Iterable[flashcard_batch_process_params.Operation],
381
- group_id: str | NotGiven = NOT_GIVEN,
382
- user_id: str | NotGiven = NOT_GIVEN,
383
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
384
- # The extra values given here take precedence over values defined on the client or passed to this method.
385
- extra_headers: Headers | None = None,
386
- extra_query: Query | None = None,
387
- extra_body: Body | None = None,
388
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
389
- ) -> FlashcardBatchProcessResponse:
390
- """
391
- Process multiple flashcard operations
392
-
393
- Args:
394
- group_id: Group ID (optional)
395
-
396
- user_id: User ID (optional)
397
-
398
- extra_headers: Send extra headers
399
-
400
- extra_query: Add additional query parameters to the request
401
-
402
- extra_body: Add additional JSON properties to the request
403
-
404
- timeout: Override the client-level default timeout for this request, in seconds
405
- """
406
- if not component_id:
407
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
408
- return await self._post(
409
- f"/api/v1/flashcards/{component_id}/batch",
410
- body=await async_maybe_transform(
411
- {
412
- "operations": operations,
413
- "group_id": group_id,
414
- "user_id": user_id,
415
- },
416
- flashcard_batch_process_params.FlashcardBatchProcessParams,
417
- ),
418
- options=make_request_options(
419
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
420
- ),
421
- cast_to=FlashcardBatchProcessResponse,
422
- )
423
-
424
- async def get_algorithm(
425
- self,
426
- *,
427
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
428
- # The extra values given here take precedence over values defined on the client or passed to this method.
429
- extra_headers: Headers | None = None,
430
- extra_query: Query | None = None,
431
- extra_body: Body | None = None,
432
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
433
- ) -> FlashcardGetAlgorithmResponse:
434
- """Get spaced repetition algorithm info"""
435
- return await self._get(
436
- "/api/v1/flashcards/algorithm",
437
- options=make_request_options(
438
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
439
- ),
440
- cast_to=FlashcardGetAlgorithmResponse,
441
- )
442
-
443
- async def get_all(
444
- self,
445
- component_id: str,
446
- *,
447
- group_ids: str | NotGiven = NOT_GIVEN,
448
- limit: float | NotGiven = NOT_GIVEN,
449
- offset: float | NotGiven = NOT_GIVEN,
450
- user_id: str | NotGiven = NOT_GIVEN,
451
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
452
- # The extra values given here take precedence over values defined on the client or passed to this method.
453
- extra_headers: Headers | None = None,
454
- extra_query: Query | None = None,
455
- extra_body: Body | None = None,
456
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
457
- ) -> None:
458
- """
459
- Get all flashcards for component
460
-
461
- Args:
462
- group_ids: Group IDs (comma-separated)
463
-
464
- limit: Max number of cards
465
-
466
- offset: Offset
467
-
468
- user_id: User ID
469
-
470
- extra_headers: Send extra headers
471
-
472
- extra_query: Add additional query parameters to the request
473
-
474
- extra_body: Add additional JSON properties to the request
475
-
476
- timeout: Override the client-level default timeout for this request, in seconds
477
- """
478
- if not component_id:
479
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
480
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
481
- return await self._get(
482
- f"/api/v1/flashcards/{component_id}/all",
483
- options=make_request_options(
484
- extra_headers=extra_headers,
485
- extra_query=extra_query,
486
- extra_body=extra_body,
487
- timeout=timeout,
488
- query=await async_maybe_transform(
489
- {
490
- "group_ids": group_ids,
491
- "limit": limit,
492
- "offset": offset,
493
- "user_id": user_id,
494
- },
495
- flashcard_get_all_params.FlashcardGetAllParams,
496
- ),
497
- ),
498
- cast_to=NoneType,
499
- )
500
-
501
- async def get_due(
502
- self,
503
- component_id: str,
504
- *,
505
- group_ids: str,
506
- limit: float | NotGiven = NOT_GIVEN,
507
- user_id: str | NotGiven = NOT_GIVEN,
508
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
509
- # The extra values given here take precedence over values defined on the client or passed to this method.
510
- extra_headers: Headers | None = None,
511
- extra_query: Query | None = None,
512
- extra_body: Body | None = None,
513
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
514
- ) -> None:
515
- """
516
- Get due flashcards for review
517
-
518
- Args:
519
- limit: Max number of cards
520
-
521
- user_id: User ID
522
-
523
- extra_headers: Send extra headers
524
-
525
- extra_query: Add additional query parameters to the request
526
-
527
- extra_body: Add additional JSON properties to the request
528
-
529
- timeout: Override the client-level default timeout for this request, in seconds
530
- """
531
- if not component_id:
532
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
533
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
534
- return await self._get(
535
- f"/api/v1/flashcards/{component_id}/due",
536
- options=make_request_options(
537
- extra_headers=extra_headers,
538
- extra_query=extra_query,
539
- extra_body=extra_body,
540
- timeout=timeout,
541
- query=await async_maybe_transform(
542
- {
543
- "group_ids": group_ids,
544
- "limit": limit,
545
- "user_id": user_id,
546
- },
547
- flashcard_get_due_params.FlashcardGetDueParams,
548
- ),
549
- ),
550
- cast_to=NoneType,
551
- )
552
-
553
- async def get_stats(
554
- self,
555
- component_id: str,
556
- *,
557
- group_ids: str | NotGiven = NOT_GIVEN,
558
- user_id: str | NotGiven = NOT_GIVEN,
559
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
560
- # The extra values given here take precedence over values defined on the client or passed to this method.
561
- extra_headers: Headers | None = None,
562
- extra_query: Query | None = None,
563
- extra_body: Body | None = None,
564
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
565
- ) -> None:
566
- """
567
- Get flashcard statistics
568
-
569
- Args:
570
- group_ids: Group IDs (comma-separated)
571
-
572
- user_id: User ID
573
-
574
- extra_headers: Send extra headers
575
-
576
- extra_query: Add additional query parameters to the request
577
-
578
- extra_body: Add additional JSON properties to the request
579
-
580
- timeout: Override the client-level default timeout for this request, in seconds
581
- """
582
- if not component_id:
583
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
584
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
585
- return await self._get(
586
- f"/api/v1/flashcards/{component_id}/stats",
587
- options=make_request_options(
588
- extra_headers=extra_headers,
589
- extra_query=extra_query,
590
- extra_body=extra_body,
591
- timeout=timeout,
592
- query=await async_maybe_transform(
593
- {
594
- "group_ids": group_ids,
595
- "user_id": user_id,
596
- },
597
- flashcard_get_stats_params.FlashcardGetStatsParams,
598
- ),
599
- ),
600
- cast_to=NoneType,
601
- )
602
-
603
- async def get_types(
604
- self,
605
- *,
606
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
607
- # The extra values given here take precedence over values defined on the client or passed to this method.
608
- extra_headers: Headers | None = None,
609
- extra_query: Query | None = None,
610
- extra_body: Body | None = None,
611
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
612
- ) -> FlashcardGetTypesResponse:
613
- """Get available flashcard types"""
614
- return await self._get(
615
- "/api/v1/flashcards/types",
616
- options=make_request_options(
617
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
618
- ),
619
- cast_to=FlashcardGetTypesResponse,
620
- )
621
-
622
- async def rate(
623
- self,
624
- component_id: str,
625
- *,
626
- card_id: str,
627
- rating: float,
628
- group_id: str | NotGiven = NOT_GIVEN,
629
- user_id: str | NotGiven = NOT_GIVEN,
630
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
631
- # The extra values given here take precedence over values defined on the client or passed to this method.
632
- extra_headers: Headers | None = None,
633
- extra_query: Query | None = None,
634
- extra_body: Body | None = None,
635
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
636
- ) -> None:
637
- """
638
- Rate a flashcard
639
-
640
- Args:
641
- card_id: Flashcard ID
642
-
643
- rating: Rating (0-3)
644
-
645
- group_id: Group ID (optional)
646
-
647
- user_id: User ID (optional)
648
-
649
- extra_headers: Send extra headers
650
-
651
- extra_query: Add additional query parameters to the request
652
-
653
- extra_body: Add additional JSON properties to the request
654
-
655
- timeout: Override the client-level default timeout for this request, in seconds
656
- """
657
- if not component_id:
658
- raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
659
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
660
- return await self._post(
661
- f"/api/v1/flashcards/{component_id}/rate",
662
- body=await async_maybe_transform(
663
- {
664
- "card_id": card_id,
665
- "rating": rating,
666
- "group_id": group_id,
667
- "user_id": user_id,
668
- },
669
- flashcard_rate_params.FlashcardRateParams,
670
- ),
671
- options=make_request_options(
672
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
673
- ),
674
- cast_to=NoneType,
675
- )
676
-
677
-
678
- class FlashcardsResourceWithRawResponse:
679
- def __init__(self, flashcards: FlashcardsResource) -> None:
680
- self._flashcards = flashcards
681
-
682
- self.batch_process = to_raw_response_wrapper(
683
- flashcards.batch_process,
684
- )
685
- self.get_algorithm = to_raw_response_wrapper(
686
- flashcards.get_algorithm,
687
- )
688
- self.get_all = to_raw_response_wrapper(
689
- flashcards.get_all,
690
- )
691
- self.get_due = to_raw_response_wrapper(
692
- flashcards.get_due,
693
- )
694
- self.get_stats = to_raw_response_wrapper(
695
- flashcards.get_stats,
696
- )
697
- self.get_types = to_raw_response_wrapper(
698
- flashcards.get_types,
699
- )
700
- self.rate = to_raw_response_wrapper(
701
- flashcards.rate,
702
- )
703
-
704
-
705
- class AsyncFlashcardsResourceWithRawResponse:
706
- def __init__(self, flashcards: AsyncFlashcardsResource) -> None:
707
- self._flashcards = flashcards
708
-
709
- self.batch_process = async_to_raw_response_wrapper(
710
- flashcards.batch_process,
711
- )
712
- self.get_algorithm = async_to_raw_response_wrapper(
713
- flashcards.get_algorithm,
714
- )
715
- self.get_all = async_to_raw_response_wrapper(
716
- flashcards.get_all,
717
- )
718
- self.get_due = async_to_raw_response_wrapper(
719
- flashcards.get_due,
720
- )
721
- self.get_stats = async_to_raw_response_wrapper(
722
- flashcards.get_stats,
723
- )
724
- self.get_types = async_to_raw_response_wrapper(
725
- flashcards.get_types,
726
- )
727
- self.rate = async_to_raw_response_wrapper(
728
- flashcards.rate,
729
- )
730
-
731
-
732
- class FlashcardsResourceWithStreamingResponse:
733
- def __init__(self, flashcards: FlashcardsResource) -> None:
734
- self._flashcards = flashcards
735
-
736
- self.batch_process = to_streamed_response_wrapper(
737
- flashcards.batch_process,
738
- )
739
- self.get_algorithm = to_streamed_response_wrapper(
740
- flashcards.get_algorithm,
741
- )
742
- self.get_all = to_streamed_response_wrapper(
743
- flashcards.get_all,
744
- )
745
- self.get_due = to_streamed_response_wrapper(
746
- flashcards.get_due,
747
- )
748
- self.get_stats = to_streamed_response_wrapper(
749
- flashcards.get_stats,
750
- )
751
- self.get_types = to_streamed_response_wrapper(
752
- flashcards.get_types,
753
- )
754
- self.rate = to_streamed_response_wrapper(
755
- flashcards.rate,
756
- )
757
-
758
-
759
- class AsyncFlashcardsResourceWithStreamingResponse:
760
- def __init__(self, flashcards: AsyncFlashcardsResource) -> None:
761
- self._flashcards = flashcards
762
-
763
- self.batch_process = async_to_streamed_response_wrapper(
764
- flashcards.batch_process,
765
- )
766
- self.get_algorithm = async_to_streamed_response_wrapper(
767
- flashcards.get_algorithm,
768
- )
769
- self.get_all = async_to_streamed_response_wrapper(
770
- flashcards.get_all,
771
- )
772
- self.get_due = async_to_streamed_response_wrapper(
773
- flashcards.get_due,
774
- )
775
- self.get_stats = async_to_streamed_response_wrapper(
776
- flashcards.get_stats,
777
- )
778
- self.get_types = async_to_streamed_response_wrapper(
779
- flashcards.get_types,
780
- )
781
- self.rate = async_to_streamed_response_wrapper(
782
- flashcards.rate,
783
- )