Skip to content

Finish up optional deps#11

Merged
andreibondarev merged 5 commits intopatterns-ai-core:mainfrom
mission-met:finish-up-optional-deps
May 16, 2023
Merged

Finish up optional deps#11
andreibondarev merged 5 commits intopatterns-ai-core:mainfrom
mission-met:finish-up-optional-deps

Conversation

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