The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
test(core): reactivate commented tests in `test_indexing` (#32882)
Christophe Bornet12921a94c5bf
diff --git a/libs/core/langchain_core/tools/base.py b/libs/core/langchain_core/tools/base.pyindex 81ba71a891..8c8857d79d 100644--- a/libs/core/langchain_core/tools/base.py+++ b/libs/core/langchain_core/tools/base.py@@ -1362,8 +1362,8 @@ def get_all_basemodel_annotations(continue# if class = FooBar inherits from Baz[str]:- # parent = Baz[str],- # parent_origin = Baz,+ # parent = class Baz[str],+ # parent_origin = class Baz,# generic_type_vars = (type vars in Baz)# generic_map = {type var in Baz: str}generic_type_vars: tuple = getattr(parent_origin, "__parameters__", ())diff --git a/libs/core/langchain_core/tools/convert.py b/libs/core/langchain_core/tools/convert.pyindex 691550439c..0c48b3c7e4 100644--- a/libs/core/langchain_core/tools/convert.py+++ b/libs/core/langchain_core/tools/convert.py@@ -315,7 +315,7 @@ def tool(if runnable is not None:# tool is used as a function- # tool_from_runnable = tool("name", runnable)+ # for instance tool_from_runnable = tool("name", runnable)if not name_or_callable:msg = "Runnable without name for tool constructor"raise ValueError(msg)diff --git a/libs/core/tests/unit_tests/indexing/test_indexing.py b/libs/core/tests/unit_tests/indexing/test_indexing.pyindex a3e88e7535..0f4850fafe 100644--- a/libs/core/tests/unit_tests/indexing/test_indexing.py+++ b/libs/core/tests/unit_tests/indexing/test_indexing.py@@ -2421,14 +2421,12 @@ def test_index_into_document_index(record_manager: InMemoryRecordManager) -> Non"num_updated": 2,}- # TODO: This test is failing due to an existing bug with DocumentIndex deletion- # when indexing an empty list. Skipping this assertion for now.- # assert index([], record_manager, document_index, cleanup="full") == {- # "num_added": 0,- # "num_deleted": 2,- # "num_skipped": 0,- # "num_updated": 0,- # }+ assert index([], record_manager, document_index, cleanup="full") == {+ "num_added": 0,+ "num_deleted": 2,+ "num_skipped": 0,+ "num_updated": 0,+ }async def test_aindex_into_document_index(@@ -2460,6 +2458,7 @@ async def test_aindex_into_document_index("num_skipped": 2,"num_updated": 0,}+assert await aindex(docs, arecord_manager, document_index, cleanup="full", force_update=True) == {@@ -2469,14 +2468,12 @@ async def test_aindex_into_document_index("num_updated": 2,}- # TODO: This test is failing due to an existing bug with DocumentIndex deletion- # when indexing an empty list. Skipping this assertion for now.- # assert await aindex([], arecord_manager, document_index, cleanup="full") == {- # "num_added": 0,- # "num_deleted": 2,- # "num_skipped": 0,- # "num_updated": 0,- # }+ assert await aindex([], arecord_manager, document_index, cleanup="full") == {+ "num_added": 0,+ "num_deleted": 2,+ "num_skipped": 0,+ "num_updated": 0,+ }def test_index_with_upsert_kwargs(