studyfetch-sdk 0.1.0a17__py3-none-any.whl → 0.1.0a18__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.
- studyfetch_sdk/_version.py +1 -1
- studyfetch_sdk/resources/v1/materials/bulk.py +60 -7
- studyfetch_sdk/resources/v1/materials/materials.py +120 -55
- studyfetch_sdk/resources/v1/materials/test.py +29 -25
- studyfetch_sdk/resources/v1/materials/upload.py +140 -14
- studyfetch_sdk/types/v1/__init__.py +7 -0
- studyfetch_sdk/types/v1/material_batch_create_params.py +29 -0
- studyfetch_sdk/types/v1/material_batch_create_response.py +27 -0
- studyfetch_sdk/types/v1/material_debug_response.py +47 -0
- studyfetch_sdk/types/v1/material_get_download_url_params.py +3 -2
- studyfetch_sdk/types/v1/material_get_download_url_response.py +12 -0
- studyfetch_sdk/types/v1/material_move_params.py +15 -0
- studyfetch_sdk/types/v1/material_rename_params.py +12 -0
- studyfetch_sdk/types/v1/material_search_params.py +3 -6
- studyfetch_sdk/types/v1/material_search_response.py +54 -0
- studyfetch_sdk/types/v1/materials/__init__.py +9 -0
- studyfetch_sdk/types/v1/materials/bulk_move_params.py +18 -0
- studyfetch_sdk/types/v1/materials/bulk_move_response.py +15 -0
- studyfetch_sdk/types/v1/materials/test_perform_ocr_response.py +19 -0
- studyfetch_sdk/types/v1/materials/test_process_epub_response.py +30 -0
- studyfetch_sdk/types/v1/materials/test_process_image_response.py +30 -0
- studyfetch_sdk/types/v1/materials/test_process_video_response.py +25 -0
- studyfetch_sdk/types/v1/materials/upload_complete_upload_params.py +20 -0
- studyfetch_sdk/types/v1/materials/upload_create_presigned_url_params.py +23 -0
- studyfetch_sdk/types/v1/materials/upload_create_presigned_url_response.py +18 -0
- {studyfetch_sdk-0.1.0a17.dist-info → studyfetch_sdk-0.1.0a18.dist-info}/METADATA +1 -1
- {studyfetch_sdk-0.1.0a17.dist-info → studyfetch_sdk-0.1.0a18.dist-info}/RECORD +29 -13
- {studyfetch_sdk-0.1.0a17.dist-info → studyfetch_sdk-0.1.0a18.dist-info}/WHEEL +0 -0
- {studyfetch_sdk-0.1.0a17.dist-info → studyfetch_sdk-0.1.0a18.dist-info}/licenses/LICENSE +0 -0
studyfetch_sdk/_version.py
CHANGED
@@ -2,9 +2,12 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
+
from typing import List, Optional
|
6
|
+
|
5
7
|
import httpx
|
6
8
|
|
7
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers,
|
9
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
10
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
8
11
|
from ...._compat import cached_property
|
9
12
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
10
13
|
from ...._response import (
|
@@ -14,6 +17,8 @@ from ...._response import (
|
|
14
17
|
async_to_streamed_response_wrapper,
|
15
18
|
)
|
16
19
|
from ...._base_client import make_request_options
|
20
|
+
from ....types.v1.materials import bulk_move_params
|
21
|
+
from ....types.v1.materials.bulk_move_response import BulkMoveResponse
|
17
22
|
|
18
23
|
__all__ = ["BulkResource", "AsyncBulkResource"]
|
19
24
|
|
@@ -41,20 +46,44 @@ class BulkResource(SyncAPIResource):
|
|
41
46
|
def move(
|
42
47
|
self,
|
43
48
|
*,
|
49
|
+
folder_id: Optional[str],
|
50
|
+
material_ids: List[str],
|
44
51
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
45
52
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
46
53
|
extra_headers: Headers | None = None,
|
47
54
|
extra_query: Query | None = None,
|
48
55
|
extra_body: Body | None = None,
|
49
56
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
50
|
-
) ->
|
51
|
-
|
57
|
+
) -> BulkMoveResponse:
|
58
|
+
"""
|
59
|
+
Bulk move materials to a different folder
|
60
|
+
|
61
|
+
Args:
|
62
|
+
folder_id: Target folder ID (null for root)
|
63
|
+
|
64
|
+
material_ids: Array of material IDs to move
|
65
|
+
|
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
|
+
"""
|
52
74
|
return self._post(
|
53
75
|
"/api/v1/materials/bulk/move",
|
76
|
+
body=maybe_transform(
|
77
|
+
{
|
78
|
+
"folder_id": folder_id,
|
79
|
+
"material_ids": material_ids,
|
80
|
+
},
|
81
|
+
bulk_move_params.BulkMoveParams,
|
82
|
+
),
|
54
83
|
options=make_request_options(
|
55
84
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
56
85
|
),
|
57
|
-
cast_to=
|
86
|
+
cast_to=BulkMoveResponse,
|
58
87
|
)
|
59
88
|
|
60
89
|
|
@@ -81,20 +110,44 @@ class AsyncBulkResource(AsyncAPIResource):
|
|
81
110
|
async def move(
|
82
111
|
self,
|
83
112
|
*,
|
113
|
+
folder_id: Optional[str],
|
114
|
+
material_ids: List[str],
|
84
115
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
85
116
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
86
117
|
extra_headers: Headers | None = None,
|
87
118
|
extra_query: Query | None = None,
|
88
119
|
extra_body: Body | None = None,
|
89
120
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
90
|
-
) ->
|
91
|
-
|
121
|
+
) -> BulkMoveResponse:
|
122
|
+
"""
|
123
|
+
Bulk move materials to a different folder
|
124
|
+
|
125
|
+
Args:
|
126
|
+
folder_id: Target folder ID (null for root)
|
127
|
+
|
128
|
+
material_ids: Array of material IDs to move
|
129
|
+
|
130
|
+
extra_headers: Send extra headers
|
131
|
+
|
132
|
+
extra_query: Add additional query parameters to the request
|
133
|
+
|
134
|
+
extra_body: Add additional JSON properties to the request
|
135
|
+
|
136
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
137
|
+
"""
|
92
138
|
return await self._post(
|
93
139
|
"/api/v1/materials/bulk/move",
|
140
|
+
body=await async_maybe_transform(
|
141
|
+
{
|
142
|
+
"folder_id": folder_id,
|
143
|
+
"material_ids": material_ids,
|
144
|
+
},
|
145
|
+
bulk_move_params.BulkMoveParams,
|
146
|
+
),
|
94
147
|
options=make_request_options(
|
95
148
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
96
149
|
),
|
97
|
-
cast_to=
|
150
|
+
cast_to=BulkMoveResponse,
|
98
151
|
)
|
99
152
|
|
100
153
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from typing import List
|
5
|
+
from typing import List, Iterable, Optional
|
6
6
|
|
7
7
|
import httpx
|
8
8
|
|
@@ -35,8 +35,11 @@ from ...._utils import maybe_transform, async_maybe_transform
|
|
35
35
|
from ...._compat import cached_property
|
36
36
|
from ....types.v1 import (
|
37
37
|
material_list_params,
|
38
|
+
material_move_params,
|
38
39
|
material_create_params,
|
40
|
+
material_rename_params,
|
39
41
|
material_search_params,
|
42
|
+
material_batch_create_params,
|
40
43
|
material_get_download_url_params,
|
41
44
|
)
|
42
45
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
@@ -49,6 +52,10 @@ from ...._response import (
|
|
49
52
|
from ...._base_client import make_request_options
|
50
53
|
from ....types.v1.material import Material
|
51
54
|
from ....types.v1.material_list_response import MaterialListResponse
|
55
|
+
from ....types.v1.material_debug_response import MaterialDebugResponse
|
56
|
+
from ....types.v1.material_search_response import MaterialSearchResponse
|
57
|
+
from ....types.v1.material_batch_create_response import MaterialBatchCreateResponse
|
58
|
+
from ....types.v1.material_get_download_url_response import MaterialGetDownloadURLResponse
|
52
59
|
|
53
60
|
__all__ = ["MaterialsResource", "AsyncMaterialsResource"]
|
54
61
|
|
@@ -239,20 +246,35 @@ class MaterialsResource(SyncAPIResource):
|
|
239
246
|
def batch_create(
|
240
247
|
self,
|
241
248
|
*,
|
249
|
+
materials: Iterable[material_batch_create_params.Material],
|
242
250
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
243
251
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
244
252
|
extra_headers: Headers | None = None,
|
245
253
|
extra_query: Query | None = None,
|
246
254
|
extra_body: Body | None = None,
|
247
255
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
248
|
-
) ->
|
249
|
-
|
256
|
+
) -> MaterialBatchCreateResponse:
|
257
|
+
"""
|
258
|
+
Create batch upload URLs for multiple materials
|
259
|
+
|
260
|
+
Args:
|
261
|
+
materials: Array of materials to create
|
262
|
+
|
263
|
+
extra_headers: Send extra headers
|
264
|
+
|
265
|
+
extra_query: Add additional query parameters to the request
|
266
|
+
|
267
|
+
extra_body: Add additional JSON properties to the request
|
268
|
+
|
269
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
270
|
+
"""
|
250
271
|
return self._post(
|
251
272
|
"/api/v1/materials/batch",
|
273
|
+
body=maybe_transform({"materials": materials}, material_batch_create_params.MaterialBatchCreateParams),
|
252
274
|
options=make_request_options(
|
253
275
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
254
276
|
),
|
255
|
-
cast_to=
|
277
|
+
cast_to=MaterialBatchCreateResponse,
|
256
278
|
)
|
257
279
|
|
258
280
|
def debug(
|
@@ -265,8 +287,10 @@ class MaterialsResource(SyncAPIResource):
|
|
265
287
|
extra_query: Query | None = None,
|
266
288
|
extra_body: Body | None = None,
|
267
289
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
268
|
-
) ->
|
290
|
+
) -> MaterialDebugResponse:
|
269
291
|
"""
|
292
|
+
Get debug information for a material including extracted content
|
293
|
+
|
270
294
|
Args:
|
271
295
|
extra_headers: Send extra headers
|
272
296
|
|
@@ -278,29 +302,32 @@ class MaterialsResource(SyncAPIResource):
|
|
278
302
|
"""
|
279
303
|
if not id:
|
280
304
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
281
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
282
305
|
return self._get(
|
283
306
|
f"/api/v1/materials/{id}/debug",
|
284
307
|
options=make_request_options(
|
285
308
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
286
309
|
),
|
287
|
-
cast_to=
|
310
|
+
cast_to=MaterialDebugResponse,
|
288
311
|
)
|
289
312
|
|
290
313
|
def get_download_url(
|
291
314
|
self,
|
292
315
|
id: str,
|
293
316
|
*,
|
294
|
-
expires_in:
|
317
|
+
expires_in: float | NotGiven = NOT_GIVEN,
|
295
318
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
296
319
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
297
320
|
extra_headers: Headers | None = None,
|
298
321
|
extra_query: Query | None = None,
|
299
322
|
extra_body: Body | None = None,
|
300
323
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
301
|
-
) ->
|
324
|
+
) -> MaterialGetDownloadURLResponse:
|
302
325
|
"""
|
326
|
+
Get temporary download URL for material
|
327
|
+
|
303
328
|
Args:
|
329
|
+
expires_in: URL expiration time in seconds (default: 3600)
|
330
|
+
|
304
331
|
extra_headers: Send extra headers
|
305
332
|
|
306
333
|
extra_query: Add additional query parameters to the request
|
@@ -311,7 +338,6 @@ class MaterialsResource(SyncAPIResource):
|
|
311
338
|
"""
|
312
339
|
if not id:
|
313
340
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
314
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
315
341
|
return self._get(
|
316
342
|
f"/api/v1/materials/{id}/download-url",
|
317
343
|
options=make_request_options(
|
@@ -323,22 +349,27 @@ class MaterialsResource(SyncAPIResource):
|
|
323
349
|
{"expires_in": expires_in}, material_get_download_url_params.MaterialGetDownloadURLParams
|
324
350
|
),
|
325
351
|
),
|
326
|
-
cast_to=
|
352
|
+
cast_to=MaterialGetDownloadURLResponse,
|
327
353
|
)
|
328
354
|
|
329
355
|
def move(
|
330
356
|
self,
|
331
357
|
id: str,
|
332
358
|
*,
|
359
|
+
folder_id: Optional[str],
|
333
360
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
334
361
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
335
362
|
extra_headers: Headers | None = None,
|
336
363
|
extra_query: Query | None = None,
|
337
364
|
extra_body: Body | None = None,
|
338
365
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
339
|
-
) ->
|
366
|
+
) -> Material:
|
340
367
|
"""
|
368
|
+
Move material to a different folder
|
369
|
+
|
341
370
|
Args:
|
371
|
+
folder_id: Target folder ID (null for root)
|
372
|
+
|
342
373
|
extra_headers: Send extra headers
|
343
374
|
|
344
375
|
extra_query: Add additional query parameters to the request
|
@@ -349,28 +380,33 @@ class MaterialsResource(SyncAPIResource):
|
|
349
380
|
"""
|
350
381
|
if not id:
|
351
382
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
352
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
353
383
|
return self._post(
|
354
384
|
f"/api/v1/materials/{id}/move",
|
385
|
+
body=maybe_transform({"folder_id": folder_id}, material_move_params.MaterialMoveParams),
|
355
386
|
options=make_request_options(
|
356
387
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
357
388
|
),
|
358
|
-
cast_to=
|
389
|
+
cast_to=Material,
|
359
390
|
)
|
360
391
|
|
361
392
|
def rename(
|
362
393
|
self,
|
363
394
|
id: str,
|
364
395
|
*,
|
396
|
+
name: str,
|
365
397
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
366
398
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
367
399
|
extra_headers: Headers | None = None,
|
368
400
|
extra_query: Query | None = None,
|
369
401
|
extra_body: Body | None = None,
|
370
402
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
371
|
-
) ->
|
403
|
+
) -> Material:
|
372
404
|
"""
|
405
|
+
Rename a material
|
406
|
+
|
373
407
|
Args:
|
408
|
+
name: New name for the material
|
409
|
+
|
374
410
|
extra_headers: Send extra headers
|
375
411
|
|
376
412
|
extra_query: Add additional query parameters to the request
|
@@ -381,13 +417,13 @@ class MaterialsResource(SyncAPIResource):
|
|
381
417
|
"""
|
382
418
|
if not id:
|
383
419
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
384
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
385
420
|
return self._post(
|
386
421
|
f"/api/v1/materials/{id}/rename",
|
422
|
+
body=maybe_transform({"name": name}, material_rename_params.MaterialRenameParams),
|
387
423
|
options=make_request_options(
|
388
424
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
389
425
|
),
|
390
|
-
cast_to=
|
426
|
+
cast_to=Material,
|
391
427
|
)
|
392
428
|
|
393
429
|
def reprocess(
|
@@ -400,8 +436,10 @@ class MaterialsResource(SyncAPIResource):
|
|
400
436
|
extra_query: Query | None = None,
|
401
437
|
extra_body: Body | None = None,
|
402
438
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
403
|
-
) ->
|
439
|
+
) -> Material:
|
404
440
|
"""
|
441
|
+
Reprocess material to regenerate embeddings and extract content
|
442
|
+
|
405
443
|
Args:
|
406
444
|
extra_headers: Send extra headers
|
407
445
|
|
@@ -413,13 +451,12 @@ class MaterialsResource(SyncAPIResource):
|
|
413
451
|
"""
|
414
452
|
if not id:
|
415
453
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
416
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
417
454
|
return self._post(
|
418
455
|
f"/api/v1/materials/{id}/reprocess",
|
419
456
|
options=make_request_options(
|
420
457
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
421
458
|
),
|
422
|
-
cast_to=
|
459
|
+
cast_to=Material,
|
423
460
|
)
|
424
461
|
|
425
462
|
def search(
|
@@ -435,19 +472,18 @@ class MaterialsResource(SyncAPIResource):
|
|
435
472
|
extra_query: Query | None = None,
|
436
473
|
extra_body: Body | None = None,
|
437
474
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
438
|
-
) ->
|
475
|
+
) -> MaterialSearchResponse:
|
439
476
|
"""
|
440
|
-
Search materials using RAG
|
477
|
+
Search materials using RAG (Retrieval-Augmented Generation)
|
441
478
|
|
442
479
|
Args:
|
443
480
|
query: Search query
|
444
481
|
|
445
|
-
folder_ids:
|
446
|
-
subfolders)
|
482
|
+
folder_ids: Limit search to materials within specific folders (includes subfolders)
|
447
483
|
|
448
|
-
material_ids:
|
484
|
+
material_ids: Limit search to specific material IDs
|
449
485
|
|
450
|
-
top_k: Number of results to return
|
486
|
+
top_k: Number of results to return
|
451
487
|
|
452
488
|
extra_headers: Send extra headers
|
453
489
|
|
@@ -457,7 +493,6 @@ class MaterialsResource(SyncAPIResource):
|
|
457
493
|
|
458
494
|
timeout: Override the client-level default timeout for this request, in seconds
|
459
495
|
"""
|
460
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
461
496
|
return self._post(
|
462
497
|
"/api/v1/materials/search",
|
463
498
|
body=maybe_transform(
|
@@ -472,7 +507,7 @@ class MaterialsResource(SyncAPIResource):
|
|
472
507
|
options=make_request_options(
|
473
508
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
474
509
|
),
|
475
|
-
cast_to=
|
510
|
+
cast_to=MaterialSearchResponse,
|
476
511
|
)
|
477
512
|
|
478
513
|
|
@@ -662,20 +697,37 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
662
697
|
async def batch_create(
|
663
698
|
self,
|
664
699
|
*,
|
700
|
+
materials: Iterable[material_batch_create_params.Material],
|
665
701
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
666
702
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
667
703
|
extra_headers: Headers | None = None,
|
668
704
|
extra_query: Query | None = None,
|
669
705
|
extra_body: Body | None = None,
|
670
706
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
671
|
-
) ->
|
672
|
-
|
707
|
+
) -> MaterialBatchCreateResponse:
|
708
|
+
"""
|
709
|
+
Create batch upload URLs for multiple materials
|
710
|
+
|
711
|
+
Args:
|
712
|
+
materials: Array of materials to create
|
713
|
+
|
714
|
+
extra_headers: Send extra headers
|
715
|
+
|
716
|
+
extra_query: Add additional query parameters to the request
|
717
|
+
|
718
|
+
extra_body: Add additional JSON properties to the request
|
719
|
+
|
720
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
721
|
+
"""
|
673
722
|
return await self._post(
|
674
723
|
"/api/v1/materials/batch",
|
724
|
+
body=await async_maybe_transform(
|
725
|
+
{"materials": materials}, material_batch_create_params.MaterialBatchCreateParams
|
726
|
+
),
|
675
727
|
options=make_request_options(
|
676
728
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
677
729
|
),
|
678
|
-
cast_to=
|
730
|
+
cast_to=MaterialBatchCreateResponse,
|
679
731
|
)
|
680
732
|
|
681
733
|
async def debug(
|
@@ -688,8 +740,10 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
688
740
|
extra_query: Query | None = None,
|
689
741
|
extra_body: Body | None = None,
|
690
742
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
691
|
-
) ->
|
743
|
+
) -> MaterialDebugResponse:
|
692
744
|
"""
|
745
|
+
Get debug information for a material including extracted content
|
746
|
+
|
693
747
|
Args:
|
694
748
|
extra_headers: Send extra headers
|
695
749
|
|
@@ -701,29 +755,32 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
701
755
|
"""
|
702
756
|
if not id:
|
703
757
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
704
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
705
758
|
return await self._get(
|
706
759
|
f"/api/v1/materials/{id}/debug",
|
707
760
|
options=make_request_options(
|
708
761
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
709
762
|
),
|
710
|
-
cast_to=
|
763
|
+
cast_to=MaterialDebugResponse,
|
711
764
|
)
|
712
765
|
|
713
766
|
async def get_download_url(
|
714
767
|
self,
|
715
768
|
id: str,
|
716
769
|
*,
|
717
|
-
expires_in:
|
770
|
+
expires_in: float | NotGiven = NOT_GIVEN,
|
718
771
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
719
772
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
720
773
|
extra_headers: Headers | None = None,
|
721
774
|
extra_query: Query | None = None,
|
722
775
|
extra_body: Body | None = None,
|
723
776
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
724
|
-
) ->
|
777
|
+
) -> MaterialGetDownloadURLResponse:
|
725
778
|
"""
|
779
|
+
Get temporary download URL for material
|
780
|
+
|
726
781
|
Args:
|
782
|
+
expires_in: URL expiration time in seconds (default: 3600)
|
783
|
+
|
727
784
|
extra_headers: Send extra headers
|
728
785
|
|
729
786
|
extra_query: Add additional query parameters to the request
|
@@ -734,7 +791,6 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
734
791
|
"""
|
735
792
|
if not id:
|
736
793
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
737
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
738
794
|
return await self._get(
|
739
795
|
f"/api/v1/materials/{id}/download-url",
|
740
796
|
options=make_request_options(
|
@@ -746,22 +802,27 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
746
802
|
{"expires_in": expires_in}, material_get_download_url_params.MaterialGetDownloadURLParams
|
747
803
|
),
|
748
804
|
),
|
749
|
-
cast_to=
|
805
|
+
cast_to=MaterialGetDownloadURLResponse,
|
750
806
|
)
|
751
807
|
|
752
808
|
async def move(
|
753
809
|
self,
|
754
810
|
id: str,
|
755
811
|
*,
|
812
|
+
folder_id: Optional[str],
|
756
813
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
757
814
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
758
815
|
extra_headers: Headers | None = None,
|
759
816
|
extra_query: Query | None = None,
|
760
817
|
extra_body: Body | None = None,
|
761
818
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
762
|
-
) ->
|
819
|
+
) -> Material:
|
763
820
|
"""
|
821
|
+
Move material to a different folder
|
822
|
+
|
764
823
|
Args:
|
824
|
+
folder_id: Target folder ID (null for root)
|
825
|
+
|
765
826
|
extra_headers: Send extra headers
|
766
827
|
|
767
828
|
extra_query: Add additional query parameters to the request
|
@@ -772,28 +833,33 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
772
833
|
"""
|
773
834
|
if not id:
|
774
835
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
775
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
776
836
|
return await self._post(
|
777
837
|
f"/api/v1/materials/{id}/move",
|
838
|
+
body=await async_maybe_transform({"folder_id": folder_id}, material_move_params.MaterialMoveParams),
|
778
839
|
options=make_request_options(
|
779
840
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
780
841
|
),
|
781
|
-
cast_to=
|
842
|
+
cast_to=Material,
|
782
843
|
)
|
783
844
|
|
784
845
|
async def rename(
|
785
846
|
self,
|
786
847
|
id: str,
|
787
848
|
*,
|
849
|
+
name: str,
|
788
850
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
789
851
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
790
852
|
extra_headers: Headers | None = None,
|
791
853
|
extra_query: Query | None = None,
|
792
854
|
extra_body: Body | None = None,
|
793
855
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
794
|
-
) ->
|
856
|
+
) -> Material:
|
795
857
|
"""
|
858
|
+
Rename a material
|
859
|
+
|
796
860
|
Args:
|
861
|
+
name: New name for the material
|
862
|
+
|
797
863
|
extra_headers: Send extra headers
|
798
864
|
|
799
865
|
extra_query: Add additional query parameters to the request
|
@@ -804,13 +870,13 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
804
870
|
"""
|
805
871
|
if not id:
|
806
872
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
807
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
808
873
|
return await self._post(
|
809
874
|
f"/api/v1/materials/{id}/rename",
|
875
|
+
body=await async_maybe_transform({"name": name}, material_rename_params.MaterialRenameParams),
|
810
876
|
options=make_request_options(
|
811
877
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
812
878
|
),
|
813
|
-
cast_to=
|
879
|
+
cast_to=Material,
|
814
880
|
)
|
815
881
|
|
816
882
|
async def reprocess(
|
@@ -823,8 +889,10 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
823
889
|
extra_query: Query | None = None,
|
824
890
|
extra_body: Body | None = None,
|
825
891
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
826
|
-
) ->
|
892
|
+
) -> Material:
|
827
893
|
"""
|
894
|
+
Reprocess material to regenerate embeddings and extract content
|
895
|
+
|
828
896
|
Args:
|
829
897
|
extra_headers: Send extra headers
|
830
898
|
|
@@ -836,13 +904,12 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
836
904
|
"""
|
837
905
|
if not id:
|
838
906
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
839
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
840
907
|
return await self._post(
|
841
908
|
f"/api/v1/materials/{id}/reprocess",
|
842
909
|
options=make_request_options(
|
843
910
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
844
911
|
),
|
845
|
-
cast_to=
|
912
|
+
cast_to=Material,
|
846
913
|
)
|
847
914
|
|
848
915
|
async def search(
|
@@ -858,19 +925,18 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
858
925
|
extra_query: Query | None = None,
|
859
926
|
extra_body: Body | None = None,
|
860
927
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
861
|
-
) ->
|
928
|
+
) -> MaterialSearchResponse:
|
862
929
|
"""
|
863
|
-
Search materials using RAG
|
930
|
+
Search materials using RAG (Retrieval-Augmented Generation)
|
864
931
|
|
865
932
|
Args:
|
866
933
|
query: Search query
|
867
934
|
|
868
|
-
folder_ids:
|
869
|
-
subfolders)
|
935
|
+
folder_ids: Limit search to materials within specific folders (includes subfolders)
|
870
936
|
|
871
|
-
material_ids:
|
937
|
+
material_ids: Limit search to specific material IDs
|
872
938
|
|
873
|
-
top_k: Number of results to return
|
939
|
+
top_k: Number of results to return
|
874
940
|
|
875
941
|
extra_headers: Send extra headers
|
876
942
|
|
@@ -880,7 +946,6 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
880
946
|
|
881
947
|
timeout: Override the client-level default timeout for this request, in seconds
|
882
948
|
"""
|
883
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
884
949
|
return await self._post(
|
885
950
|
"/api/v1/materials/search",
|
886
951
|
body=await async_maybe_transform(
|
@@ -895,7 +960,7 @@ class AsyncMaterialsResource(AsyncAPIResource):
|
|
895
960
|
options=make_request_options(
|
896
961
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
897
962
|
),
|
898
|
-
cast_to=
|
963
|
+
cast_to=MaterialSearchResponse,
|
899
964
|
)
|
900
965
|
|
901
966
|
|