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

feat: Add structured class #123

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lgesuellip
Copy link

PR Description

Hey Team,

As part of the Pampa team, I’ve developed a class for Crewai to create a tool that wraps a given function.
This class enables us to encapsulate any function, making it easily accessible to an agent.

What’s implemented in this PR:

  • The class with a method to create a tool from a given function, providing an abstraction to wrap any function easily.
  • Documentation, including usage instructions and an example.

Relevant Issues

I created an issue detailing the need for this functionality and how we’re utilizing it:
Issue #1585

Type

🆕 New Feature

Testing

  • Added unit tests to cover basic functionality.
  • Validated error handling and edge cases.
  • Tested integration with CrewAI.

Thank you, Team! Let me know if there’s any feedback.

@lgesuellip lgesuellip changed the title FEATURE: Add structured class feat: Add structured class Nov 18, 2024
@pythonbyte
Copy link
Collaborator

Hi @lgesuellip,

Thanks for the PR. Can you check if your implementation is the same as the one we added to the main repository or something that might be extended from it? 

https://github.com/crewAIInc/crewAI/pull/1654/files#diff-a7d8eca7c4001e114bc0d03bd90b59036a5f51dc3d991f05aa0096257f542513
src/crewai/tools/structured_tool.py

@lgesuellip
Copy link
Author

lgesuellip commented Nov 27, 2024

Hi @pythonbyte, a pleasure.
Wow, it looks almost identical!
What timing—this was merged just yesterday.
I'll test it using version 0.83.0 on our application.

Should we add my documentation? What do you think?

Thank you,

@bhancockio
Copy link
Collaborator

Hey @lgesuellip !

Thank you for working on this! We've actually moved BaseTool and StructuredTool out of the crewai-tools repo and now they are in the crewai repo.

Here's a link to the StructuredTool code:
https://github.com/crewAIInc/crewAI/blob/main/src/crewai/tools/structured_tool.py

I do really like your description of StructuredTools. If you bring over the doc changes to our tool documentation, I'd be happy to approve and merge them in!

https://github.com/crewAIInc/crewAI/blob/main/docs/concepts/tools.mdx

Please let me know if you have any questions!

@lgesuellip
Copy link
Author

Hey Team,

I just created the PR to add the documentation,

crewAIInc/crewAI#1713

Thanks,

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