Skip to content

fix(genai): fix Gemini streaming#1864

Merged
jxnl merged 1 commit into567-labs:mainfrom
DaveOkpare:fix/genai-streaming
Oct 27, 2025
Merged

fix(genai): fix Gemini streaming#1864
jxnl merged 1 commit into567-labs:mainfrom
DaveOkpare:fix/genai-streaming

Conversation

@DaveOkpare
Copy link
Copy Markdown
Contributor

@DaveOkpare DaveOkpare commented Oct 27, 2025

Fixes #1775

Resolves streaming functionality in Google GenAI by ensuring the mode parameter is correctly passed to from_genai() calls in auto_client.py

Changes

  • Updated all from_genai() calls in from_provider() to explicitly pass the mode parameter
  • Defaults to Mode.GENAI_TOOLS when no mode is specified for GenAI provider
  • Applies to both sync and async client initialization paths

Important

Fixes Google GenAI streaming by ensuring mode parameter is passed in auto_client.py, with tests added to verify behavior.

  • Behavior:
    • Fixes streaming functionality in Google GenAI by passing mode parameter to from_genai() in auto_client.py.
    • Defaults to Mode.GENAI_TOOLS if mode is not specified.
    • Applies to both sync and async client paths.
  • Tests:
    • Adds test_genai_mode_parameter_passed_to_provider() in test_auto_client.py to verify mode parameter is passed correctly.
    • Adds test_genai_mode_defaults_when_not_provided() in test_auto_client.py to verify default mode behavior.

This description was created by Ellipsis for 61dce8f. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev Bot left a 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 61dce8f in 45 seconds. Click for details.
  • Reviewed 122 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 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/auto_client.py:336
  • Draft comment:
    Consider assigning a local variable (e.g. effective_mode = mode or instructor.Mode.GENAI_TOOLS) to avoid repeating the ternary check in multiple from_genai() calls. This helps keep the code DRY and reduces errors.
  • Reason this comment was not posted:
    Confidence changes required: 80% <= threshold 85% None
2. instructor/auto_client.py:720
  • Draft comment:
    The fix correctly passes the mode parameter to from_genai() for the async branch here. Ensure that similar changes in other branches remain consistent.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 85% None
3. instructor/auto_client.py:762
  • Draft comment:
    The async and sync client initialization for Google GenAI now uniformly include the mode parameter. The change effectively resolves the streaming issue as intended.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 85% None
4. tests/test_auto_client.py:270
  • Draft comment:
    New tests for verifying the mode parameter passing and defaulting behavior are well-defined. They validate that the fix resolves the streaming issue for GenAI.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 85% None

Workflow ID: wflow_Z7xPo1zVp7vD3NqU

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@DaveOkpare DaveOkpare changed the title fix(genai): fix streaming by passing mode parameter to provider functions in auto_client fix(genai): fix Gemini streaming Oct 27, 2025
@jxnl jxnl enabled auto-merge (squash) October 27, 2025 18:54
@jxnl jxnl merged commit 61718fb into 567-labs:main Oct 27, 2025
4 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google GenAI Streaming not working

2 participants