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
2023-06-23 01:48:27 -07:00
..
agents Incorrect argument count handling (#5543) 2023-06-19 22:06:20 -07:00
callbacks StreamlitCallbackHandler (#6315) 2023-06-22 13:14:28 -07:00
chains support kwargs (#5990) 2023-06-11 10:09:22 -07:00
chat_models add FunctionMessage support to _convert_dict_to_message() in OpenAI chat model (#6382) 2023-06-20 08:25:55 -07:00
client Session to project (#6249) 2023-06-23 01:11:01 -07:00
data
docstore
document_loaders YoutubeAudioLoader and updates to OpenAIWhisperParser (#5772) 2023-06-06 15:15:08 -07:00
evaluation
examples Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
llms support kwargs (#5990) 2023-06-11 10:09:22 -07:00
load Include placeholder value for all secrets, not just kwargs (#6421) 2023-06-19 15:41:45 +01:00
memory Implemented appending arbitrary messages (#5293) 2023-05-29 07:18:59 -07:00
output_parsers Fix class promotion (#6187) 2023-06-18 16:55:18 -07:00
prompts Fix for #6431 - chatprompt template with partial variables giing validation error (#6456) 2023-06-19 22:08:15 -07:00
retrievers Harrison/myscale self query (#6376) 2023-06-18 16:53:10 -07:00
tools fix: remove callbacks arg from Tool and StructuredTool inferred schema (#6483) 2023-06-23 01:48:27 -07:00
utilities Fix graphql tool (#4984) 2023-05-19 15:27:50 -07:00
vectorstores Add maximal relevance search to SKLearnVectorStore (#5430) 2023-05-30 16:13:33 -07:00
__init__.py
conftest.py Add pytest --only-extended and --only-core options (#4494) 2023-05-12 11:35:22 -04:00
test_bash.py Add Mastodon toots loader (#5036) 2023-05-22 16:43:07 -07:00
test_dependencies.py Fix class promotion (#6187) 2023-06-18 16:55:18 -07:00
test_document_transformers.py
test_formatting.py
test_math_utils.py add get_top_k_cosine_similarity method to get max top k score and index (#5059) 2023-05-22 11:55:48 -07:00
test_pytest_config.py Block sockets for unit-tests (#4803) 2023-05-16 14:41:24 -04:00
test_python.py option for csv agent to not include df in prompt (#4610) 2023-05-12 21:55:22 -07:00
test_schema.py
test_sql_database_schema.py
test_sql_database.py Fix SQLAlchemy truncating text when it is too big (#5206) 2023-06-01 21:33:31 -04:00
test_text_splitter.py MD header text splitter returns Documents (#6571) 2023-06-22 09:25:38 -07:00