-
Notifications
You must be signed in to change notification settings - Fork 3
Fix: Multipartform Requests #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
pushed the small fix following the review. if looks good go ahead and merge @Khurdhula-Harshavardhan ! |
…dding_v2 naming convetion.
winzamark123
approved these changes
Sep 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for your hard work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor how file uploads and multipart form data are handled across several modules, standardizing the approach for both synchronous and asynchronous requests. The main changes involve introducing a
filesparameter to request constructors, updating request logic to handle multipart forms properly, and simplifying header/content-type management. Additionally, some redundant imports and unnecessary code have been removed for clarity.File upload and multipart form improvements:
Added a
filesparameter to bothRequestandAsyncRequestclasses, and updated their constructors and request logic to handle multipart file uploads in a consistent way. This includes proper management of form fields, content types, and file data. [1] [2] [3] [4] [5] [6] [7] [8]Refactored API methods in
audio.py,embedding.py,embedding_v2.py, andtranslate.pyto use the newfilesparameter for file uploads, replacing previous ad-hoc handling ofContent-Typeheaders and file data. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]Code cleanup and simplification:
build_pathand redundant code for building paths and setting content types, as these are now handled more cleanly via the newfileslogic. [1] [2] [3]Refactors the JigsawStack client to consistently use
base_urlandheadersinstead of the previousapi_urland request logging flags. It also improves multipart file upload handling, simplifies request configuration, and updates the initialization and usage patterns for both sync and async clients and their modules. Additionally, a new test file is added to the CI workflow.Client configuration and initialization refactor:
JigsawStackandAsyncJigsawStackclasses injigsawstack/__init__.pyto usebase_urlandheadersfor API configuration, removingapi_urland request logging flags. All submodules now receive these parameters for consistent initialization. [1] [2] [3]ClientConfigand related config classes injigsawstack/_config.pyto usebase_urlandheaders, removing legacy parameters.Request handling improvements:
AsyncRequestConfigandAsyncRequestinjigsawstack/async_request.pyto supportbase_urlandheaders, and improved multipart file upload logic by handlingfilesand content-type correctly. [1] [2] [3] [4] [5] [6] [7]Module-level changes for audio:
AudioandAsyncAudioclasses injigsawstack/audio.pyto use the new config pattern and improved thespeech_to_textmethod to handle file uploads using the new multipart logic. [1] [2] [3] [4]Testing and CI:
test_vocr.pyto the CI workflow in.github/workflows/ci.ymlfor improved test coverage.Testing:
test_vocr.pyto the CI workflow to ensure new and existing file upload functionality is tested.