You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/tests/unit_tests
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
1 year ago
..
agents Incorrect argument count handling (#5543) 1 year ago
callbacks StreamlitCallbackHandler (#6315) 1 year ago
chains
chat_models add FunctionMessage support to `_convert_dict_to_message()` in OpenAI chat model (#6382) 1 year ago
client Session to project (#6249) 1 year ago
data
docstore
document_loaders
evaluation
examples
llms
load Include placeholder value for all secrets, not just kwargs (#6421) 1 year ago
memory
output_parsers
prompts Fix for #6431 - chatprompt template with partial variables giing validation error (#6456) 1 year ago
retrievers
tools fix: remove callbacks arg from Tool and StructuredTool inferred schema (#6483) 1 year ago
utilities
vectorstores
__init__.py
conftest.py
test_bash.py
test_dependencies.py
test_document_transformers.py
test_formatting.py
test_math_utils.py
test_pytest_config.py
test_python.py
test_schema.py
test_sql_database.py
test_sql_database_schema.py
test_text_splitter.py MD header text splitter returns Documents (#6571) 1 year ago