Skip to content

fix: OpenAI provider in from_provider ignores base_url kwarg#1971

Merged
jxnl merged 1 commit into567-labs:mainfrom
gardner:main
Dec 30, 2025
Merged

fix: OpenAI provider in from_provider ignores base_url kwarg#1971
jxnl merged 1 commit into567-labs:mainfrom
gardner:main

Conversation

@gardner
Copy link
Copy Markdown
Contributor

@gardner gardner commented Dec 23, 2025

Fixes: OpenAI provider in from_provider ignores base_url kwarg (can't point client to custom endpoint) #1921


Important

Fixes from_provider to pass base_url to OpenAI clients and adds tests to verify this behavior.

  • Behavior:
    • Fixes from_provider in auto_client.py to correctly pass base_url to OpenAI client constructors.
    • Handles both AsyncOpenAI and OpenAI clients.
  • Tests:
    • Adds test_openai_provider_respects_base_url() in test_auto_client.py to verify base_url is passed to OpenAI.
    • Adds test_openai_provider_async_client_with_base_url() to verify base_url is passed to AsyncOpenAI.
    • Adds test_openai_provider_without_base_url() to ensure default behavior when base_url is not provided.

This description was created by Ellipsis for 0ea8e90. 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 0ea8e90 in 36 seconds. Click for details.
  • Reviewed 120 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:163
  • Draft comment:
    Good extraction of base_url and related OpenAI client parameters from kwargs. Consider abstracting this pattern if similar logic is needed for other providers.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 85% None
2. tests/test_auto_client.py:273
  • Draft comment:
    Test 'test_openai_provider_respects_base_url' correctly verifies that base_url and api_key are passed to the OpenAI client constructor.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 85% None
3. tests/test_auto_client.py:298
  • Draft comment:
    Test 'test_openai_provider_async_client_with_base_url' ensures that the async client also receives the correct base_url and api_key. This is clear and effective.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 85% None
4. tests/test_auto_client.py:325
  • Draft comment:
    Test 'test_openai_provider_without_base_url' properly confirms that the base_url is not added when not provided. This validates the default behavior.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 85% None

Workflow ID: wflow_rNEsYMBlTJNHGDiR

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

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.

2 participants