-
Notifications
You must be signed in to change notification settings - Fork 175
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
Drivers Config Context Manager #1162
Conversation
6442f96
to
ad0c28b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is cool. maybe the docs example be updated to show creating a custom DriversConfig
and using that as a context manager?
def __exit__(self, type, value, traceback) -> None: # noqa: ANN001, A002 | ||
from griptape.configs import Defaults | ||
|
||
Defaults.drivers_config = self._old_drivers_config | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should add self._old_drivers_config = None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zachgiordano I think this example may be doing too much for what we're trying to illustrate.
What do you think about instead beefing up the existing custom example? @vachillo what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me
a25bd38
to
aaf4528
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Just what I needed!
64e0342
94453c7
to
64e0342
Compare
…y setting the default Drivers.
64e0342
to
99e3b99
Compare
Describe your changes
Added ability to use Drivers Configs as Context Managers for temporarily setting the default Drivers.
Issue ticket number and link
NA
📚 Documentation preview 📚: https://griptape--1162.org.readthedocs.build//1162/