Finish up optional deps#11
Merged
andreibondarev merged 5 commits intopatterns-ai-core:mainfrom May 16, 2023
Merged
Conversation
rickychilcott
commented
May 16, 2023
Comment on lines
25
to
+27
| def self.execute(input:) | ||
| raise NotImplementedError, "Your tool must implement the `self.execute(input:)` method that returns a string" | ||
| new.execute(input: input) | ||
| end |
Contributor
Author
There was a problem hiding this comment.
Tools now work by creating an instance of the tool, but I still keep the class-level method to allow direct execution.
rickychilcott
commented
May 16, 2023
Comment on lines
+26
to
+28
| def self.execute_search(input:) | ||
| new.execute_search(input: input) | ||
| end |
Contributor
Author
There was a problem hiding this comment.
I considered not adding this, but didn't want to require other tools to instantiate this tool to use it.
Contributor
Author
|
This is bigger than I thought it would need to be because of switching tools from effectively singletons to instances. Let me know your thoughts. |
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.
This finishes up applying optional dependencies (proof of concept in #7) and improves code style.