Skip to content

Commit a3d7c23

Browse files
feat(api): api update
1 parent a1ada95 commit a3d7c23

5 files changed

Lines changed: 18 additions & 60 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 9
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nanonets%2Fdocstrange-1f31f87d4c6e168ffcccab94b8967a095195cac1ea2518bbddbeaf4611e02f05.yml
3-
openapi_spec_hash: 18bec87d90926b0bc0cd98ce1d066d1f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nanonets%2Fdocstrange-7f3f662020a40e0dbf7b19b724cf5c3e69f82246659477c1d71521c0c3cf62a0.yml
3+
openapi_spec_hash: 53a8f7e0325845d16306ff7cb4272510
44
config_hash: c02183ee58f815311de9278705163d1a

src/docstrange/resources/extract/extract.py

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ def async_(
7575
output_format: str,
7676
csv_options: str | Omit = omit,
7777
custom_instructions: str | Omit = omit,
78-
file_base64: str | Omit = omit,
79-
file_url: str | Omit = omit,
8078
include_metadata: str | Omit = omit,
8179
json_options: str | Omit = omit,
8280
prompt_mode: Literal["append", "replace"] | Omit = omit,
@@ -95,7 +93,8 @@ def async_(
9593
Recommended for large documents (>50 pages).
9694
9795
Args:
98-
file: File to upload (PDF, Word, Excel, PowerPoint, images)
96+
file: File to upload (PDF, Word, Excel, PowerPoint, images). Alternatively use
97+
file_url or file_base64.
9998
10099
output_format: Output format(s): `markdown`, `html`, `json`, `csv`. Comma-separate for multiple
101100
(e.g., `markdown,json`).
@@ -104,10 +103,6 @@ def async_(
104103
105104
custom_instructions: Custom extraction instructions (e.g., `Format dates as YYYY-MM-DD`)
106105
107-
file_base64: Base64-encoded file content
108-
109-
file_url: URL to download file from
110-
111106
include_metadata: Comma-separated metadata: `bounding_boxes`, `confidence_score`
112107
113108
json_options: JSON extraction options. Values: `hierarchy_output`, `table-of-contents`, field
@@ -135,8 +130,6 @@ def async_(
135130
"output_format": output_format,
136131
"csv_options": csv_options,
137132
"custom_instructions": custom_instructions,
138-
"file_base64": file_base64,
139-
"file_url": file_url,
140133
"include_metadata": include_metadata,
141134
"json_options": json_options,
142135
"prompt_mode": prompt_mode,
@@ -310,8 +303,6 @@ def sync(
310303
output_format: str,
311304
csv_options: str | Omit = omit,
312305
custom_instructions: str | Omit = omit,
313-
file_base64: str | Omit = omit,
314-
file_url: str | Omit = omit,
315306
include_metadata: str | Omit = omit,
316307
json_options: str | Omit = omit,
317308
prompt_mode: Literal["append", "replace"] | Omit = omit,
@@ -330,7 +321,8 @@ def sync(
330321
Provide exactly one of: `file`, `file_url`, or `file_base64`.
331322
332323
Args:
333-
file: File to upload (PDF, Word, Excel, PowerPoint, images)
324+
file: File to upload (PDF, Word, Excel, PowerPoint, images). Alternatively use
325+
file_url or file_base64.
334326
335327
output_format: Output format(s): `markdown`, `html`, `json`, `csv`. Comma-separate for multiple
336328
(e.g., `markdown,json`).
@@ -339,10 +331,6 @@ def sync(
339331
340332
custom_instructions: Custom extraction instructions (e.g., `Format dates as YYYY-MM-DD`)
341333
342-
file_base64: Base64-encoded file content
343-
344-
file_url: URL to download file from
345-
346334
include_metadata: Comma-separated metadata: `bounding_boxes`, `confidence_score`
347335
348336
json_options: JSON extraction options. Values: `hierarchy_output`, `table-of-contents`, field
@@ -370,8 +358,6 @@ def sync(
370358
"output_format": output_format,
371359
"csv_options": csv_options,
372360
"custom_instructions": custom_instructions,
373-
"file_base64": file_base64,
374-
"file_url": file_url,
375361
"include_metadata": include_metadata,
376362
"json_options": json_options,
377363
"prompt_mode": prompt_mode,
@@ -416,8 +402,6 @@ async def async_(
416402
output_format: str,
417403
csv_options: str | Omit = omit,
418404
custom_instructions: str | Omit = omit,
419-
file_base64: str | Omit = omit,
420-
file_url: str | Omit = omit,
421405
include_metadata: str | Omit = omit,
422406
json_options: str | Omit = omit,
423407
prompt_mode: Literal["append", "replace"] | Omit = omit,
@@ -436,7 +420,8 @@ async def async_(
436420
Recommended for large documents (>50 pages).
437421
438422
Args:
439-
file: File to upload (PDF, Word, Excel, PowerPoint, images)
423+
file: File to upload (PDF, Word, Excel, PowerPoint, images). Alternatively use
424+
file_url or file_base64.
440425
441426
output_format: Output format(s): `markdown`, `html`, `json`, `csv`. Comma-separate for multiple
442427
(e.g., `markdown,json`).
@@ -445,10 +430,6 @@ async def async_(
445430
446431
custom_instructions: Custom extraction instructions (e.g., `Format dates as YYYY-MM-DD`)
447432
448-
file_base64: Base64-encoded file content
449-
450-
file_url: URL to download file from
451-
452433
include_metadata: Comma-separated metadata: `bounding_boxes`, `confidence_score`
453434
454435
json_options: JSON extraction options. Values: `hierarchy_output`, `table-of-contents`, field
@@ -476,8 +457,6 @@ async def async_(
476457
"output_format": output_format,
477458
"csv_options": csv_options,
478459
"custom_instructions": custom_instructions,
479-
"file_base64": file_base64,
480-
"file_url": file_url,
481460
"include_metadata": include_metadata,
482461
"json_options": json_options,
483462
"prompt_mode": prompt_mode,
@@ -651,8 +630,6 @@ async def sync(
651630
output_format: str,
652631
csv_options: str | Omit = omit,
653632
custom_instructions: str | Omit = omit,
654-
file_base64: str | Omit = omit,
655-
file_url: str | Omit = omit,
656633
include_metadata: str | Omit = omit,
657634
json_options: str | Omit = omit,
658635
prompt_mode: Literal["append", "replace"] | Omit = omit,
@@ -671,7 +648,8 @@ async def sync(
671648
Provide exactly one of: `file`, `file_url`, or `file_base64`.
672649
673650
Args:
674-
file: File to upload (PDF, Word, Excel, PowerPoint, images)
651+
file: File to upload (PDF, Word, Excel, PowerPoint, images). Alternatively use
652+
file_url or file_base64.
675653
676654
output_format: Output format(s): `markdown`, `html`, `json`, `csv`. Comma-separate for multiple
677655
(e.g., `markdown,json`).
@@ -680,10 +658,6 @@ async def sync(
680658
681659
custom_instructions: Custom extraction instructions (e.g., `Format dates as YYYY-MM-DD`)
682660
683-
file_base64: Base64-encoded file content
684-
685-
file_url: URL to download file from
686-
687661
include_metadata: Comma-separated metadata: `bounding_boxes`, `confidence_score`
688662
689663
json_options: JSON extraction options. Values: `hierarchy_output`, `table-of-contents`, field
@@ -711,8 +685,6 @@ async def sync(
711685
"output_format": output_format,
712686
"csv_options": csv_options,
713687
"custom_instructions": custom_instructions,
714-
"file_base64": file_base64,
715-
"file_url": file_url,
716688
"include_metadata": include_metadata,
717689
"json_options": json_options,
718690
"prompt_mode": prompt_mode,

src/docstrange/types/extract_async_params.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111

1212
class ExtractAsyncParams(TypedDict, total=False):
1313
file: Required[FileTypes]
14-
"""File to upload (PDF, Word, Excel, PowerPoint, images)"""
14+
"""File to upload (PDF, Word, Excel, PowerPoint, images).
15+
16+
Alternatively use file_url or file_base64.
17+
"""
1518

1619
output_format: Required[str]
1720
"""Output format(s): `markdown`, `html`, `json`, `csv`.
@@ -25,12 +28,6 @@ class ExtractAsyncParams(TypedDict, total=False):
2528
custom_instructions: str
2629
"""Custom extraction instructions (e.g., `Format dates as YYYY-MM-DD`)"""
2730

28-
file_base64: str
29-
"""Base64-encoded file content"""
30-
31-
file_url: str
32-
"""URL to download file from"""
33-
3431
include_metadata: str
3532
"""Comma-separated metadata: `bounding_boxes`, `confidence_score`"""
3633

src/docstrange/types/extract_sync_params.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111

1212
class ExtractSyncParams(TypedDict, total=False):
1313
file: Required[FileTypes]
14-
"""File to upload (PDF, Word, Excel, PowerPoint, images)"""
14+
"""File to upload (PDF, Word, Excel, PowerPoint, images).
15+
16+
Alternatively use file_url or file_base64.
17+
"""
1518

1619
output_format: Required[str]
1720
"""Output format(s): `markdown`, `html`, `json`, `csv`.
@@ -25,12 +28,6 @@ class ExtractSyncParams(TypedDict, total=False):
2528
custom_instructions: str
2629
"""Custom extraction instructions (e.g., `Format dates as YYYY-MM-DD`)"""
2730

28-
file_base64: str
29-
"""Base64-encoded file content"""
30-
31-
file_url: str
32-
"""URL to download file from"""
33-
3431
include_metadata: str
3532
"""Comma-separated metadata: `bounding_boxes`, `confidence_score`"""
3633

tests/api_resources/test_extract.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ def test_method_async_with_all_params(self, client: Docstrange) -> None:
3737
output_format="markdown",
3838
csv_options="",
3939
custom_instructions="",
40-
file_base64="",
41-
file_url="",
4240
include_metadata="",
4341
json_options="",
4442
prompt_mode="append",
@@ -194,8 +192,6 @@ def test_method_sync_with_all_params(self, client: Docstrange) -> None:
194192
output_format="markdown",
195193
csv_options="",
196194
custom_instructions="",
197-
file_base64="",
198-
file_url="",
199195
include_metadata="",
200196
json_options="",
201197
prompt_mode="append",
@@ -253,8 +249,6 @@ async def test_method_async_with_all_params(self, async_client: AsyncDocstrange)
253249
output_format="markdown",
254250
csv_options="",
255251
custom_instructions="",
256-
file_base64="",
257-
file_url="",
258252
include_metadata="",
259253
json_options="",
260254
prompt_mode="append",
@@ -410,8 +404,6 @@ async def test_method_sync_with_all_params(self, async_client: AsyncDocstrange)
410404
output_format="markdown",
411405
csv_options="",
412406
custom_instructions="",
413-
file_base64="",
414-
file_url="",
415407
include_metadata="",
416408
json_options="",
417409
prompt_mode="append",

0 commit comments

Comments
 (0)