Skip to content
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

Finish up optional deps #11

Merged

Conversation

rickychilcott
Copy link
Contributor

This finishes up applying optional dependencies (proof of concept in #7) and improves code style.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tools now work by creating an instance of the tool, but I still keep the class-level method to allow direct execution.

Comment on lines +26 to +28
def self.execute_search(input:)
new.execute_search(input: input)
end
Copy link
Contributor Author

@rickychilcott rickychilcott May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered not adding this, but didn't want to require other tools to instantiate this tool to use it.

@rickychilcott
Copy link
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.

@andreibondarev andreibondarev self-requested a review May 16, 2023 16:06
@andreibondarev andreibondarev merged commit 1caec7c into patterns-ai-core:main May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants