Fix inconsistent base_url behavior in module client and OpenAIClient#2157
Open
SmartManoj wants to merge 2 commits intoopenai:mainfrom
Open
Fix inconsistent base_url behavior in module client and OpenAIClient#2157SmartManoj wants to merge 2 commits intoopenai:mainfrom
SmartManoj wants to merge 2 commits intoopenai:mainfrom
Conversation
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).
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.
Fixes #1373
Update
base_urlbehavior to enforce trailing slash in module clientsrc/openai/__init__.pyto enforce a trailing slash forbase_urlin the_ModuleClientclass._enforce_trailing_slashto the_ModuleClientclass.tests/test_module_client.pyto verify the consistent behavior ofbase_urlin both module client andOpenAIClient.For more details, open the Copilot Workspace session.