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

[DOC ISSUE] Discrepancy in "Create a Custom Tool" documentation regarding Tool property initialization #156

Open
dannleft opened this issue Nov 21, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation feedback discord pending-validation

Comments

@dannleft
Copy link
Collaborator

Describe the Issue

The documentation for "Create a Custom Tool" (https://docs.kaibanjs.com/tools-docs/custom-tools/Create%20a%20Custom%20Tool) contains outdated instructions for setting up name, description, and schema properties in a custom tool class. It suggests assigning these properties directly within the class using this.property, as shown below:

this.name = "custom_tool";
this.description = "Describe what your tool does.";
this.schema = z.object({ ... });

However, the current implementation of the LangChain Tool class, on which KaibanJS depends, expects these properties to be passed as parameters to the super() constructor call, as shown in the example below:

super({
  name: "Text-to-Speech",
  description: "Convert text to speech using OpenAI TTS",
  schema: z.object({ ... }),
});

This discrepancy may cause confusion for users following the documentation and trying to implement custom tools.

Doc URL

https://docs.kaibanjs.com/tools-docs/custom-tools/Create%20a%20Custom%20Tool

@dannleft dannleft added documentation Improvements or additions to documentation feedback discord labels Nov 21, 2024
@ohadperry
Copy link

+1

@darielnoel
Copy link
Contributor

Thank you for catching this discrepancy! We’ll update the "Create a Custom Tool" documentation to reflect the correct approach of initializing properties via the super() constructor call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feedback discord pending-validation
Projects
None yet
Development

No branches or pull requests

3 participants