studyfetch-sdk 0.1.0a15__py3-none-any.whl → 0.1.0a17__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.
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "studyfetch_sdk"
4
- __version__ = "0.1.0-alpha.15" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.17" # x-release-please-version
@@ -6,7 +6,7 @@ from typing import Mapping, cast
6
6
 
7
7
  import httpx
8
8
 
9
- from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes
9
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
10
10
  from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
11
11
  from ...._compat import cached_property
12
12
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -23,6 +23,8 @@ from ....types.v1.upload import (
23
23
  component_complete_upload_params,
24
24
  component_get_presigned_url_params,
25
25
  )
26
+ from ....types.v1.upload.file_upload_response import FileUploadResponse
27
+ from ....types.v1.upload.component_complete_upload_response import ComponentCompleteUploadResponse
26
28
  from ....types.v1.upload.component_get_presigned_url_response import ComponentGetPresignedURLResponse
27
29
 
28
30
  __all__ = ["ComponentResource", "AsyncComponentResource"]
@@ -61,7 +63,7 @@ class ComponentResource(SyncAPIResource):
61
63
  extra_query: Query | None = None,
62
64
  extra_body: Body | None = None,
63
65
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64
- ) -> None:
66
+ ) -> ComponentCompleteUploadResponse:
65
67
  """
66
68
  Complete a file upload after using presigned URL
67
69
 
@@ -82,7 +84,6 @@ class ComponentResource(SyncAPIResource):
82
84
  """
83
85
  if not component_id:
84
86
  raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
85
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
86
87
  return self._post(
87
88
  f"/api/v1/upload/component/{component_id}/complete",
88
89
  body=maybe_transform(
@@ -96,7 +97,7 @@ class ComponentResource(SyncAPIResource):
96
97
  options=make_request_options(
97
98
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
98
99
  ),
99
- cast_to=NoneType,
100
+ cast_to=ComponentCompleteUploadResponse,
100
101
  )
101
102
 
102
103
  def get_presigned_url(
@@ -166,7 +167,7 @@ class ComponentResource(SyncAPIResource):
166
167
  extra_query: Query | None = None,
167
168
  extra_body: Body | None = None,
168
169
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
169
- ) -> None:
170
+ ) -> FileUploadResponse:
170
171
  """
171
172
  Upload a file to a component
172
173
 
@@ -187,7 +188,6 @@ class ComponentResource(SyncAPIResource):
187
188
  """
188
189
  if not component_id:
189
190
  raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
190
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
191
191
  body = deepcopy_minimal(
192
192
  {
193
193
  "file": file,
@@ -199,7 +199,7 @@ class ComponentResource(SyncAPIResource):
199
199
  # It should be noted that the actual Content-Type header that will be
200
200
  # sent to the server will contain a `boundary` parameter, e.g.
201
201
  # multipart/form-data; boundary=---abc--
202
- extra_headers["Content-Type"] = "multipart/form-data"
202
+ extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
203
203
  return self._post(
204
204
  f"/api/v1/upload/component/{component_id}/file",
205
205
  body=maybe_transform(body, component_upload_file_params.ComponentUploadFileParams),
@@ -207,7 +207,7 @@ class ComponentResource(SyncAPIResource):
207
207
  options=make_request_options(
208
208
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
209
209
  ),
210
- cast_to=NoneType,
210
+ cast_to=FileUploadResponse,
211
211
  )
212
212
 
213
213
  def upload_url(
@@ -224,7 +224,7 @@ class ComponentResource(SyncAPIResource):
224
224
  extra_query: Query | None = None,
225
225
  extra_body: Body | None = None,
226
226
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
227
- ) -> None:
227
+ ) -> FileUploadResponse:
228
228
  """
229
229
  Upload a file from URL to a component
230
230
 
@@ -247,7 +247,6 @@ class ComponentResource(SyncAPIResource):
247
247
  """
248
248
  if not component_id:
249
249
  raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
250
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
251
250
  return self._post(
252
251
  f"/api/v1/upload/component/{component_id}/url",
253
252
  body=maybe_transform(
@@ -262,7 +261,7 @@ class ComponentResource(SyncAPIResource):
262
261
  options=make_request_options(
263
262
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
264
263
  ),
265
- cast_to=NoneType,
264
+ cast_to=FileUploadResponse,
266
265
  )
267
266
 
268
267
 
@@ -299,7 +298,7 @@ class AsyncComponentResource(AsyncAPIResource):
299
298
  extra_query: Query | None = None,
300
299
  extra_body: Body | None = None,
301
300
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
302
- ) -> None:
301
+ ) -> ComponentCompleteUploadResponse:
303
302
  """
304
303
  Complete a file upload after using presigned URL
305
304
 
@@ -320,7 +319,6 @@ class AsyncComponentResource(AsyncAPIResource):
320
319
  """
