StringTool<Options extends ToolOptions> constructor

StringTool<Options extends ToolOptions>({
  1. required String name,
  2. required String description,
  3. String inputDescription = 'The input to the tool',
  4. bool strict = false,
  5. bool returnDirect = false,
  6. String handleToolError(
    1. ToolException
    )?,
  7. Options? defaultOptions,
})

Base class for tools that accept a single string input and returns a string output.

Implementation

StringTool({
  required super.name,
  required super.description,
  final String inputDescription = 'The input to the tool',
  super.strict = false,
  super.returnDirect = false,
  super.handleToolError,
  super.defaultOptions,
}) : super(
        inputJsonSchema: {
          'type': 'object',
          'properties': {
            'input': {
              'type': 'string',
              'description': inputDescription,
            },
          },
          'required': ['input'],
        },
      );