langchain/tests/unit_tests/tools
Alejandra De Luna 980c865174
fix: remove callbacks arg from Tool and StructuredTool inferred schema (#6483)
Fixes #5456 

This PR removes the `callbacks` argument from a tool's schema when
creating a `Tool` or `StructuredTool` with the `from_function` method
and `infer_schema` is set to `True`. The `callbacks` argument is now
removed in the `create_schema_from_function` and `_get_filtered_args`
methods. As suggested by @vowelparrot, this fix provides a
straightforward solution that minimally affects the existing
implementation.

A test was added to verify that this change enables the expected use of
`Tool` and `StructuredTool` when using a `CallbackManager` and inferring
the tool's schema.

  - @hwchase17
2023-06-23 01:48:27 -07:00
..
file_management Add Other File Utilities (#3209) 2023-04-28 10:53:37 -07:00
openapi Add Request body (#2507) 2023-04-06 13:02:42 -07:00
powerbi power bi api wrapper integration tests & bug fix (#4983) 2023-05-19 11:25:52 -04:00
python Improved query, print & exception handling in REPL Tool (#4997) 2023-05-22 13:43:44 +00:00
requests tools refactor (#2961) 2023-04-17 21:35:29 -07:00
shell Accept str or list[str] for shell (#4060) 2023-05-03 21:11:06 -07:00
__init__.py
test_base.py fix: remove callbacks arg from Tool and StructuredTool inferred schema (#6483) 2023-06-23 01:48:27 -07:00
test_exported.py Fix class promotion (#6187) 2023-06-18 16:55:18 -07:00
test_json.py
test_public_api.py Fix class promotion (#6187) 2023-06-18 16:55:18 -07:00
test_signatures.py Pass parsed inputs through to tool _run (#4309) 2023-05-08 09:13:05 -07:00
test_zapier.py Allow custom base Zapier prompt (#4213) 2023-05-13 21:08:18 -07:00