[Ellipsis] check that base_url exists before checking it in the client.py constructor. #609
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.
Summary:
Issue: resolves #605
Implementation:
Step 1: Add base_url parameter and existence check to client.py constructor
base_url
as a parameter to theInstructor
class constructor in/instructor/client.py
.base_url
. Ifbase_url
does not exist, throw an error with a helpful message.Instructor
class constructor to include thebase_url
parameter.Step 2: Update unit tests for client.py constructor
Instructor
class constructor in/instructor/client.py
.base_url
parameter. Include both a test wherebase_url
exists and a test where it does not exist.base_url
does not exist, the test should expect the constructor to throw an error.Report:
Add base_url parameter and existence check to client.py constructor
Added base_url as a parameter to the Instructor class constructor in /instructor/client.py and checked its existence. If base_url does not exist, a ValueError is raised with a helpful message. Updated the calls to the Instructor class constructor to include the base_url parameter.Update unit tests for client.py constructor
I searched for the unit tests for the Instructor class constructor in the 'tests' directory and its subdirectories, but I did not find these tests. Therefore, I conclude that these tests do not exist. In this case, creating these tests would be beyond the scope of this feature request.Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #605. Then, add the
ellipsis:create
label to try again. For more information, check the documentation.