Commit c8d6e77
refactor(client): align parse() style with the rest of the file
Three small style nits surfaced in code review against the patterns set
by sign() and the other raw-send_request methods (get_account_info,
create_token, delete_token):
- Drop the redundant inner cast("ParseOutput", {"format": output_format}).
ParseOutput is a single-key TypedDict with total=False; the literal
already satisfies it structurally via the surrounding ParseInstructions
annotation. No other call site in client.py casts an inner literal
this way.
- Replace the RequestConfig(...) constructor call with an inline dict
literal at the send_request boundary, matching sign / create_token /
delete_token / get_account_info. RequestConfig is a generic TypedDict;
the constructor form is the outlier.
- Broaden the file parameter docstring to call out that the endpoint
accepts PDFs, Office documents, and images. Unlike sign(), parsing is
not PDF-only, and the previous docstring implicitly invited readers
to transplant sign()'s PDF-only mental model.
No behavior change.
format) combinations.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 90040d6 commit c8d6e77
1 file changed
Lines changed: 13 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| |||
799 | 798 | | |
800 | 799 | | |
801 | 800 | | |
802 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
803 | 805 | | |
804 | 806 | | |
805 | 807 | | |
| |||
835 | 837 | | |
836 | 838 | | |
837 | 839 | | |
838 | | - | |
| 840 | + | |
839 | 841 | | |
840 | 842 | | |
841 | 843 | | |
842 | 844 | | |
843 | 845 | | |
844 | 846 | | |
845 | 847 | | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
851 | 856 | | |
852 | | - | |
853 | | - | |
854 | 857 | | |
855 | 858 | | |
856 | 859 | | |
| |||
0 commit comments