321
320
  if not component_id:
322
321
  raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
323
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
324
322
  return await self._post(
325
323
  f"/api/v1/upload/component/{component_id}/complete",
326
324
  body=await async_maybe_transform(
@@ -334,7 +332,7 @@ class AsyncComponentResource(AsyncAPIResource):
334
332
  options=make_request_options(
335
333
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
336
334
  ),
337
- cast_to=NoneType,
335
+ cast_to=ComponentCompleteUploadResponse,
338
336
  )
339
337
 
340
338
  async def get_presigned_url(
@@ -404,7 +402,7 @@ class AsyncComponentResource(AsyncAPIResource):
404
402
  extra_query: Query | None = None,
405
403
  extra_body: Body | None = None,
406
404
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
407
- ) -> None:
405
+ ) -> FileUploadResponse:
408
406
  """
409
407
  Upload a file to a component
410
408
 
@@ -425,7 +423,6 @@ class AsyncComponentResource(AsyncAPIResource):
425
423
  """
426
424
  if not component_id:
427
425
  raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
428
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
429
426
  body = deepcopy_minimal(
430
427
  {
431
428
  "file": file,
@@ -437,7 +434,7 @@ class AsyncComponentResource(AsyncAPIResource):
437
434
  # It should be noted that the actual Content-Type header that will be
438
435
  # sent to the server will contain a `boundary` parameter, e.g.
439
436
  # multipart/form-data; boundary=---abc--
440
- extra_headers["Content-Type"] = "multipart/form-data"
437
+ extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
441
438
  return await self._post(
442
439
  f"/api/v1/upload/component/{component_id}/file",
443
440
  body=await async_maybe_transform(body, component_upload_file_params.ComponentUploadFileParams),
@@ -445,7 +442,7 @@ class AsyncComponentResource(AsyncAPIResource):
445
442
  options=make_request_options(
446
443
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
447
444
  ),
448
- cast_to=NoneType,
445
+ cast_to=FileUploadResponse,
449
446
  )
450
447
 
451
448
  async def upload_url(
@@ -462,7 +459,7 @@ class AsyncComponentResource(AsyncAPIResource):
462
459
  extra_query: Query | None = None,
463
460
  extra_body: Body | None = None,
464
461
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
465
- ) -> None:
462
+ ) -> FileUploadResponse:
466
463
  """
467
464
  Upload a file from URL to a component
468
465
 
@@ -485,7 +482,6 @@ class AsyncComponentResource(AsyncAPIResource):
485
482
  """
486
483
  if not component_id:
487
484
  raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
488
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
489
485
  return await self._post(
490
486
  f"/api/v1/upload/component/{component_id}/url",
491
487
  body=await async_maybe_transform(
@@ -500,7 +496,7 @@ class AsyncComponentResource(AsyncAPIResource):
500
496
  options=make_request_options(
501
497
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
502
498
  ),
503
- cast_to=NoneType,
499
+ cast_to=FileUploadResponse,
504
500
  )
505
501
 
506
502
 
@@ -91,9 +91,6 @@ class ConfigFlashcardsConfigDto(TypedDict, total=False):
91
91
  difficulty: Literal["easy", "medium", "hard", "mixed"]
92
92
  """Difficulty level"""
93
93
 
94
- enable_spaced_repetition: Annotated[bool, PropertyInfo(alias="enableSpacedRepetition")]
95
- """Enable spaced repetition"""
96
-
97
94
  folders: List[str]
98
95
  """Folder IDs"""
99
96
 
@@ -2,8 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from .file_upload_response import FileUploadResponse as FileUploadResponse
5
6
  from .component_upload_url_params import ComponentUploadURLParams as ComponentUploadURLParams
6
7
  from .component_upload_file_params import ComponentUploadFileParams as ComponentUploadFileParams
7
8
  from .component_complete_upload_params import ComponentCompleteUploadParams as ComponentCompleteUploadParams
9
+ from .component_complete_upload_response import ComponentCompleteUploadResponse as ComponentCompleteUploadResponse
8
10
  from .component_get_presigned_url_params import ComponentGetPresignedURLParams as ComponentGetPresignedURLParams
9
11
  from .component_get_presigned_url_response import ComponentGetPresignedURLResponse as ComponentGetPresignedURLResponse
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ...._models import BaseModel
4
+
5
+ __all__ = ["ComponentCompleteUploadResponse"]
6
+
7
+
8
+ class ComponentCompleteUploadResponse(BaseModel):
9
+ id: str
10
+ """The ID of the uploaded material"""
11
+
12
+ name: str
13
+ """The name of the material"""
14
+
15
+ status: str
16
+ """The status of the material"""
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from pydantic import Field as FieldInfo
4
+
5
+ from ...._models import BaseModel
6
+
7
+ __all__ = ["FileUploadResponse"]
8
+
9
+
10
+ class FileUploadResponse(BaseModel):
11
+ id: str
12
+ """The ID of the uploaded material"""
13
+
14
+ content_type: str = FieldInfo(alias="contentType")
15
+ """The content type of the material"""
16
+
17
+ name: str
18
+ """The name of the material"""
19
+
20
+ s3_key: str = FieldInfo(alias="s3Key")
21
+ """The S3 key of the uploaded file"""
22
+
23
+ status: str
24
+ """The status of the material"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: studyfetch_sdk
3
- Version: 0.1.0a15
3
+ Version: 0.1.0a17
4
4
  Summary: The official Python library for the studyfetch-sdk API
5
5
  Project-URL: Homepage, https://github.com/GoStudyFetchGo/studyfetch-sdk-python
6
6
  Project-URL: Repository, https://github.com/GoStudyFetchGo/studyfetch-sdk-python
@@ -11,7 +11,7 @@ studyfetch_sdk/_resource.py,sha256=y0aoAqMIYwTAwStuxbpO8XpTPnrSNQQ_ZcgiH5xcntg,1
11
11
  studyfetch_sdk/_response.py,sha256=6ph8tSkqF5pNbTo_2Zhizhq2O-Eb67TcksHwyg3aXdc,28864
12
12
  studyfetch_sdk/_streaming.py,sha256=HZoENuPVzWhBn24eH3lnMCvRbWN0EPwvhWYfdlJfw0A,10128
13
13
  studyfetch_sdk/_types.py,sha256=6nvqHGarRGuhs_FL8tJ8sGXXD8XWajNynT2K78GxRUI,6205
14
- studyfetch_sdk/_version.py,sha256=MGAn60ax2_6gf7WaYfAYE4foJ6HZVOtybHOQr9mRxvQ,175
14
+ studyfetch_sdk/_version.py,sha256=aF-udkHOz21mpAQ_3ettDZ19LQb6jCshuNW3yCFLHM4,175
15
15
  studyfetch_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  studyfetch_sdk/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  studyfetch_sdk/_utils/_logs.py,sha256=EoZgOiIkpf2WB_0Ts0Ti7G3o_25v7IsPf_q-yEU6sbY,798
@@ -58,7 +58,7 @@ studyfetch_sdk/resources/v1/tests/__init__.py,sha256=7-K6i3WJPRCoMSOatJEqUhlz74S
58
58
  studyfetch_sdk/resources/v1/tests/component.py,sha256=MJZIo4-ES4tkY9P1FJl8phjkQxGG8FBCe99ar0I_un4,6013
59
59
  studyfetch_sdk/resources/v1/tests/tests.py,sha256=BGwXClZ8YkzegN80R0WDIrvK3WN1-ujtYkfR33ARhVU,24870
60
60
  studyfetch_sdk/resources/v1/upload/__init__.py,sha256=N5r6jpSMe43dezq-6RBAWLVlL3-Z76lU7DG53phDGr8,1041
61
- studyfetch_sdk/resources/v1/upload/component.py,sha256=I7RZ9K1_Meg__pbeBGGvTSg_ugzxcdFiCzibSQNyg78,21794
61
+ studyfetch_sdk/resources/v1/upload/component.py,sha256=Q-8VO-XiWYDFpzdap-NcP62V77dvMXfeJouFv8ELXkM,21803
62
62
  studyfetch_sdk/resources/v1/upload/upload.py,sha256=RBkrsVi5_8qIqdYKypnSqj44ONvwW7u2XXIlpuJsKSg,3736
63
63
  studyfetch_sdk/resources/v1/usage/__init__.py,sha256=zUBe7msw9tyZplhmwNkhbCfRigNQQVj4IFpod4uGWZY,1002
64
64
  studyfetch_sdk/resources/v1/usage/analyst.py,sha256=BZC5QVnm6UWacrqodYFGXUodBM_b37I9jClbiXTakJo,13206
@@ -72,7 +72,7 @@ studyfetch_sdk/types/v1/chat_get_session_params.py,sha256=Iv3O6eF4DvTYTBVQVyVR4t
72
72
  studyfetch_sdk/types/v1/chat_send_message_params.py,sha256=BRxjNsVXsqcBbdrp4J5TQGjjNPJ_bz7uXw3pnc-x0oU,1454
73
73
  studyfetch_sdk/types/v1/chat_stream_params.py,sha256=Aqp2Vdsa35PAH-75kaO_ZYlkqGrCgDZ5EyYTTLRAJoE,695
74
74
  studyfetch_sdk/types/v1/component.py,sha256=ye8BDfb0taD0WwEWJDpi4cXH0iwKqzom0SQQA1nbO4c,1166
75
- studyfetch_sdk/types/v1/component_create_params.py,sha256=i8kgVzsTGGYsYkd-sm9Aw7-kO_aQ64QCzmbnssGD5YQ,10382
75
+ studyfetch_sdk/types/v1/component_create_params.py,sha256=wtPCBVQScdZZuREIzmRIoMCCXoK9cVeR-NUA0qFatxo,10254
76
76
  studyfetch_sdk/types/v1/component_generate_embed_params.py,sha256=keiOzDzPCvacAWHQj_OtF2pGjEAqxwjNriBGxRaRQNk,3068
77
77
  studyfetch_sdk/types/v1/component_generate_embed_response.py,sha256=xhbqEpAt_Q7yzD4xjWITs_jXYUD6ElrH4aQfNEunI3Y,922
78
78
  studyfetch_sdk/types/v1/component_list_params.py,sha256=R8NMK7r37CpqmbAWdbs6rEF1LigoYrE3BXksJCCdKEQ,431
@@ -122,15 +122,17 @@ studyfetch_sdk/types/v1/scenarios/__init__.py,sha256=2DyrawNlb-TstNKw0gUMlQaNSq-
122
122
  studyfetch_sdk/types/v1/scenarios/component_update_params.py,sha256=0wsa-_gN17TKmvhQBbCIQmN2gSEuCq2HBWjQaTqhFdk,1171
123
123
  studyfetch_sdk/types/v1/scenarios/submissions/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
124
124
  studyfetch_sdk/types/v1/tests/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
125
- studyfetch_sdk/types/v1/upload/__init__.py,sha256=CcAj2VNEnMv61GoKuDm7dAeLRwRbjez5QfjpxD8D5o4,655
125
+ studyfetch_sdk/types/v1/upload/__init__.py,sha256=oVLQUp-Sxua2NMNauXzopFmF34HjL_KZMjxlqMu7zW8,845
126
126
  studyfetch_sdk/types/v1/upload/component_complete_upload_params.py,sha256=B3-7nCdLI4S_q0qa8NBS7gNwL0F8ljYVvEbo9fwCkXQ,687
127
+ studyfetch_sdk/types/v1/upload/component_complete_upload_response.py,sha256=fOWcCnkzzLlYtwKjmdh4X4hlGVOKUNDA1DmnM5jb1ao,378
127
128
  studyfetch_sdk/types/v1/upload/component_get_presigned_url_params.py,sha256=dTGFn9zyOY9z3NNdPw732L3Ln7D1GKA3S8xB3FBPb7c,754
128
129
  studyfetch_sdk/types/v1/upload/component_get_presigned_url_response.py,sha256=RDHDy3IO_qjtnfLHJQ2CX2_uG6_BJI-vwgQk2UJ-aE8,404
129
130
  studyfetch_sdk/types/v1/upload/component_upload_file_params.py,sha256=UTv4EMrj7_hXa-PU68PMEyXn-bnhxcC0V0qO0JN5W-I,652
130
131
  studyfetch_sdk/types/v1/upload/component_upload_url_params.py,sha256=3wXvto5WWzLYCu0EfQAWQgM73OmbRGhTwe6UnkMW0gM,687
132
+ studyfetch_sdk/types/v1/upload/file_upload_response.py,sha256=z7LcH_BVu1meWzl9J3BeLOkcZr4NQmdtJV39SobbI1k,578
131
133
  studyfetch_sdk/types/v1/usage/__init__.py,sha256=W93APDYogn9YlFksS696VpAlz_P7W8mt5wfduXWtoVY,214
132
134
  studyfetch_sdk/types/v1/usage/analyst_list_events_params.py,sha256=5ylEgFOsxQ0HNLfyTktNvZx-VuWJHV06HMIfiNnVNHo,1562
133
- studyfetch_sdk-0.1.0a15.dist-info/METADATA,sha256=0iLN0P6fg7BDv52o4q36_foH2HooOyvIBPeIAGyzlo0,15518
134
- studyfetch_sdk-0.1.0a15.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
135
- studyfetch_sdk-0.1.0a15.dist-info/licenses/LICENSE,sha256=CsdbJMegH_AAWljUmVcwW0Cj_GyIm1hjw6qPqPnmdn4,11344
136
- studyfetch_sdk-0.1.0a15.dist-info/RECORD,,
135
+ studyfetch_sdk-0.1.0a17.dist-info/METADATA,sha256=wzCQ49CChL5nfB4WXvBXKGOkxHR9_b1IPcRrRp-eo_U,15518
136
+ studyfetch_sdk-0.1.0a17.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
137
+ studyfetch_sdk-0.1.0a17.dist-info/licenses/LICENSE,sha256=CsdbJMegH_AAWljUmVcwW0Cj_GyIm1hjw6qPqPnmdn4,11344
138
+ studyfetch_sdk-0.1.0a17.dist-info/RECORD,,