Base class for tools unit tests.
ToolsUnitTests()Test init.
Test that the tool can be initialized with tool_constructor and
tool_constructor_params. If this fails, check that the
keyword args defined in tool_constructor_params are valid.
Test that the tool can be initialized from environment variables.
Tests that the tool has a name attribute to pass to chat models.
If this fails, add a name parameter to your tool.
Tests that the tool has an input schema.
If this fails, add an args_schema to your tool.
See this guide
and see how CalculatorInput is configured in the
CustomCalculatorTool.args_schema attribute
Tests that the provided example params match the declared input schema.
If this fails, update the tool_invoke_params_example attribute to match
the input schema (args_schema) of the tool.
Returns a class or instance of a tool to be tested.
Returns a dictionary of parameters to pass to the tool constructor.
Returns a dictionary representing the "args" of an example tool call.