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 support kwargs (#5990) 1 year ago
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 Prompt from file proof of concept using plain text (#127) 2 years ago
docstore Add `DocstoreFn` - lookup doc via arbitrary function (#3760) 1 year ago
document_loaders YoutubeAudioLoader and updates to OpenAIWhisperParser (#5772) 1 year ago
evaluation Adding an in-context QA evaluation chain + chain of thought reasoning chain for improved accuracy (#2444) 2 years ago
examples Doc refactor (#6300) 1 year ago
llms support kwargs (#5990) 1 year ago
load Include placeholder value for all secrets, not just kwargs (#6421) 1 year ago
memory Implemented appending arbitrary messages (#5293) 1 year ago
output_parsers Fix class promotion (#6187) 1 year ago
prompts Fix for #6431 - chatprompt template with partial variables giing validation error (#6456) 1 year ago
retrievers Harrison/myscale self query (#6376) 1 year ago
tools fix: remove callbacks arg from Tool and StructuredTool inferred schema (#6483) 1 year ago
utilities Fix graphql tool (#4984) 1 year ago
vectorstores Add maximal relevance search to SKLearnVectorStore (#5430) 1 year ago
__init__.py initial commit 2 years ago
conftest.py Add pytest --only-extended and --only-core options (#4494) 1 year ago
test_bash.py Add Mastodon toots loader (#5036) 1 year ago
test_dependencies.py Fix class promotion (#6187) 1 year ago
test_document_transformers.py Contextual compression retriever (#2915) 1 year ago
test_formatting.py initial commit 2 years ago
test_math_utils.py add get_top_k_cosine_similarity method to get max top k score and index (#5059) 1 year ago
test_pytest_config.py Block sockets for unit-tests (#4803) 1 year ago
test_python.py option for csv agent to not include df in prompt (#4610) 1 year ago
test_schema.py [simple][test] Added test case for schema.py (#3692) 1 year ago
test_sql_database.py Fix SQLAlchemy truncating text when it is too big (#5206) 1 year ago
test_sql_database_schema.py Suppress duckdb warning in unit tests explicitly (#3653) 1 year ago
test_text_splitter.py MD header text splitter returns Documents (#6571) 1 year ago