-
-
Notifications
You must be signed in to change notification settings - Fork 869
fix(genai): forward thinking_config parameter to Gemini models #1704
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
Conversation
- Add thinking_config handling to update_genai_kwargs function - Allows users to control thinking mode in Gemini 2.5-flash models - Pass thinking_config directly since it's already in genai format - Add comprehensive tests for thinking_config parameter handling Fixes #1648 Co-authored-by: Jason Liu <[email protected]>
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
instructor | fbaf4ed | Commit Preview URL Branch Preview URL |
Jul 13 2025, 05:13 PM |
Claude finished @jxnl's task —— View job PR Review: Add thinking_config parameter to Gemini modelsReview Tasks:
✅ Overall Assessment: LGTM with minor suggestionsThis is a clean, well-tested implementation that properly forwards the 📋 Code Quality & StandardsPositive aspects:
🧪 Test CoverageExcellent test coverage with three comprehensive test cases:
The tests follow the existing patterns and use proper imports ( 🔍 Implementation Analysisinstructor/utils.py:814-818 # Handle thinking_config parameter - pass through directly since it's already in genai format
thinking_config = new_kwargs.pop("thinking_config", None)
if thinking_config is not None:
base_config["thinking_config"] = thinking_config Strengths:
🔒 Security & Performance
🐛 Potential IssuesNone identified - The implementation is straightforward and follows established patterns. 💡 Minor Suggestions
🔗 Integration ContextThe changes integrate properly with the existing architecture:
✅ Approval RecommendationThis PR successfully addresses issue #1648 with:
Ready to merge ✅ |
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.
Important
Looks good to me! 👍
Reviewed everything up to 1ef1837 in 35 seconds. Click for details.
- Reviewed
69
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. instructor/utils.py:814
- Draft comment:
Good addition: thinking_config is popped and forwarded if non-None, mirroring other mappings. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
2. tests/llm/test_genai/test_utils.py:138
- Draft comment:
Comprehensive tests for thinking_config are added (valid, None, and absent cases). - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
Workflow ID: wflow_ST3J8II2pkcSvhov
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Claude finished @jxnl's task —— View job PR Review: Add thinking_config parameter to Gemini models ✅Review Tasks:
Changes Summary:Implementation (
Tests (
✅ Code Quality & Best PracticesExcellent implementation that follows repository conventions:
✅ Test CoverageComprehensive test suite covering all scenarios:
✅ No Bugs or Issues IdentifiedClean implementation with proper error handling:
✅ Performance ConsiderationsMinimal performance impact:
✅ Security AssessmentNo security concerns identified:
🎯 Specific ObservationsStrengths:
Minor Notes:
✅ Final AssessmentThis is a well-implemented feature that:
Recommendation: Approve 👍 The implementation is clean, well-tested, and follows all repository conventions. The change successfully enables thinking_config parameter forwarding to Gemini models while maintaining the existing function's behavior for all other parameters. |
…ry for `thinking_config` instead of `ThinkingConfig` class, simplifying the test setup.
…_thinking_config`, streamlining the test code.
Claude finished @jxnl's task —— View job PR Review: Add thinking_config parameter to Gemini models ✅Review Tasks:
Changes Summary:Implementation (
Tests (
✅ Code Quality & Best PracticesExcellent implementation that follows repository conventions:
✅ Test CoverageComprehensive test suite covering all scenarios:
✅ No Bugs or Issues IdentifiedClean implementation with proper error handling:
✅ Performance ConsiderationsMinimal performance impact:
✅ Security AssessmentNo security concerns identified:
🎯 Specific ObservationsStrengths:
Minor Notes:
✅ Final AssessmentThis is a well-implemented feature that:
Recommendation: Approve 👍 The implementation is clean, well-tested, and follows all repository conventions. The change successfully enables thinking_config parameter forwarding to Gemini models while maintaining the existing function's behavior for all other parameters. |
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.
Important
Looks good to me! 👍
Reviewed ac290e2 in 1 minute and 21 seconds. Click for details.
- Reviewed
17
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_genai/test_utils.py:154
- Draft comment:
Unused import: 'GenerationConfig' is imported but not used in this test. Consider removing it for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 85% The comment is technically correct - GenerationConfig is imported but never used. However, one of our rules states "Do NOT comment on anything that would be obviously caught by the build". Most modern Python builds include linting that would catch unused imports. This feels like something that would be caught automatically. The build system configuration isn't visible to me - maybe this codebase doesn't have linting for unused imports enabled? Even if linting isn't enabled, unused imports are such a minor issue that they don't warrant manual review comments. The comment doesn't point out any real problems with the code's functionality or design. Delete the comment since it points out an issue that should be caught by automated tools and doesn't impact code functionality.
2. tests/llm/test_genai/test_utils.py:156
- Draft comment:
The test now uses a dict for thinking_config. Ensure this is consistent with expected input in production. A comment explaining this decision would improve clarity. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
Workflow ID: wflow_UAIMHN9h2jyRjzjn
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Important
Looks good to me! 👍
Reviewed fbaf4ed in 41 seconds. Click for details.
- Reviewed
12
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_genai/test_utils.py:152
- Draft comment:
Good cleanup: the unused import of GenerationConfig and ThinkingConfig has been removed. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
2. tests/llm/test_genai/test_utils.py:155
- Draft comment:
The added tests for thinking_config (including non-None, None, and missing cases) are comprehensive and clearly validate the new forwarding behavior. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
Workflow ID: wflow_nuyvukL69JTXliZD
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Fixes #1648
Summary
Test plan
🤖 Generated with Claude Code
Important
Add handling for
thinking_config
parameter inupdate_genai_kwargs
to control thinking mode in Gemini models, with comprehensive tests.update_genai_kwargs
ininstructor/utils.py
now handlesthinking_config
parameter, allowing control of thinking mode in Gemini models.thinking_config
is passed through directly if provided, and excluded ifNone
.test_utils.py
to verifythinking_config
handling, including cases where it isNone
or not provided.This description was created by
for fbaf4ed. You can customize this summary. It will automatically update as commits are pushed.