Fix google call params error 936#937
Merged
willbakst merged 8 commits intoMirascope:mainfrom Apr 2, 2025
Merged
Conversation
willbakst
reviewed
Mar 28, 2025
willbakst
reviewed
Mar 29, 2025
willbakst
previously approved these changes
Apr 1, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #937 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 515 515
Lines 21070 21109 +39
=========================================
+ Hits 21070 21109 +39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- test_convert_common_call_params.py already tests that the call parameters are correctly converted - test_setup_call.py tests that call parameters are correctly passed through to setup_call
willbakst
approved these changes
Apr 2, 2025
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
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.
Closes: #936
Fix: Improve handling of configuration parameters in Google API calls
Issue: Error when calling google with call_params #936
Description
This PR fixes an issue where the Google API would fail with an
AsyncModels.generate_content() got an unexpected keyword argument 'generation_config'error when using call_params.The root problem was in how common parameters were being transferred from the conversion function to the actual API call configuration. By addressing this at the source, we've created a more robust solution that follows the codebase's established patterns.
Changes
_setup_call.pyby properly transferring generation_config parameters to the API's required config object_convert_common_call_params.pyto match Google API requirementsTests
tests/core/google/test_call_params.pyto properly type-cast parametersThis code now doesn't fail: