Closed hholb closed 4 weeks ago
Attention: Patch coverage is 86.94030%
with 35 lines
in your changes missing coverage. Please review.
Project coverage is 77.41%. Comparing base (
e966643
) to head (16d8947
).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Resolves #422
Overview
:exclamation: BREAKING CHANGES :exclamation:
Redesign existing model connectors to inherit from a new
ModelConnector
abstract base class. The new class leverages pydantic v2 for validation and parsing of user input. This introduces a breaking change because the constructors for theGitHubConnector
andHFConnector
no longer accept positional arguments and require keyword args instead.This no longer works and will raise an error:
Now it must be:
Discussion
I created a new interface for users to construct these classes: a function called
create_connector
that takes a URL to a repo and returns the appropriate connector type. It is defined ingarden_ai/model_connectors/model_utils.py
Instead of constructing the correct connector class directly users can now do this:
I suggest we encourage users to use
create_connector
going forward as that will allow us to change the model connectors more easily without impacting user code. I updated the notebook templates to usecreate_connector
as part of this PR.Testing
Added new unit tests. Updated existing unit tests to handle the new constructors.
Can be tested pretty easily in Ipython by importing
create_connector
or the concrete model connectors and giving them a test drive.Documentation
Added doc comments for all new functions and classes.
📚 Documentation preview 📚: https://garden-ai--478.org.readthedocs.build/en/478/