Skip to content
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

Fix inconsistent base_url behavior in module client and OpenAIClient #2157

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SmartManoj
Copy link

@SmartManoj SmartManoj commented Mar 2, 2025

Fixes #1373

Update base_url behavior to enforce trailing slash in module client

  • Modify src/openai/__init__.py to enforce a trailing slash for base_url in the _ModuleClient class.
  • Add a helper method _enforce_trailing_slash to the _ModuleClient class.
  • Update tests in tests/test_module_client.py to verify the consistent behavior of base_url in both module client and OpenAIClient.

For more details, open the Copilot Workspace session.

Fixes openai#1373

Update `base_url` behavior to enforce trailing slash in module client

* Modify `src/openai/__init__.py` to enforce a trailing slash for `base_url` in the `_ModuleClient` class.
* Add a helper method `_enforce_trailing_slash` to the `_ModuleClient` class.
* Update tests in `tests/test_module_client.py` to verify the consistent behavior of `base_url` in both module client and `OpenAIClient`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/openai/openai-python/issues/1373?shareId=XXXX-XXXX-XXXX-XXXX).
@SmartManoj SmartManoj requested a review from a team as a code owner March 2, 2025 14:16
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.

Inconsistent base_url behavior with module client and OpenAIClient
1 participant