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(tools): Support customizing Tool input description #258

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Conversation

davidmigloz
Copy link
Owner

@davidmigloz davidmigloz commented Dec 11, 2023

Eg.

final class CalculatorTool extends Tool<ToolOptions> {
  CalculatorTool()
      : super(
          name: 'calculator',
          description: 'Useful for getting the result of a math expression that could be executed by a simple calculator.',
          inputDescription: 'A valid mathematical expression to evaluate',
        );

  // ...
}

Or from a function:

final myTool = Tool.fromFunction(
  name: 'myTool',
  description: 'My tool description...',
  inputDescription: 'Description of the input of my tool',
  func: (
    final String toolInput, {
    final ToolOptions? options,
  }) => //...,
);

@davidmigloz davidmigloz self-assigned this Dec 11, 2023
@davidmigloz davidmigloz added c:tools Tools. t:enhancement New feature or request labels Dec 11, 2023
@davidmigloz davidmigloz added this to the v0.3.0 milestone Dec 11, 2023
@davidmigloz davidmigloz merged commit a9a1b2a into main Dec 11, 2023
1 check passed
@davidmigloz davidmigloz deleted the tools branch December 11, 2023 21:22
KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:tools Tools. t:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant