|
14 | 14 | from . import _exceptions |
15 | 15 | from ._qs import Querystring |
16 | 16 | from .types import client_parse_params, client_split_params, client_extract_params, client_extract_build_schema_params |
| 17 | +from ._files import deepcopy_with_paths |
17 | 18 | from ._types import ( |
18 | 19 | Body, |
19 | 20 | Omit, |
|
33 | 34 | is_given, |
34 | 35 | extract_files, |
35 | 36 | maybe_transform, |
36 | | - deepcopy_minimal, |
37 | 37 | get_async_library, |
38 | 38 | async_maybe_transform, |
39 | 39 | ) |
@@ -348,14 +348,15 @@ def extract( |
348 | 348 | # Convert local file paths to file parameters |
349 | 349 | markdown, markdown_url = convert_url_to_file_if_local(markdown, markdown_url) |
350 | 350 |
|
351 | | - body = deepcopy_minimal( |
| 351 | + body = deepcopy_with_paths( |
352 | 352 | { |
353 | 353 | "schema": schema, |
354 | 354 | "markdown": markdown, |
355 | 355 | "markdown_url": markdown_url, |
356 | 356 | "model": model, |
357 | 357 | "strict": strict, |
358 | | - } |
| 358 | + }, |
| 359 | + [["markdown"]], |
359 | 360 | ) |
360 | 361 | files = extract_files(cast(Mapping[str, object], body), paths=[["markdown"]]) |
361 | 362 | # It should be noted that the actual Content-Type header that will be |
@@ -430,14 +431,15 @@ def extract_build_schema( |
430 | 431 |
|
431 | 432 | timeout: Override the client-level default timeout for this request, in seconds |
432 | 433 | """ |
433 | | - body = deepcopy_minimal( |
| 434 | + body = deepcopy_with_paths( |
434 | 435 | { |
435 | 436 | "markdown_urls": markdown_urls, |
436 | 437 | "markdowns": markdowns, |
437 | 438 | "model": model, |
438 | 439 | "prompt": prompt, |
439 | 440 | "schema": schema, |
440 | | - } |
| 441 | + }, |
| 442 | + [["markdowns", "<array>"]], |
441 | 443 | ) |
442 | 444 | files = extract_files(cast(Mapping[str, object], body), paths=[["markdowns", "<array>"]]) |
443 | 445 | # It should be noted that the actual Content-Type header that will be |
@@ -520,15 +522,16 @@ def parse( |
520 | 522 | # Convert local file paths to file parameters |
521 | 523 | document, document_url = convert_url_to_file_if_local(document, document_url) |
522 | 524 |
|
523 | | - body = deepcopy_minimal( |
| 525 | + body = deepcopy_with_paths( |
524 | 526 | { |
525 | 527 | "custom_prompts": custom_prompts, |
526 | 528 | "document": document, |
527 | 529 | "document_url": document_url, |
528 | 530 | "model": model, |
529 | 531 | "password": password, |
530 | 532 | "split": split, |
531 | | - } |
| 533 | + }, |
| 534 | + [["document"]], |
532 | 535 | ) |
533 | 536 | files = extract_files(cast(Mapping[str, object], body), paths=[["document"]]) |
534 | 537 | # It should be noted that the actual Content-Type header that will be |
@@ -606,13 +609,14 @@ def split( |
606 | 609 | # Store original inputs for filename extraction |
607 | 610 | original_markdown = markdown |
608 | 611 | original_markdown_url = markdown_url |
609 | | - body = deepcopy_minimal( |
| 612 | + body = deepcopy_with_paths( |
610 | 613 | { |
611 | 614 | "split_class": split_class, |
612 | 615 | "markdown": markdown, |
613 | 616 | "markdown_url": markdown_url, |
614 | 617 | "model": model, |
615 | | - } |
| 618 | + }, |
| 619 | + [["markdown"]], |
616 | 620 | ) |
617 | 621 | files = extract_files(cast(Mapping[str, object], body), paths=[["markdown"]]) |
618 | 622 | # It should be noted that the actual Content-Type header that will be |
@@ -885,14 +889,15 @@ async def extract( |
885 | 889 | # Convert local file paths to file parameters |
886 | 890 | markdown, markdown_url = convert_url_to_file_if_local(markdown, markdown_url) |
887 | 891 |
|
888 | | - body = deepcopy_minimal( |
| 892 | + body = deepcopy_with_paths( |
889 | 893 | { |
890 | 894 | "schema": schema, |
891 | 895 | "markdown": markdown, |
892 | 896 | "markdown_url": markdown_url, |
893 | 897 | "model": model, |
894 | 898 | "strict": strict, |
895 | | - } |
| 899 | + }, |
| 900 | + [["markdown"]], |
896 | 901 | ) |
897 | 902 | files = extract_files(cast(Mapping[str, object], body), paths=[["markdown"]]) |
898 | 903 | # It should be noted that the actual Content-Type header that will be |
@@ -963,14 +968,15 @@ async def extract_build_schema( |
963 | 968 |
|
964 | 969 | timeout: Override the client-level default timeout for this request, in seconds |
965 | 970 | """ |
966 | | - body = deepcopy_minimal( |
| 971 | + body = deepcopy_with_paths( |
967 | 972 | { |
968 | 973 | "markdown_urls": markdown_urls, |
969 | 974 | "markdowns": markdowns, |
970 | 975 | "model": model, |
971 | 976 | "prompt": prompt, |
972 | 977 | "schema": schema, |
973 | | - } |
| 978 | + }, |
| 979 | + [["markdowns", "<array>"]], |
974 | 980 | ) |
975 | 981 | files = extract_files(cast(Mapping[str, object], body), paths=[["markdowns", "<array>"]]) |
976 | 982 | # It should be noted that the actual Content-Type header that will be |
@@ -1045,15 +1051,16 @@ async def parse( |
1045 | 1051 | # Convert local file paths to file parameters |
1046 | 1052 | document, document_url = convert_url_to_file_if_local(document, document_url) |
1047 | 1053 |
|
1048 | | - body = deepcopy_minimal( |
| 1054 | + body = deepcopy_with_paths( |
1049 | 1055 | { |
1050 | 1056 | "custom_prompts": custom_prompts, |
1051 | 1057 | "document": document, |
1052 | 1058 | "document_url": document_url, |
1053 | 1059 | "model": model, |
1054 | 1060 | "password": password, |
1055 | 1061 | "split": split, |
1056 | | - } |
| 1062 | + }, |
| 1063 | + [["document"]], |
1057 | 1064 | ) |
1058 | 1065 | files = extract_files(cast(Mapping[str, object], body), paths=[["document"]]) |
1059 | 1066 | # It should be noted that the actual Content-Type header that will be |
@@ -1119,13 +1126,14 @@ async def split( |
1119 | 1126 |
|
1120 | 1127 | timeout: Override the client-level default timeout for this request, in seconds |
1121 | 1128 | """ |
1122 | | - body = deepcopy_minimal( |
| 1129 | + body = deepcopy_with_paths( |
1123 | 1130 | { |
1124 | 1131 | "split_class": split_class, |
1125 | 1132 | "markdown": markdown, |
1126 | 1133 | "markdown_url": markdown_url, |
1127 | 1134 | "model": model, |
1128 | | - } |
| 1135 | + }, |
| 1136 | + [["markdown"]], |
1129 | 1137 | ) |
1130 | 1138 | files = extract_files(cast(Mapping[str, object], body), paths=[["markdown"]]) |
1131 | 1139 | # It should be noted that the actual Content-Type header that will be |
|
0 commit comments