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

Make Tools own model, add ToolKit Concept #1095

Merged
merged 22 commits into from
Feb 18, 2023
Merged

Make Tools own model, add ToolKit Concept #1095

merged 22 commits into from
Feb 18, 2023

Conversation

agola11
Copy link
Collaborator

@agola11 agola11 commented Feb 16, 2023

Follow-up of @hinthornw's PR:

  • Migrate the Tool abstraction to a separate file (BaseTool).
  • Tool implementation of BaseTool takes in function and coroutine to more easily maintain backwards compatibility
  • Add a Toolkit abstraction that can own the generation of tools around a shared concept or state

hinthornw and others added 5 commits February 16, 2023 11:53
- Migrate the Tool abstraction to a separate file
- Add a Toolkit abstraction that can own the generation of tools around
a shared concept or state

Example would be a JSON Toolkit where each tool may define different
functions an agent can run against the shared data object. We don't want
the Agent to own the data object, and it makes more sense for now to
keep the data object as a value that's managed by the tool/skill itself.

---------

Co-authored-by: Harrison Chase <[email protected]>
Co-authored-by: Francisco Ingham <[email protected]>
Co-authored-by: Dhruv Anand <[email protected]>
Co-authored-by: cragwolfe <[email protected]>
Co-authored-by: Anton Troynikov <[email protected]>
Co-authored-by: Oliver Klingefjord <[email protected]>
Co-authored-by: William Fu-Hinthorn <[email protected]>
Co-authored-by: Ankush Gola <[email protected]>
Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

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

my two big comments:

im not sure we need toolkits for google search/bing/wolfram alpha cause they only have one tool. would prefer not to overdo stuff, keep it light and basic until we have more certainty

tools loded in load_tools.py should use the Tool classes, right?

Makefile Outdated
@@ -32,9 +32,6 @@ lint:
test:
poetry run pytest tests/unit_tests

tests:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hwchase17 -- can move this to another PR but not sure why there is both make test and make tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

make test is what CI expects

Copy link
Contributor

Choose a reason for hiding this comment

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

someone added this because its more canonical, dont see harm in having both

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

reverted

Makefile Outdated
@@ -32,9 +32,6 @@ lint:
test:
poetry run pytest tests/unit_tests

tests:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

make test is what CI expects


def run(
self,
action: AgentAction,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hinthornw, @hwchase17 --> changed interface to take in AgentAction bc that's what callback manager expects, is backwards compatible

@agola11 agola11 changed the title [WIP] Toolkit Draft Make Tools own model, add ToolKit Concept Feb 18, 2023
@agola11 agola11 requested a review from sjwhitmore February 18, 2023 01:14
@agola11 agola11 marked this pull request as ready for review February 18, 2023 01:14
@hwchase17 hwchase17 merged commit 7b5e160 into master Feb 18, 2023
@hwchase17 hwchase17 deleted the ankush/toolkit branch February 18, 2023 21:40
@blob42 blob42 mentioned this pull request Feb 21, 2023
zachschillaci27 pushed a commit to zachschillaci27/langchain that referenced this pull request Mar 8, 2023
Follow-up of @hinthornw's PR:

- Migrate the Tool abstraction to a separate file (`BaseTool`).
- `Tool` implementation of `BaseTool` takes in function and coroutine to
more easily maintain backwards compatibility
- Add a Toolkit abstraction that can own the generation of tools around
a shared concept or state

---------

Co-authored-by: William FH <[email protected]>
Co-authored-by: Harrison Chase <[email protected]>
Co-authored-by: Francisco Ingham <[email protected]>
Co-authored-by: Dhruv Anand <[email protected]>
Co-authored-by: cragwolfe <[email protected]>
Co-authored-by: Anton Troynikov <[email protected]>
Co-authored-by: Oliver Klingefjord <[email protected]>
Co-authored-by: William Fu-Hinthorn <[email protected]>
Co-authored-by: Bruno Bornsztein <[email protected]>
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.

3 participants