The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Use pytest asyncio auto mode (#13643)
Nuno Campos8329f81072d3
diff --git a/libs/experimental/pyproject.toml b/libs/experimental/pyproject.tomlindex 65e7fbfe8a..89f5b53781 100644--- a/libs/experimental/pyproject.toml+++ b/libs/experimental/pyproject.toml@@ -92,3 +92,4 @@ markers = ["asyncio: mark tests as requiring asyncio","compile: mark placeholder test used to compile integration tests without running them",]+asyncio_mode = "auto"diff --git a/libs/experimental/tests/integration_tests/chains/test_synthetic_data_openai.py b/libs/experimental/tests/integration_tests/chains/test_synthetic_data_openai.pyindex 7366901b98..3b94e52d08 100644--- a/libs/experimental/tests/integration_tests/chains/test_synthetic_data_openai.py+++ b/libs/experimental/tests/integration_tests/chains/test_synthetic_data_openai.py@@ -89,7 +89,6 @@ def test_generate_synthetic(synthetic_data_generator: SyntheticDataGenerator) ->@pytest.mark.requires("openai")async def test_agenerate_synthetic(synthetic_data_generator: SyntheticDataGenerator,) -> None:diff --git a/libs/experimental/tests/unit_tests/chat_models/test_llm_wrapper_llama2chat.py b/libs/experimental/tests/unit_tests/chat_models/test_llm_wrapper_llama2chat.pyindex 21a0ae71cc..2ae184b196 100644--- a/libs/experimental/tests/unit_tests/chat_models/test_llm_wrapper_llama2chat.py+++ b/libs/experimental/tests/unit_tests/chat_models/test_llm_wrapper_llama2chat.py@@ -68,7 +68,6 @@ def test_configured_system_message(assert actual == expectedasync def test_configured_system_message_async(model_cfg_sys_msg: Llama2Chat,) -> None:diff --git a/libs/langchain/pyproject.toml b/libs/langchain/pyproject.tomlindex 5ba9b841bf..f43e45c6c1 100644--- a/libs/langchain/pyproject.toml+++ b/libs/langchain/pyproject.toml@@ -423,6 +423,7 @@ markers = ["scheduled: mark tests to run in scheduled testing","compile: mark placeholder test used to compile integration tests without running them"]+asyncio_mode = "auto"[tool.codespell]skip = '.git,*.pdf,*.svg,*.pdf,*.yaml,*.ipynb,poetry.lock,*.min.js,*.css,package-lock.json,example_data,_dist,examples'diff --git a/libs/langchain/tests/integration_tests/adapters/test_openai.py b/libs/langchain/tests/integration_tests/adapters/test_openai.pyindex 594770742c..b9279e8952 100644--- a/libs/langchain/tests/integration_tests/adapters/test_openai.py+++ b/libs/langchain/tests/integration_tests/adapters/test_openai.py@@ -1,7 +1,5 @@from typing import Any-import pytest-from langchain.adapters import openai as lcopenai@@ -83,7 +81,6 @@ async def _test_module(**kwargs: Any) -> None:await _test_astream(stream=True, **kwargs)async def test_normal_call() -> None:await _test_module(messages=[{"role": "user", "content": "hi"}],@@ -92,7 +89,6 @@ async def test_normal_call() -> None:)async def test_function_calling() -> None:await _test_module(messages=[{"role": "user", "content": "whats the weather in boston"}],@@ -102,7 +98,6 @@ async def test_function_calling() -> None:)async def test_answer_with_function_calling() -> None:await _test_module(messages=[diff --git a/libs/langchain/tests/integration_tests/callbacks/test_langchain_tracer.py b/libs/langchain/tests/integration_tests/callbacks/test_langchain_tracer.pyindex 4a26ff733d..8605e8419e 100644--- a/libs/langchain/tests/integration_tests/callbacks/test_langchain_tracer.py+++ b/libs/langchain/tests/integration_tests/callbacks/test_langchain_tracer.py@@ -2,7 +2,6 @@import asyncioimport os-import pytestfrom aiohttp import ClientSessionfrom langchain_core.prompts import PromptTemplate@@ -66,7 +65,6 @@ def test_tracing_session_env_var() -> None:del os.environ["LANGCHAIN_SESSION"]async def test_tracing_concurrent() -> None:os.environ["LANGCHAIN_TRACING"] = "true"aiosession = ClientSession()@@ -80,7 +78,6 @@ async def test_tracing_concurrent() -> None:await aiosession.close()async def test_tracing_concurrent_bw_compat_environ() -> None:os.environ["LANGCHAIN_HANDLER"] = "langchain"if "LANGCHAIN_TRACING" in os.environ:@@ -113,7 +110,6 @@ def test_tracing_context_manager() -> None:agent.run(questions[0]) # this should not be tracedasync def test_tracing_context_manager_async() -> None:llm = OpenAI(temperature=0)async_tools = load_tools(["llm-math", "serpapi"], llm=llm)@@ -133,7 +129,6 @@ async def test_tracing_context_manager_async() -> None:await taskasync def test_tracing_v2_environment_variable() -> None:os.environ["LANGCHAIN_TRACING_V2"] = "true"@@ -196,7 +191,6 @@ def test_tracing_v2_agent_with_metadata() -> None:chat_agent.run(questions[0], tags=["a-tag"], metadata={"a": "b", "c": "d"})async def test_tracing_v2_async_agent_with_metadata() -> None:os.environ["LANGCHAIN_TRACING_V2"] = "true"llm = OpenAI(temperature=0, metadata={"f": "g", "h": "i"})@@ -256,7 +250,6 @@ def test_trace_as_group_with_env_set() -> None:group_manager.on_chain_end({"output": final_res})async def test_trace_as_group_async() -> None:llm = OpenAI(temperature=0.9)prompt = PromptTemplate(diff --git a/libs/langchain/tests/integration_tests/callbacks/test_openai_callback.py b/libs/langchain/tests/integration_tests/callbacks/test_openai_callback.pyindex e32dbaa047..e2bef107b4 100644--- a/libs/langchain/tests/integration_tests/callbacks/test_openai_callback.py+++ b/libs/langchain/tests/integration_tests/callbacks/test_openai_callback.py@@ -1,14 +1,11 @@"""Integration tests for the langchain tracer module."""import asyncio-import pytest-from langchain.agents import AgentType, initialize_agent, load_toolsfrom langchain.callbacks import get_openai_callbackfrom langchain.llms import OpenAIasync def test_openai_callback() -> None:llm = OpenAI(temperature=0)with get_openai_callback() as cb:diff --git a/libs/langchain/tests/integration_tests/callbacks/test_wandb_tracer.py b/libs/langchain/tests/integration_tests/callbacks/test_wandb_tracer.pyindex 248d877e48..ec5a5791f2 100644--- a/libs/langchain/tests/integration_tests/callbacks/test_wandb_tracer.py+++ b/libs/langchain/tests/integration_tests/callbacks/test_wandb_tracer.py@@ -2,7 +2,6 @@import asyncioimport os-import pytestfrom aiohttp import ClientSessionfrom langchain.agents import AgentType, initialize_agent, load_tools@@ -60,7 +59,6 @@ def test_tracing_session_env_var() -> None:agent.run(questions[0])async def test_tracing_concurrent() -> None:os.environ["LANGCHAIN_WANDB_TRACING"] = "true"aiosession = ClientSession()@@ -95,7 +93,6 @@ def test_tracing_context_manager() -> None:agent.run(questions[0]) # this should not be tracedasync def test_tracing_context_manager_async() -> None:llm = OpenAI(temperature=0)async_tools = load_tools(diff --git a/libs/langchain/tests/integration_tests/chat_models/test_anthropic.py b/libs/langchain/tests/integration_tests/chat_models/test_anthropic.pyindex 96f70e67d0..ef632e8b19 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_anthropic.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_anthropic.py@@ -66,7 +66,6 @@ def test_anthropic_streaming_callback() -> None:@pytest.mark.scheduledasync def test_anthropic_async_streaming_callback() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/chat_models/test_azure_openai.py b/libs/langchain/tests/integration_tests/chat_models/test_azure_openai.pyindex 8f5565483c..6af1d4606c 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_azure_openai.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_azure_openai.py@@ -122,7 +122,6 @@ def test_chat_openai_streaming_generation_info() -> None:@pytest.mark.scheduledasync def test_async_chat_openai() -> None:"""Test async generation."""chat = _get_llm(max_tokens=10, n=2)@@ -139,7 +138,6 @@ async def test_async_chat_openai() -> None:@pytest.mark.scheduledasync def test_async_chat_openai_streaming() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()@@ -173,7 +171,6 @@ def test_openai_streaming(llm: AzureChatOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_astream(llm: AzureChatOpenAI) -> None:"""Test streaming tokens from OpenAI."""async for token in llm.astream("I'm Pickle Rick"):@@ -181,7 +178,6 @@ async def test_openai_astream(llm: AzureChatOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_abatch(llm: AzureChatOpenAI) -> None:"""Test streaming tokens from AzureChatOpenAI."""@@ -191,7 +187,6 @@ async def test_openai_abatch(llm: AzureChatOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_abatch_tags(llm: AzureChatOpenAI) -> None:"""Test batch tokens from AzureChatOpenAI."""@@ -212,7 +207,6 @@ def test_openai_batch(llm: AzureChatOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_ainvoke(llm: AzureChatOpenAI) -> None:"""Test invoke tokens from AzureChatOpenAI."""diff --git a/libs/langchain/tests/integration_tests/chat_models/test_bedrock.py b/libs/langchain/tests/integration_tests/chat_models/test_bedrock.pyindex e85fb3815f..2b53ceaa33 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_bedrock.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_bedrock.py@@ -92,7 +92,6 @@ def test_bedrock_streaming(chat: BedrockChat) -> None:@pytest.mark.scheduledasync def test_bedrock_astream(chat: BedrockChat) -> None:"""Test streaming tokens from OpenAI."""@@ -101,7 +100,6 @@ async def test_bedrock_astream(chat: BedrockChat) -> None:@pytest.mark.scheduledasync def test_bedrock_abatch(chat: BedrockChat) -> None:"""Test streaming tokens from BedrockChat."""result = await chat.abatch(["I'm Pickle Rick", "I'm not Pickle Rick"])@@ -110,7 +108,6 @@ async def test_bedrock_abatch(chat: BedrockChat) -> None:@pytest.mark.scheduledasync def test_bedrock_abatch_tags(chat: BedrockChat) -> None:"""Test batch tokens from BedrockChat."""result = await chat.abatch(@@ -129,7 +126,6 @@ def test_bedrock_batch(chat: BedrockChat) -> None:@pytest.mark.scheduledasync def test_bedrock_ainvoke(chat: BedrockChat) -> None:"""Test invoke tokens from BedrockChat."""result = await chat.ainvoke("I'm Pickle Rick", config={"tags": ["foo"]})diff --git a/libs/langchain/tests/integration_tests/chat_models/test_fireworks.py b/libs/langchain/tests/integration_tests/chat_models/test_fireworks.pyindex b8d96f004a..55b1149958 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_fireworks.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_fireworks.py@@ -90,7 +90,6 @@ def test_fireworks_invoke(chat: ChatFireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_ainvoke(chat: ChatFireworks) -> None:"""Tests chat completion with invoke"""result = await chat.ainvoke("How is the weather in New York today?", stop=[","])@@ -119,7 +118,6 @@ def test_fireworks_batch(chat: ChatFireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_abatch(chat: ChatFireworks) -> None:"""Test batch tokens from ChatFireworks."""result = await chat.abatch(@@ -159,7 +157,6 @@ def test_fireworks_streaming_stop_words(chat: ChatFireworks) -> None:@pytest.mark.scheduledasync def test_chat_fireworks_agenerate() -> None:"""Test ChatFireworks wrapper with generate."""chat = ChatFireworks(model_kwargs={"n": 2})@@ -176,7 +173,6 @@ async def test_chat_fireworks_agenerate() -> None:@pytest.mark.scheduledasync def test_fireworks_astream(chat: ChatFireworks) -> None:"""Test streaming tokens from Fireworks."""diff --git a/libs/langchain/tests/integration_tests/chat_models/test_google_palm.py b/libs/langchain/tests/integration_tests/chat_models/test_google_palm.pyindex efb4320bc2..25a0151b35 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_google_palm.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_google_palm.py@@ -4,7 +4,6 @@ Note: This test must be run with the GOOGLE_API_KEY environment variable set tovalid API key."""-import pytestfrom langchain_core.schema import (ChatGeneration,ChatResult,@@ -63,7 +62,6 @@ def test_chat_google_palm_multiple_completions() -> None:assert isinstance(generation.message.content, str)async def test_async_chat_google_palm() -> None:"""Test async generation."""chat = ChatGooglePalm(n=2, temperature=1.0)diff --git a/libs/langchain/tests/integration_tests/chat_models/test_jinachat.py b/libs/langchain/tests/integration_tests/chat_models/test_jinachat.pyindex fee3b53cad..f2d9c7cae5 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_jinachat.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_jinachat.py@@ -66,7 +66,6 @@ def test_jinachat_streaming() -> None:assert isinstance(response, BaseMessage)async def test_async_jinachat() -> None:"""Test async generation."""chat = JinaChat(max_tokens=102)@@ -82,7 +81,6 @@ async def test_async_jinachat() -> None:assert generation.text == generation.message.contentasync def test_async_jinachat_streaming() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/chat_models/test_openai.py b/libs/langchain/tests/integration_tests/chat_models/test_openai.pyindex 47c9a8e2d5..a036c717c0 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_openai.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_openai.py@@ -169,7 +169,6 @@ def test_chat_openai_invalid_streaming_params() -> None:@pytest.mark.scheduledasync def test_async_chat_openai() -> None:"""Test async generation."""chat = ChatOpenAI(max_tokens=10, n=2)@@ -188,7 +187,6 @@ async def test_async_chat_openai() -> None:@pytest.mark.scheduledasync def test_async_chat_openai_streaming() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()@@ -214,7 +212,6 @@ async def test_async_chat_openai_streaming() -> None:@pytest.mark.scheduledasync def test_async_chat_openai_streaming_with_function() -> None:"""Test ChatOpenAI wrapper with multiple completions."""@@ -316,7 +313,6 @@ async def test_async_chat_openai_streaming_with_function() -> None:@pytest.mark.scheduledasync def test_async_chat_openai_bind_functions() -> None:"""Test ChatOpenAI wrapper with multiple completions."""@@ -389,7 +385,6 @@ def test_openai_streaming() -> None:@pytest.mark.scheduledasync def test_openai_astream() -> None:"""Test streaming tokens from OpenAI."""llm = ChatOpenAI(max_tokens=10)@@ -399,7 +394,6 @@ async def test_openai_astream() -> None:@pytest.mark.scheduledasync def test_openai_abatch() -> None:"""Test streaming tokens from ChatOpenAI."""llm = ChatOpenAI(max_tokens=10)@@ -410,7 +404,6 @@ async def test_openai_abatch() -> None:@pytest.mark.scheduledasync def test_openai_abatch_tags() -> None:"""Test batch tokens from ChatOpenAI."""llm = ChatOpenAI(max_tokens=10)@@ -433,7 +426,6 @@ def test_openai_batch() -> None:@pytest.mark.scheduledasync def test_openai_ainvoke() -> None:"""Test invoke tokens from ChatOpenAI."""llm = ChatOpenAI(max_tokens=10)diff --git a/libs/langchain/tests/integration_tests/chat_models/test_promptlayer_openai.py b/libs/langchain/tests/integration_tests/chat_models/test_promptlayer_openai.pyindex 6e31148263..f993c6a22f 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_promptlayer_openai.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_promptlayer_openai.py@@ -87,7 +87,6 @@ def test_promptlayer_chat_openai_invalid_streaming_params() -> None:)async def test_async_promptlayer_chat_openai() -> None:"""Test async generation."""chat = PromptLayerChatOpenAI(max_tokens=10, n=2)@@ -103,7 +102,6 @@ async def test_async_promptlayer_chat_openai() -> None:assert generation.text == generation.message.contentasync def test_async_promptlayer_chat_openai_streaming() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/chat_models/test_vertexai.py b/libs/langchain/tests/integration_tests/chat_models/test_vertexai.pyindex 351e3a9f4d..cc91d52267 100644--- a/libs/langchain/tests/integration_tests/chat_models/test_vertexai.py+++ b/libs/langchain/tests/integration_tests/chat_models/test_vertexai.py@@ -51,7 +51,6 @@ def test_candidates() -> None:@pytest.mark.scheduledasync def test_vertexai_agenerate() -> None:model = ChatVertexAI(temperature=0)message = HumanMessage(content="Hello")diff --git a/libs/langchain/tests/integration_tests/document_loaders/test_recursive_url_loader.py b/libs/langchain/tests/integration_tests/document_loaders/test_recursive_url_loader.pyindex d1faf40d7f..bbfc558613 100644--- a/libs/langchain/tests/integration_tests/document_loaders/test_recursive_url_loader.py+++ b/libs/langchain/tests/integration_tests/document_loaders/test_recursive_url_loader.py@@ -1,9 +1,6 @@-import pytest as pytest-from langchain.document_loaders.recursive_url_loader import RecursiveUrlLoaderdef test_async_recursive_url_loader() -> None:url = "https://docs.python.org/3.9/"loader = RecursiveUrlLoader(@@ -19,7 +16,6 @@ def test_async_recursive_url_loader() -> None:assert docs[0].page_content == "placeholder"def test_async_recursive_url_loader_deterministic() -> None:url = "https://docs.python.org/3.9/"loader = RecursiveUrlLoader(@@ -43,7 +39,6 @@ def test_sync_recursive_url_loader() -> None:assert docs[0].page_content == "placeholder"def test_sync_async_equivalent() -> None:url = "https://docs.python.org/3.9/"loader = RecursiveUrlLoader(url, use_async=False, max_depth=2)diff --git a/libs/langchain/tests/integration_tests/document_loaders/test_url_playwright.py b/libs/langchain/tests/integration_tests/document_loaders/test_url_playwright.pyindex eb53682d75..22e0cac01a 100644--- a/libs/langchain/tests/integration_tests/document_loaders/test_url_playwright.py+++ b/libs/langchain/tests/integration_tests/document_loaders/test_url_playwright.py@@ -1,8 +1,6 @@"""Tests for the Playwright URL loader"""from typing import TYPE_CHECKING-import pytest-from langchain.document_loaders import PlaywrightURLLoaderfrom langchain.document_loaders.url_playwright import PlaywrightEvaluator@@ -43,7 +41,6 @@ def test_playwright_url_loader() -> None:assert len(docs) > 0async def test_playwright_async_url_loader() -> None:"""Test Playwright async URL loader."""urls = [@@ -76,7 +73,6 @@ def test_playwright_url_loader_with_custom_evaluator() -> None:assert docs[0].page_content == "test"async def test_playwright_async_url_loader_with_custom_evaluator() -> None:"""Test Playwright async URL loader with a custom evaluator."""urls = ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]diff --git a/libs/langchain/tests/integration_tests/embeddings/test_azure_openai.py b/libs/langchain/tests/integration_tests/embeddings/test_azure_openai.pyindex 2987ecba03..45f5b48d39 100644--- a/libs/langchain/tests/integration_tests/embeddings/test_azure_openai.py+++ b/libs/langchain/tests/integration_tests/embeddings/test_azure_openai.py@@ -49,7 +49,6 @@ def test_azure_openai_embedding_documents_chunk_size() -> None:assert all([len(out) == 1536 for out in output])async def test_azure_openai_embedding_documents_async_multiple() -> None:"""Test openai embeddings."""documents = ["foo bar", "bar foo", "foo"]@@ -70,7 +69,6 @@ def test_azure_openai_embedding_query() -> None:assert len(output) == 1536async def test_azure_openai_embedding_async_query() -> None:"""Test openai embeddings."""document = "foo bar"diff --git a/libs/langchain/tests/integration_tests/embeddings/test_fastembed.py b/libs/langchain/tests/integration_tests/embeddings/test_fastembed.pyindex 84e4ea67fe..d690037ab7 100644--- a/libs/langchain/tests/integration_tests/embeddings/test_fastembed.py+++ b/libs/langchain/tests/integration_tests/embeddings/test_fastembed.py@@ -38,7 +38,6 @@ def test_fastembed_embedding_query(model_name: str, max_length: int) -> None:assert len(output) == 384@pytest.mark.parametrize("model_name", ["sentence-transformers/all-MiniLM-L6-v2", "BAAI/bge-small-en-v1.5"])@@ -61,7 +60,6 @@ async def test_fastembed_async_embedding_documents(assert len(output[0]) == 384@pytest.mark.parametrize("model_name", ["sentence-transformers/all-MiniLM-L6-v2", "BAAI/bge-small-en-v1.5"])diff --git a/libs/langchain/tests/integration_tests/embeddings/test_openai.py b/libs/langchain/tests/integration_tests/embeddings/test_openai.pyindex 33dd46fa5a..8fab5789cc 100644--- a/libs/langchain/tests/integration_tests/embeddings/test_openai.py+++ b/libs/langchain/tests/integration_tests/embeddings/test_openai.py@@ -29,7 +29,6 @@ def test_openai_embedding_documents_multiple() -> None:@pytest.mark.scheduledasync def test_openai_embedding_documents_async_multiple() -> None:"""Test openai embeddings."""documents = ["foo bar", "bar foo", "foo"]@@ -52,7 +51,6 @@ def test_openai_embedding_query() -> None:@pytest.mark.scheduledasync def test_openai_embedding_async_query() -> None:"""Test openai embeddings."""document = "foo bar"diff --git a/libs/langchain/tests/integration_tests/llms/test_anthropic.py b/libs/langchain/tests/integration_tests/llms/test_anthropic.pyindex f95d35000c..95c82b900a 100644--- a/libs/langchain/tests/integration_tests/llms/test_anthropic.py+++ b/libs/langchain/tests/integration_tests/llms/test_anthropic.py@@ -52,7 +52,6 @@ def test_anthropic_streaming_callback() -> None:assert callback_handler.llm_streams > 1async def test_anthropic_async_generate() -> None:"""Test async generate."""llm = Anthropic()@@ -60,7 +59,6 @@ async def test_anthropic_async_generate() -> None:assert isinstance(output, LLMResult)async def test_anthropic_async_streaming_callback() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/llms/test_azure_openai.py b/libs/langchain/tests/integration_tests/llms/test_azure_openai.pyindex 3c66c1b36b..6aac97e483 100644--- a/libs/langchain/tests/integration_tests/llms/test_azure_openai.py+++ b/libs/langchain/tests/integration_tests/llms/test_azure_openai.py@@ -57,7 +57,6 @@ def test_openai_streaming(llm: AzureOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_astream(llm: AzureOpenAI) -> None:"""Test streaming tokens from AzureOpenAI."""async for token in llm.astream("I'm Pickle Rick"):@@ -65,7 +64,6 @@ async def test_openai_astream(llm: AzureOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_abatch(llm: AzureOpenAI) -> None:"""Test streaming tokens from AzureOpenAI."""result = await llm.abatch(["I'm Pickle Rick", "I'm not Pickle Rick"])@@ -73,7 +71,6 @@ async def test_openai_abatch(llm: AzureOpenAI) -> None:assert isinstance(token, str)async def test_openai_abatch_tags(llm: AzureOpenAI) -> None:"""Test streaming tokens from AzureOpenAI."""result = await llm.abatch(@@ -92,7 +89,6 @@ def test_openai_batch(llm: AzureOpenAI) -> None:@pytest.mark.scheduledasync def test_openai_ainvoke(llm: AzureOpenAI) -> None:"""Test streaming tokens from AzureOpenAI."""result = await llm.ainvoke("I'm Pickle Rick", config={"tags": ["foo"]})@@ -157,7 +153,6 @@ def test_openai_streaming_callback() -> None:@pytest.mark.scheduledasync def test_openai_async_generate() -> None:"""Test async generation."""llm = _get_llm(max_tokens=10)@@ -165,7 +160,6 @@ async def test_openai_async_generate() -> None:assert isinstance(output, LLMResult)async def test_openai_async_streaming_callback() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/llms/test_ctransformers.py b/libs/langchain/tests/integration_tests/llms/test_ctransformers.pyindex 2ed4c09131..dddc93009d 100644--- a/libs/langchain/tests/integration_tests/llms/test_ctransformers.py+++ b/libs/langchain/tests/integration_tests/llms/test_ctransformers.py@@ -1,5 +1,4 @@"""Test C Transformers wrapper."""-import pytestfrom langchain.llms import CTransformersfrom tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler@@ -22,7 +21,6 @@ def test_ctransformers_call() -> None:assert 0 < callback_handler.llm_streams <= config["max_new_tokens"]async def test_ctransformers_async_inference() -> None:config = {"max_new_tokens": 5}callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/llms/test_deepinfra.py b/libs/langchain/tests/integration_tests/llms/test_deepinfra.pyindex 4b3a303bc7..74f05da90a 100644--- a/libs/langchain/tests/integration_tests/llms/test_deepinfra.py+++ b/libs/langchain/tests/integration_tests/llms/test_deepinfra.py@@ -1,6 +1,4 @@"""Test DeepInfra API wrapper."""-import pytest-from langchain.llms.deepinfra import DeepInfra@@ -11,7 +9,6 @@ def test_deepinfra_call() -> None:assert isinstance(output, str)async def test_deepinfra_acall() -> None:llm = DeepInfra(model_id="meta-llama/Llama-2-7b-chat-hf")output = await llm.apredict("What is 2 + 2?")@@ -27,7 +24,6 @@ def test_deepinfra_stream() -> None:assert num_chunks > 0async def test_deepinfra_astream() -> None:llm = DeepInfra(model_id="meta-llama/Llama-2-7b-chat-hf")num_chunks = 0diff --git a/libs/langchain/tests/integration_tests/llms/test_fireworks.py b/libs/langchain/tests/integration_tests/llms/test_fireworks.pyindex 9abf445bf2..81bcfecfcb 100644--- a/libs/langchain/tests/integration_tests/llms/test_fireworks.py+++ b/libs/langchain/tests/integration_tests/llms/test_fireworks.py@@ -61,7 +61,6 @@ def test_fireworks_invoke(llm: Fireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_ainvoke(llm: Fireworks) -> None:"""Tests completion with invoke"""output = await llm.ainvoke("How is the weather in New York today?", stop=[","])@@ -89,7 +88,6 @@ def test_fireworks_batch(llm: Fireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_abatch(llm: Fireworks) -> None:"""Tests completion with invoke"""output = await llm.abatch(@@ -142,7 +140,6 @@ def test_fireworks_streaming_stop_words(llm: Fireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_streaming_async(llm: Fireworks) -> None:"""Test stream completion."""@@ -156,7 +153,6 @@ async def test_fireworks_streaming_async(llm: Fireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_async_agenerate(llm: Fireworks) -> None:"""Test async."""output = await llm.agenerate(["What is the best city to live in California?"])@@ -164,7 +160,6 @@ async def test_fireworks_async_agenerate(llm: Fireworks) -> None:@pytest.mark.scheduledasync def test_fireworks_multiple_prompts_async_agenerate(llm: Fireworks) -> None:output = await llm.agenerate(["How is the weather in New York today?", "I'm pickle rick"]diff --git a/libs/langchain/tests/integration_tests/llms/test_openai.py b/libs/langchain/tests/integration_tests/llms/test_openai.pyindex a0f2981620..588ea601ce 100644--- a/libs/langchain/tests/integration_tests/llms/test_openai.py+++ b/libs/langchain/tests/integration_tests/llms/test_openai.py@@ -100,7 +100,6 @@ def test_openai_streaming() -> None:@pytest.mark.scheduledasync def test_openai_astream() -> None:"""Test streaming tokens from OpenAI."""llm = OpenAI(max_tokens=10)@@ -110,7 +109,6 @@ async def test_openai_astream() -> None:@pytest.mark.scheduledasync def test_openai_abatch() -> None:"""Test streaming tokens from OpenAI."""llm = OpenAI(max_tokens=10)@@ -120,7 +118,6 @@ async def test_openai_abatch() -> None:assert isinstance(token, str)async def test_openai_abatch_tags() -> None:"""Test streaming tokens from OpenAI."""llm = OpenAI(max_tokens=10)@@ -143,7 +140,6 @@ def test_openai_batch() -> None:@pytest.mark.scheduledasync def test_openai_ainvoke() -> None:"""Test streaming tokens from OpenAI."""llm = OpenAI(max_tokens=10)@@ -213,7 +209,6 @@ def test_openai_streaming_callback() -> None:@pytest.mark.scheduledasync def test_openai_async_generate() -> None:"""Test async generation."""llm = OpenAI(max_tokens=10)@@ -221,7 +216,6 @@ async def test_openai_async_generate() -> None:assert isinstance(output, LLMResult)async def test_openai_async_streaming_callback() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()diff --git a/libs/langchain/tests/integration_tests/llms/test_qianfan_endpoint.py b/libs/langchain/tests/integration_tests/llms/test_qianfan_endpoint.pyindex 9c87dd95e5..e46a6342a0 100644--- a/libs/langchain/tests/integration_tests/llms/test_qianfan_endpoint.py+++ b/libs/langchain/tests/integration_tests/llms/test_qianfan_endpoint.py@@ -1,7 +1,6 @@"""Test Baidu Qianfan LLM Endpoint."""from typing import Generator-import pytestfrom langchain_core.schema import LLMResultfrom langchain.llms.baidu_qianfan_endpoint import QianfanLLMEndpoint@@ -29,7 +28,6 @@ def test_generate_stream() -> None:assert isinstance(output, Generator)async def test_qianfan_aio() -> None:llm = QianfanLLMEndpoint(streaming=True)diff --git a/libs/langchain/tests/integration_tests/llms/test_together.py b/libs/langchain/tests/integration_tests/llms/test_together.pyindex ca88c6c861..659ce9fff3 100644--- a/libs/langchain/tests/integration_tests/llms/test_together.py+++ b/libs/langchain/tests/integration_tests/llms/test_together.py@@ -24,7 +24,6 @@ def test_together_call() -> None:assert isinstance(output, str)async def test_together_acall() -> None:"""Test simple call to together."""llm = Together(diff --git a/libs/langchain/tests/integration_tests/llms/test_vertexai.py b/libs/langchain/tests/integration_tests/llms/test_vertexai.pyindex fdf55c9383..a89d299c0a 100644--- a/libs/langchain/tests/integration_tests/llms/test_vertexai.py+++ b/libs/langchain/tests/integration_tests/llms/test_vertexai.py@@ -49,7 +49,6 @@ def test_vertex_generate_code() -> None:@pytest.mark.scheduledasync def test_vertex_agenerate() -> None:llm = VertexAI(temperature=0)output = await llm.agenerate(["Please say foo:"])@@ -63,7 +62,6 @@ def test_vertex_stream() -> None:assert isinstance(outputs[0], str)async def test_vertex_consistency() -> None:llm = VertexAI(temperature=0)output = llm.generate(["Please say foo:"])@@ -103,7 +101,6 @@ def test_model_garden_generate() -> None:assert len(output.generations) == 2async def test_model_garden_agenerate() -> None:endpoint_id = os.environ["ENDPOINT_ID"]project = os.environ["PROJECT"]diff --git a/libs/langchain/tests/integration_tests/retrievers/test_azure_cognitive_search.py b/libs/langchain/tests/integration_tests/retrievers/test_azure_cognitive_search.pyindex 0c7af90ee4..84694415ff 100644--- a/libs/langchain/tests/integration_tests/retrievers/test_azure_cognitive_search.py+++ b/libs/langchain/tests/integration_tests/retrievers/test_azure_cognitive_search.py@@ -1,5 +1,4 @@"""Test Azure Cognitive Search wrapper."""-import pytestfrom langchain_core.schema import Documentfrom langchain.retrievers.azure_cognitive_search import AzureCognitiveSearchRetriever@@ -18,7 +17,6 @@ def test_azure_cognitive_search_get_relevant_documents() -> None:assert len(documents) <= 1async def test_azure_cognitive_search_aget_relevant_documents() -> None:"""Test valid async call to Azure Cognitive Search."""retriever = AzureCognitiveSearchRetriever()diff --git a/libs/langchain/tests/integration_tests/retrievers/test_zep.py b/libs/langchain/tests/integration_tests/retrievers/test_zep.pyindex f989c66951..1864799750 100644--- a/libs/langchain/tests/integration_tests/retrievers/test_zep.py+++ b/libs/langchain/tests/integration_tests/retrievers/test_zep.py@@ -83,7 +83,6 @@ def test_zep_retriever_get_relevant_documents(@pytest.mark.requires("zep_python")async def test_zep_retriever_aget_relevant_documents(zep_retriever: ZepRetriever, search_results: List[MemorySearchResult]) -> None:diff --git a/libs/langchain/tests/integration_tests/smith/evaluation/test_runner_utils.py b/libs/langchain/tests/integration_tests/smith/evaluation/test_runner_utils.pyindex 231828d3aa..6cd52ef15e 100644--- a/libs/langchain/tests/integration_tests/smith/evaluation/test_runner_utils.py+++ b/libs/langchain/tests/integration_tests/smith/evaluation/test_runner_utils.py@@ -460,7 +460,6 @@ def test_chain_on_kv_singleio_dataset(_check_all_feedback_passed(eval_project_name, client)async def test_runnable_on_kv_singleio_dataset(kv_singleio_dataset_name: str, eval_project_name: str, client: Client) -> None:@@ -480,7 +479,6 @@ async def test_runnable_on_kv_singleio_dataset(_check_all_feedback_passed(eval_project_name, client)async def test_arb_func_on_kv_singleio_dataset(kv_singleio_dataset_name: str, eval_project_name: str, client: Client) -> None:diff --git a/libs/langchain/tests/integration_tests/test_nuclia_transformer.py b/libs/langchain/tests/integration_tests/test_nuclia_transformer.pyindex 6e803ac6bc..a82390a59a 100644--- a/libs/langchain/tests/integration_tests/test_nuclia_transformer.py+++ b/libs/langchain/tests/integration_tests/test_nuclia_transformer.py@@ -3,7 +3,6 @@ import jsonfrom typing import Anyfrom unittest import mock-import pytestfrom langchain_core.schema.document import Documentfrom langchain.document_transformers.nuclia_text_transform import NucliaTextTransformer@@ -33,7 +32,6 @@ def fakerun(**args: Any) -> Any:return runasync def test_nuclia_loader() -> None:with mock.patch("langchain.tools.nuclia.tool.NucliaUnderstandingAPI._arun", new_callable=fakerundiff --git a/libs/langchain/tests/integration_tests/tools/nuclia/test_nuclia.py b/libs/langchain/tests/integration_tests/tools/nuclia/test_nuclia.pyindex fddcf368ff..aed1a26e2e 100644--- a/libs/langchain/tests/integration_tests/tools/nuclia/test_nuclia.py+++ b/libs/langchain/tests/integration_tests/tools/nuclia/test_nuclia.py@@ -88,7 +88,6 @@ def test_nuclia_tool() -> None:assert json.loads(data)["uuid"] == "fake_uuid"@pytest.mark.requires("nucliadb_protos")async def test_async_call() -> None:with mock.patch(diff --git a/libs/langchain/tests/integration_tests/utilities/test_dataforseo_api.py b/libs/langchain/tests/integration_tests/utilities/test_dataforseo_api.pyindex 8a6a140bc8..65636b06a6 100644--- a/libs/langchain/tests/integration_tests/utilities/test_dataforseo_api.py+++ b/libs/langchain/tests/integration_tests/utilities/test_dataforseo_api.py@@ -1,6 +1,4 @@"""Integration test for Dataforseo API Wrapper."""-import pytest-from langchain.utilities.dataforseo_api_search import DataForSeoAPIWrapper@@ -44,14 +42,12 @@ def test_events_call() -> None:)async def test_async_call() -> None:search = DataForSeoAPIWrapper()output = await search.arun("pi value")assert "3.14159" in outputasync def test_async_results() -> None:search = DataForSeoAPIWrapper(json_result_types=["answer_box"])output = await search.aresults("New York timezone")diff --git a/libs/langchain/tests/integration_tests/utilities/test_googleserper_api.py b/libs/langchain/tests/integration_tests/utilities/test_googleserper_api.pyindex 2fe4a5b7a7..7b02fce3e4 100644--- a/libs/langchain/tests/integration_tests/utilities/test_googleserper_api.py+++ b/libs/langchain/tests/integration_tests/utilities/test_googleserper_api.py@@ -1,6 +1,4 @@"""Integration test for Serper.dev's Google Search API Wrapper."""-import pytest-from langchain.utilities.google_serper import GoogleSerperAPIWrapper@@ -25,7 +23,6 @@ async def test_results() -> None:assert "Barack Hussein Obama II" in output["answerBox"]["answer"]async def test_async_call() -> None:"""Test that call gives the correct answer."""search = GoogleSerperAPIWrapper()@@ -33,7 +30,6 @@ async def test_async_call() -> None:assert "Barack Hussein Obama II" in outputasync def test_async_results() -> None:"""Test that call gives the correct answer."""search = GoogleSerperAPIWrapper()diff --git a/libs/langchain/tests/integration_tests/utilities/test_searchapi.py b/libs/langchain/tests/integration_tests/utilities/test_searchapi.pyindex 510e4fdcdb..141c2ca361 100644--- a/libs/langchain/tests/integration_tests/utilities/test_searchapi.py+++ b/libs/langchain/tests/integration_tests/utilities/test_searchapi.py@@ -1,6 +1,4 @@"""Integration tests for SearchApi"""-import pytest-from langchain.utilities.searchapi import SearchApiAPIWrapper@@ -48,7 +46,6 @@ def test_jobs_call() -> None:assert "years of experience" in outputasync def test_async_call() -> None:"""Test that call gives the correct answer."""search = SearchApiAPIWrapper()@@ -56,7 +53,6 @@ async def test_async_call() -> None:assert "Barack Hussein Obama II" in outputasync def test_async_results() -> None:"""Test that call gives the correct answer."""search = SearchApiAPIWrapper()diff --git a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.py b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.pyindex b1689e836a..7a4865bae1 100644--- a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.py+++ b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.py@@ -12,7 +12,6 @@ from tests.integration_tests.vectorstores.qdrant.async_api.fixtures import ( #)@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_aadd_texts_returns_all_ids(@@ -31,7 +30,6 @@ async def test_qdrant_aadd_texts_returns_all_ids(assert 3 == len(set(ids))@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_aadd_texts_stores_duplicated_texts(@@ -60,7 +58,6 @@ async def test_qdrant_aadd_texts_stores_duplicated_texts(assert 2 == client.count(collection_name).count@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_aadd_texts_stores_ids(@@ -93,7 +90,6 @@ async def test_qdrant_aadd_texts_stores_ids(assert set(ids) == set(stored_ids)@pytest.mark.parametrize("vector_name", ["custom-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_aadd_texts_stores_embeddings_as_named_vectors(diff --git a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.py b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.pyindex 3cfe7825ed..f3c27d27bf 100644--- a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.py+++ b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.py@@ -15,7 +15,6 @@ from tests.integration_tests.vectorstores.qdrant.async_api.fixtures import (from tests.integration_tests.vectorstores.qdrant.common import qdrant_is_not_running@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_from_texts_stores_duplicated_texts(qdrant_location: str) -> None:"""Test end to end Qdrant.afrom_texts stores duplicated texts separately."""@@ -32,7 +31,6 @@ async def test_qdrant_from_texts_stores_duplicated_texts(qdrant_location: str) -assert 2 == client.count(collection_name).count@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())@@ -61,7 +59,6 @@ async def test_qdrant_from_texts_stores_ids(assert set(ids) == set(stored_ids)@pytest.mark.parametrize("vector_name", ["custom-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_from_texts_stores_embeddings_as_named_vectors(@@ -87,7 +84,6 @@ async def test_qdrant_from_texts_stores_embeddings_as_named_vectors()@pytest.mark.parametrize("vector_name", [None, "custom-vector"])@pytest.mark.skipif(qdrant_is_not_running(), reason="Qdrant is not running")async def test_qdrant_from_texts_reuses_same_collection(@@ -115,7 +111,6 @@ async def test_qdrant_from_texts_reuses_same_collection(assert 7 == client.count(collection_name).count@pytest.mark.parametrize("vector_name", [None, "custom-vector"])@pytest.mark.skipif(qdrant_is_not_running(), reason="Qdrant is not running")async def test_qdrant_from_texts_raises_error_on_different_dimensionality(@@ -141,7 +136,6 @@ async def test_qdrant_from_texts_raises_error_on_different_dimensionality()@pytest.mark.parametrize(["first_vector_name", "second_vector_name"],[@@ -174,7 +168,6 @@ async def test_qdrant_from_texts_raises_error_on_different_vector_name()@pytest.mark.skipif(qdrant_is_not_running(), reason="Qdrant is not running")async def test_qdrant_from_texts_raises_error_on_different_distance() -> None:"""Test if Qdrant.afrom_texts raises an exception if distance does not match"""@@ -196,7 +189,6 @@ async def test_qdrant_from_texts_raises_error_on_different_distance() -> None:)@pytest.mark.parametrize("vector_name", [None, "custom-vector"])@pytest.mark.skipif(qdrant_is_not_running(), reason="Qdrant is not running")async def test_qdrant_from_texts_recreates_collection_on_force_recreate(@@ -230,7 +222,6 @@ async def test_qdrant_from_texts_recreates_collection_on_force_recreate(assert 5 == vector_params.size # type: ignore[union-attr]@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("content_payload_key", [Qdrant.CONTENT_KEY, "foo"])@pytest.mark.parametrize("metadata_payload_key", [Qdrant.METADATA_KEY, "bar"])diff --git a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_max_marginal_relevance.py b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_max_marginal_relevance.pyindex d46e71f54e..22683b1ee1 100644--- a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_max_marginal_relevance.py+++ b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_max_marginal_relevance.py@@ -12,7 +12,6 @@ from tests.integration_tests.vectorstores.qdrant.async_api.fixtures import ()@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("content_payload_key", [Qdrant.CONTENT_KEY, "test_content"])@pytest.mark.parametrize("metadata_payload_key", [Qdrant.METADATA_KEY, "test_metadata"])diff --git a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_similarity_search.py b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_similarity_search.pyindex 13dd23d9b7..cfdf98aa45 100644--- a/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_similarity_search.py+++ b/libs/langchain/tests/integration_tests/vectorstores/qdrant/async_api/test_similarity_search.py@@ -13,7 +13,6 @@ from tests.integration_tests.vectorstores.qdrant.async_api.fixtures import ()@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("content_payload_key", [Qdrant.CONTENT_KEY, "foo"])@pytest.mark.parametrize("metadata_payload_key", [Qdrant.METADATA_KEY, "bar"])@@ -41,7 +40,6 @@ async def test_qdrant_similarity_search(assert output == [Document(page_content="foo")]@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("content_payload_key", [Qdrant.CONTENT_KEY, "foo"])@pytest.mark.parametrize("metadata_payload_key", [Qdrant.METADATA_KEY, "bar"])@@ -70,7 +68,6 @@ async def test_qdrant_similarity_search_by_vector(assert output == [Document(page_content="foo")]@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("content_payload_key", [Qdrant.CONTENT_KEY, "foo"])@pytest.mark.parametrize("metadata_payload_key", [Qdrant.METADATA_KEY, "bar"])@@ -102,7 +99,6 @@ async def test_qdrant_similarity_search_with_score_by_vector(assert score >= 0@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())@@ -135,7 +131,6 @@ async def test_qdrant_similarity_search_filters(]@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_similarity_search_with_relevance_score_no_threshold(@@ -164,7 +159,6 @@ async def test_qdrant_similarity_search_with_relevance_score_no_threshold(assert round(output[i][1], 2) <= 1@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_similarity_search_with_relevance_score_with_threshold(@@ -194,7 +188,6 @@ async def test_qdrant_similarity_search_with_relevance_score_with_threshold(assert all([score >= score_threshold for _, score in output])@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_similarity_search_with_relevance_score_with_threshold_and_filter(@@ -230,7 +223,6 @@ async def test_similarity_search_with_relevance_score_with_threshold_and_filter(assert all([score >= score_threshold for _, score in output])@pytest.mark.parametrize("vector_name", [None, "my-vector"])@pytest.mark.parametrize("qdrant_location", qdrant_locations())async def test_qdrant_similarity_search_filters_with_qdrant_filters(@@ -278,7 +270,6 @@ async def test_qdrant_similarity_search_filters_with_qdrant_filters(]@pytest.mark.parametrize("batch_size", [1, 64])@pytest.mark.parametrize("content_payload_key", [Qdrant.CONTENT_KEY, "foo"])@pytest.mark.parametrize("metadata_payload_key", [Qdrant.METADATA_KEY, "bar"])diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_chroma.py b/libs/langchain/tests/integration_tests/vectorstores/test_chroma.pyindex b9af9fcfe1..abaa03adbe 100644--- a/libs/langchain/tests/integration_tests/vectorstores/test_chroma.py+++ b/libs/langchain/tests/integration_tests/vectorstores/test_chroma.py@@ -23,7 +23,6 @@ def test_chroma() -> None:assert output == [Document(page_content="foo")]async def test_chroma_async() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_clickhouse.py b/libs/langchain/tests/integration_tests/vectorstores/test_clickhouse.pyindex c8ccc7e5a8..00e08dfd1b 100644--- a/libs/langchain/tests/integration_tests/vectorstores/test_clickhouse.py+++ b/libs/langchain/tests/integration_tests/vectorstores/test_clickhouse.py@@ -1,6 +1,4 @@"""Test ClickHouse functionality."""-import pytest-from langchain.docstore.document import Documentfrom langchain.vectorstores import Clickhouse, ClickhouseSettingsfrom tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings@@ -17,7 +15,6 @@ def test_clickhouse() -> None:docsearch.drop()async def test_clickhouse_async() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_elasticsearch.py b/libs/langchain/tests/integration_tests/vectorstores/test_elasticsearch.pyindex 3c597a827c..80d5fb7eb6 100644--- a/libs/langchain/tests/integration_tests/vectorstores/test_elasticsearch.py+++ b/libs/langchain/tests/integration_tests/vectorstores/test_elasticsearch.py@@ -157,7 +157,6 @@ class TestElasticsearch:output = docsearch.similarity_search("foo", k=1, custom_query=assert_query)assert output == [Document(page_content="foo")]- @pytest.mark.asyncioasync def test_similarity_search_without_metadat_async(self, elasticsearch_connection: dict, index_name: str) -> None:diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_myscale.py b/libs/langchain/tests/integration_tests/vectorstores/test_myscale.pyindex 0ed7274246..ea1b39e923 100644--- a/libs/langchain/tests/integration_tests/vectorstores/test_myscale.py+++ b/libs/langchain/tests/integration_tests/vectorstores/test_myscale.py@@ -1,6 +1,4 @@"""Test MyScale functionality."""-import pytest-from langchain.docstore.document import Documentfrom langchain.vectorstores import MyScale, MyScaleSettingsfrom tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings@@ -17,7 +15,6 @@ def test_myscale() -> None:docsearch.drop()async def test_myscale_async() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_timescalevector.py b/libs/langchain/tests/integration_tests/vectorstores/test_timescalevector.pyindex 639adc1375..cc7eae6c0c 100644--- a/libs/langchain/tests/integration_tests/vectorstores/test_timescalevector.py+++ b/libs/langchain/tests/integration_tests/vectorstores/test_timescalevector.py@@ -3,8 +3,6 @@ import osfrom datetime import datetime, timedeltafrom typing import List-import pytest-from langchain.docstore.document import Documentfrom langchain.vectorstores.timescalevector import TimescaleVectorfrom tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings@@ -64,7 +62,6 @@ def test_timescalevector_from_documents() -> None:assert output == [Document(page_content="foo", metadata={"a": "b"})]async def test_timescalevector_afrom_documents() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]@@ -96,7 +93,6 @@ def test_timescalevector_embeddings() -> None:assert output == [Document(page_content="foo")]async def test_timescalevector_aembeddings() -> None:"""Test end to end construction with embeddings and search."""texts = ["foo", "bar", "baz"]@@ -145,7 +141,6 @@ def test_timescalevector_with_metadatas_with_scores() -> None:assert output == [(Document(page_content="foo", metadata={"page": "0"}), 0.0)]async def test_timescalevector_awith_metadatas_with_scores() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]@@ -254,7 +249,6 @@ def test_timescalevector_relevance_score() -> None:]async def test_timescalevector_relevance_score_async() -> None:"""Test to make sure the relevance score is scaled to 0-1."""texts = ["foo", "bar", "baz"]diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_zep.py b/libs/langchain/tests/integration_tests/vectorstores/test_zep.pyindex 7db7f72f1f..10266370fb 100644--- a/libs/langchain/tests/integration_tests/vectorstores/test_zep.py+++ b/libs/langchain/tests/integration_tests/vectorstores/test_zep.py@@ -191,7 +191,6 @@ def test_add_documents(@pytest.mark.requires("zep_python")async def test_asearch_similarity(zep_vectorstore: ZepVectorStore,) -> None:@@ -205,7 +204,6 @@ async def test_asearch_similarity(@pytest.mark.requires("zep_python")async def test_asearch_mmr(zep_vectorstore: ZepVectorStore,) -> None:diff --git a/libs/langchain/tests/unit_tests/agents/test_agent_iterator.py b/libs/langchain/tests/unit_tests/agents/test_agent_iterator.pyindex 6861d67618..dd63f03732 100644--- a/libs/langchain/tests/unit_tests/agents/test_agent_iterator.py+++ b/libs/langchain/tests/unit_tests/agents/test_agent_iterator.py@@ -57,7 +57,6 @@ def test_agent_iterator_stopped_early() -> None:)async def test_agent_async_iterator_stopped_early() -> None:"""Test react chain async iterator when max iterations or@@ -151,7 +150,6 @@ def test_agent_iterator_with_callbacks() -> None:)async def test_agent_async_iterator_with_callbacks() -> None:"""Test react chain async iterator with callbacks by setting verbose globally."""handler1 = FakeCallbackHandler()@@ -281,7 +279,6 @@ def test_agent_iterator_output_structure() -> None:assert False, "Unexpected output structure"async def test_agent_async_iterator_output_structure() -> None:"""Test the async output structure of AgentExecutorIterator."""agent = _get_agent()diff --git a/libs/langchain/tests/unit_tests/callbacks/test_callback_manager.py b/libs/langchain/tests/unit_tests/callbacks/test_callback_manager.pyindex 5d8ce135b1..e21c8e5723 100644--- a/libs/langchain/tests/unit_tests/callbacks/test_callback_manager.py+++ b/libs/langchain/tests/unit_tests/callbacks/test_callback_manager.py@@ -111,7 +111,6 @@ def test_callback_manager_with_async() -> None:_test_callback_manager(manager, handler1, handler2, handler3, handler4)async def test_callback_manager_with_async_with_running_loop() -> None:"""Test the CallbackManager."""handler1 = FakeCallbackHandler()@@ -187,7 +186,6 @@ def test_ignore_retriever() -> None:assert handler2.errors == 1async def test_async_callback_manager() -> None:"""Test the AsyncCallbackManager."""handler1 = FakeAsyncCallbackHandler()@@ -196,7 +194,6 @@ async def test_async_callback_manager() -> None:await _test_callback_manager_async(manager, handler1, handler2)async def test_async_callback_manager_sync_handler() -> None:"""Test the AsyncCallbackManager."""handler1 = FakeCallbackHandler()diff --git a/libs/langchain/tests/unit_tests/chains/test_sequential.py b/libs/langchain/tests/unit_tests/chains/test_sequential.pyindex 861f013f5f..36aafc2266 100644--- a/libs/langchain/tests/unit_tests/chains/test_sequential.py+++ b/libs/langchain/tests/unit_tests/chains/test_sequential.py@@ -180,7 +180,6 @@ def test_simple_sequential_functionality() -> None:assert output == expected_output@pytest.mark.parametrize("isAsync", [False, True])async def test_simple_sequential_functionality_with_callbacks(isAsync: bool) -> None:"""Test simple sequential functionality."""diff --git a/libs/langchain/tests/unit_tests/document_loaders/test_mongodb.py b/libs/langchain/tests/unit_tests/document_loaders/test_mongodb.pyindex c6b380596d..802c49893d 100644--- a/libs/langchain/tests/unit_tests/document_loaders/test_mongodb.py+++ b/libs/langchain/tests/unit_tests/document_loaders/test_mongodb.py@@ -30,7 +30,6 @@ def expected_documents() -> List[Document]:@pytest.mark.requires("motor")async def test_load_mocked(expected_documents: List[Document]) -> None:mock_async_load = AsyncMock()mock_async_load.return_value = expected_documentsdiff --git a/libs/langchain/tests/unit_tests/evaluation/string_distance/test_base.py b/libs/langchain/tests/unit_tests/evaluation/string_distance/test_base.pyindex 70dc7aaa78..8e49f1f7d0 100644--- a/libs/langchain/tests/unit_tests/evaluation/string_distance/test_base.py+++ b/libs/langchain/tests/unit_tests/evaluation/string_distance/test_base.py@@ -17,7 +17,6 @@ def test_zero_distance(distance: StringDistance) -> None:assert result["score"] == 0@pytest.mark.requires("rapidfuzz")@pytest.mark.parametrize("distance", list(StringDistance))async def test_zero_distance_async(distance: StringDistance) -> None:@@ -43,7 +42,6 @@ def test_zero_distance_pairwise(assert result["score"] == 0@pytest.mark.requires("rapidfuzz")@pytest.mark.parametrize("distance", list(StringDistance))async def test_zero_distance_pairwise_async(distance: StringDistance) -> None:@@ -77,7 +75,6 @@ def test_non_zero_distance(distance: StringDistance, normalize_score: bool) -> Nassert result["score"] < 1.0@pytest.mark.requires("rapidfuzz")@pytest.mark.parametrize("distance", valid_distances)async def test_non_zero_distance_async(distance: StringDistance) -> None:@@ -104,7 +101,6 @@ def test_non_zero_distance_pairwise(distance: StringDistance) -> None:assert 0 < result["score"] < 1.0@pytest.mark.requires("rapidfuzz")@pytest.mark.parametrize("distance", valid_distances)async def test_non_zero_distance_pairwise_async(distance: StringDistance) -> None:diff --git a/libs/langchain/tests/unit_tests/indexes/test_indexing.py b/libs/langchain/tests/unit_tests/indexes/test_indexing.pyindex ac36b8a4f3..1082927e79 100644--- a/libs/langchain/tests/unit_tests/indexes/test_indexing.py+++ b/libs/langchain/tests/unit_tests/indexes/test_indexing.py@@ -208,7 +208,6 @@ def test_indexing_same_content(}@pytest.mark.requires("aiosqlite")async def test_aindexing_same_content(arecord_manager: SQLRecordManager, vector_store: InMemoryVectorStore@@ -321,7 +320,6 @@ def test_index_simple_delete_full(}@pytest.mark.requires("aiosqlite")async def test_aindex_simple_delete_full(arecord_manager: SQLRecordManager, vector_store: InMemoryVectorStore@@ -442,7 +440,6 @@ def test_incremental_fails_with_bad_source_ids()@pytest.mark.requires("aiosqlite")async def test_aincremental_fails_with_bad_source_ids(arecord_manager: SQLRecordManager, vector_store: InMemoryVectorStore@@ -566,7 +563,6 @@ def test_no_delete(}@pytest.mark.requires("aiosqlite")async def test_ano_delete(arecord_manager: SQLRecordManager, vector_store: InMemoryVectorStore@@ -753,7 +749,6 @@ def test_incremental_delete(}@pytest.mark.requires("aiosqlite")async def test_aincremental_delete(arecord_manager: SQLRecordManager, vector_store: InMemoryVectorStore@@ -873,7 +868,6 @@ def test_indexing_with_no_docs(}@pytest.mark.requires("aiosqlite")async def test_aindexing_with_no_docs(arecord_manager: SQLRecordManager, vector_store: VectorStore@@ -915,7 +909,6 @@ def test_deduplication(}@pytest.mark.requires("aiosqlite")async def test_adeduplication(arecord_manager: SQLRecordManager, vector_store: VectorStore@@ -978,7 +971,6 @@ def test_cleanup_with_different_batchsize(}@pytest.mark.requires("aiosqlite")async def test_async_cleanup_with_different_batchsize(arecord_manager: SQLRecordManager, vector_store: InMemoryVectorStore@@ -1061,7 +1053,6 @@ async def _to_async_iter(it: Iterable[Any]) -> AsyncIterator[Any]:yield iasync def test_abatch() -> None:"""Test the abatch function."""batches = _abatch(5, _to_async_iter(range(12)))diff --git a/libs/langchain/tests/unit_tests/indexes/test_sql_record_manager.py b/libs/langchain/tests/unit_tests/indexes/test_sql_record_manager.pyindex 966ad8b0e5..44f564cc00 100644--- a/libs/langchain/tests/unit_tests/indexes/test_sql_record_manager.py+++ b/libs/langchain/tests/unit_tests/indexes/test_sql_record_manager.py@@ -44,7 +44,6 @@ def test_update(manager: SQLRecordManager) -> None:assert read_keys == ["key1", "key2", "key3"]@pytest.mark.requires("aiosqlite")async def test_aupdate(amanager: SQLRecordManager) -> None:"""Test updating records in the database."""@@ -150,7 +149,6 @@ def test_update_timestamp(manager: SQLRecordManager) -> None:]@pytest.mark.requires("aiosqlite")async def test_aupdate_timestamp(amanager: SQLRecordManager) -> None:"""Test updating records in the database."""@@ -274,7 +272,6 @@ def test_update_with_group_ids(manager: SQLRecordManager) -> None:assert read_keys == ["key1", "key2", "key3"]@pytest.mark.requires("aiosqlite")async def test_aupdate_with_group_ids(amanager: SQLRecordManager) -> None:"""Test updating records in the database."""@@ -304,7 +301,6 @@ def test_exists(manager: SQLRecordManager) -> None:assert exists == [True, False]@pytest.mark.requires("aiosqlite")async def test_aexists(amanager: SQLRecordManager) -> None:"""Test checking if keys exist in the database."""@@ -408,7 +404,6 @@ def test_list_keys(manager: SQLRecordManager) -> None:) == ["key4"]@pytest.mark.requires("aiosqlite")async def test_alist_keys(amanager: SQLRecordManager) -> None:"""Test listing keys based on the provided date range."""@@ -527,7 +522,6 @@ def test_namespace_is_used(manager: SQLRecordManager) -> None:]@pytest.mark.requires("aiosqlite")async def test_anamespace_is_used(amanager: SQLRecordManager) -> None:"""Verify that namespace is taken into account for all operations."""@@ -571,7 +565,6 @@ def test_delete_keys(manager: SQLRecordManager) -> None:assert remaining_keys == ["key3"]@pytest.mark.requires("aiosqlite")async def test_adelete_keys(amanager: SQLRecordManager) -> None:"""Test deleting keys from the database."""diff --git a/libs/langchain/tests/unit_tests/llms/test_base.py b/libs/langchain/tests/unit_tests/llms/test_base.pyindex cf8f15d28b..2d5f0a8809 100644--- a/libs/langchain/tests/unit_tests/llms/test_base.py+++ b/libs/langchain/tests/unit_tests/llms/test_base.py@@ -6,7 +6,6 @@ try:except ImportError:from sqlalchemy.ext.declarative import declarative_base-import pytestfrom langchain_core.schema import Generation, LLMResultfrom langchain.cache import InMemoryCache, SQLAlchemyCache@@ -86,7 +85,6 @@ def test_batch() -> None:assert output == ["foo"] * 3async def test_abatch() -> None:llm = FakeLLM()output = await llm.abatch(["foo", "bar", "foo"])diff --git a/libs/langchain/tests/unit_tests/llms/test_openai.py b/libs/langchain/tests/unit_tests/llms/test_openai.pyindex eaaba45020..ad9279daf8 100644--- a/libs/langchain/tests/unit_tests/llms/test_openai.py+++ b/libs/langchain/tests/unit_tests/llms/test_openai.py@@ -115,7 +115,6 @@ def test_openai_retries(mock_completion: dict) -> None:_openai_v1_installed(), reason="Retries only handled by LangChain for openai<1")@pytest.mark.requires("openai")async def test_openai_async_retries(mock_completion: dict) -> None:llm = OpenAI()mock_client = MagicMock()diff --git a/libs/langchain/tests/unit_tests/output_parsers/test_json.py b/libs/langchain/tests/unit_tests/output_parsers/test_json.pyindex c7b4792e06..d9bae651b6 100644--- a/libs/langchain/tests/unit_tests/output_parsers/test_json.py+++ b/libs/langchain/tests/unit_tests/output_parsers/test_json.py@@ -494,7 +494,6 @@ def test_partial_functions_json_output_parser_diff() -> None:assert list(chain.stream(None)) == EXPECTED_STREAMED_JSON_DIFFasync def test_partial_text_json_output_parser_async() -> None:async def input_iter(_: Any) -> AsyncIterator[str]:for token in STREAMED_TOKENS:@@ -505,7 +504,6 @@ async def test_partial_text_json_output_parser_async() -> None:assert [p async for p in chain.astream(None)] == EXPECTED_STREAMED_JSONasync def test_partial_functions_json_output_parser_async() -> None:async def input_iter(_: Any) -> AsyncIterator[AIMessageChunk]:for token in STREAMED_TOKENS:@@ -518,7 +516,6 @@ async def test_partial_functions_json_output_parser_async() -> None:assert [p async for p in chain.astream(None)] == EXPECTED_STREAMED_JSONasync def test_partial_text_json_output_parser_diff_async() -> None:async def input_iter(_: Any) -> AsyncIterator[str]:for token in STREAMED_TOKENS:@@ -529,7 +526,6 @@ async def test_partial_text_json_output_parser_diff_async() -> None:assert [p async for p in chain.astream(None)] == EXPECTED_STREAMED_JSON_DIFFasync def test_partial_functions_json_output_parser_diff_async() -> None:async def input_iter(_: Any) -> AsyncIterator[AIMessageChunk]:for token in STREAMED_TOKENS:diff --git a/libs/langchain/tests/unit_tests/retrievers/self_query/test_base.py b/libs/langchain/tests/unit_tests/retrievers/self_query/test_base.pyindex b0eea6dfdf..8797b6a4c9 100644--- a/libs/langchain/tests/unit_tests/retrievers/self_query/test_base.py+++ b/libs/langchain/tests/unit_tests/retrievers/self_query/test_base.py@@ -130,7 +130,6 @@ def test__get_relevant_documents(fake_self_query_retriever: SelfQueryRetriever)assert relevant_documents[0].metadata["foo"] == "bar"async def test__aget_relevant_documents(fake_self_query_retriever: SelfQueryRetriever,) -> None:diff --git a/libs/langchain/tests/unit_tests/retrievers/test_base.py b/libs/langchain/tests/unit_tests/retrievers/test_base.pyindex 90b83c12d5..f543a0d368 100644--- a/libs/langchain/tests/unit_tests/retrievers/test_base.py+++ b/libs/langchain/tests/unit_tests/retrievers/test_base.py@@ -59,7 +59,6 @@ def test_fake_retriever_v1_upgrade(fake_retriever_v1: BaseRetriever) -> None:assert callbacks.retriever_errors == 0async def test_fake_retriever_v1_upgrade_async(fake_retriever_v1: BaseRetriever,) -> None:@@ -122,7 +121,6 @@ def test_fake_retriever_v1_with_kwargs_upgrade(assert callbacks.retriever_errors == 0async def test_fake_retriever_v1_with_kwargs_upgrade_async(fake_retriever_v1_with_kwargs: BaseRetriever,) -> None:@@ -202,7 +200,6 @@ def test_fake_retriever_v2(assert callbacks.retriever_errors == 1async def test_fake_retriever_v2_async(fake_retriever_v2: BaseRetriever, fake_erroring_retriever_v2: BaseRetriever) -> None:diff --git a/libs/langchain/tests/unit_tests/smith/evaluation/test_runner_utils.py b/libs/langchain/tests/unit_tests/smith/evaluation/test_runner_utils.pyindex 061cf0e740..89ee06a7a9 100644--- a/libs/langchain/tests/unit_tests/smith/evaluation/test_runner_utils.py+++ b/libs/langchain/tests/unit_tests/smith/evaluation/test_runner_utils.py@@ -239,7 +239,6 @@ def test_run_chat_model_all_formats(inputs: Dict[str, Any]) -> None:_run_llm(llm, inputs, mock.MagicMock())@freeze_time("2023-01-01")async def test_arun_on_dataset(monkeypatch: pytest.MonkeyPatch) -> None:dataset = Dataset(diff --git a/libs/langchain/tests/unit_tests/tools/shell/test_shell.py b/libs/langchain/tests/unit_tests/tools/shell/test_shell.pyindex 3d41907b14..78b01d4e32 100644--- a/libs/langchain/tests/unit_tests/tools/shell/test_shell.py+++ b/libs/langchain/tests/unit_tests/tools/shell/test_shell.py@@ -1,8 +1,6 @@import warningsfrom typing import List-import pytest-from langchain.tools.shell.tool import ShellInput, ShellTool# Test data@@ -55,7 +53,6 @@ def test_shell_tool_run() -> None:assert result.strip() == "hello"async def test_shell_tool_arun() -> None:placeholder = PlaceholderProcess(output="hello")shell_tool = ShellTool(process=placeholder)diff --git a/libs/langchain/tests/unit_tests/tools/test_zapier.py b/libs/langchain/tests/unit_tests/tools/test_zapier.pyindex a078cb7a1e..fbe5c7c225 100644--- a/libs/langchain/tests/unit_tests/tools/test_zapier.py+++ b/libs/langchain/tests/unit_tests/tools/test_zapier.py@@ -133,7 +133,6 @@ def test_create_action_payload_with_params() -> None:assert payload["test"] == "test"async def test_apreview(mocker) -> None: # type: ignore[no-untyped-def]"""Test that the action payload with params is being created correctly."""tool = ZapierNLARunAction(@@ -162,7 +161,6 @@ async def test_apreview(mocker) -> None: # type: ignore[no-untyped-def])async def test_arun(mocker) -> None: # type: ignore[no-untyped-def]"""Test that the action payload with params is being created correctly."""tool = ZapierNLARunAction(@@ -187,7 +185,6 @@ async def test_arun(mocker) -> None: # type: ignore[no-untyped-def])async def test_alist(mocker) -> None: # type: ignore[no-untyped-def]"""Test that the action payload with params is being created correctly."""tool = ZapierNLARunAction(diff --git a/libs/langchain/tests/unit_tests/vectorstores/test_faiss.py b/libs/langchain/tests/unit_tests/vectorstores/test_faiss.pyindex 592db0c3c5..df57289448 100644--- a/libs/langchain/tests/unit_tests/vectorstores/test_faiss.py+++ b/libs/langchain/tests/unit_tests/vectorstores/test_faiss.py@@ -31,7 +31,6 @@ def test_faiss() -> None:@pytest.mark.requires("faiss")async def test_faiss_afrom_texts() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]@@ -69,7 +68,6 @@ def test_faiss_vector_sim() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_vector_sim() -> None:"""Test vector similarity."""texts = ["foo", "bar", "baz"]@@ -108,7 +106,6 @@ def test_faiss_vector_sim_with_score_threshold() -> None:@pytest.mark.requires("faiss")async def test_faiss_vector_async_sim_with_score_threshold() -> None:"""Test vector similarity."""texts = ["foo", "bar", "baz"]@@ -150,7 +147,6 @@ def test_similarity_search_with_score_by_vector() -> None:@pytest.mark.requires("faiss")async def test_similarity_async_search_with_score_by_vector() -> None:"""Test vector similarity with score by vector."""texts = ["foo", "bar", "baz"]@@ -196,7 +192,6 @@ def test_similarity_search_with_score_by_vector_with_score_threshold() -> None:@pytest.mark.requires("faiss")async def test_sim_asearch_with_score_by_vector_with_score_threshold() -> None:"""Test vector similarity with score by vector."""texts = ["foo", "bar", "baz"]@@ -237,7 +232,6 @@ def test_faiss_mmr() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_mmr() -> None:texts = ["foo", "foo", "fou", "foy"]docsearch = await FAISS.afrom_texts(texts, FakeEmbeddings())@@ -268,7 +262,6 @@ def test_faiss_mmr_with_metadatas() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_mmr_with_metadatas() -> None:texts = ["foo", "foo", "fou", "foy"]metadatas = [{"page": i} for i in range(len(texts))]@@ -298,7 +291,6 @@ def test_faiss_mmr_with_metadatas_and_filter() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_mmr_with_metadatas_and_filter() -> None:texts = ["foo", "foo", "fou", "foy"]metadatas = [{"page": i} for i in range(len(texts))]@@ -328,7 +320,6 @@ def test_faiss_mmr_with_metadatas_and_list_filter() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_mmr_with_metadatas_and_list_filter() -> None:texts = ["foo", "foo", "fou", "foy"]metadatas = [{"page": i} if i <= 3 else {"page": 3} for i in range(len(texts))]@@ -368,7 +359,6 @@ def test_faiss_with_metadatas() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_with_metadatas() -> None:"""Test end to end construction and search."""texts = ["foo", "bar", "baz"]@@ -416,7 +406,6 @@ def test_faiss_with_metadatas_and_filter() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_with_metadatas_and_filter() -> None:texts = ["foo", "bar", "baz"]metadatas = [{"page": i} for i in range(len(texts))]@@ -469,7 +458,6 @@ def test_faiss_with_metadatas_and_list_filter() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_with_metadatas_and_list_filter() -> None:texts = ["foo", "bar", "baz", "foo", "qux"]metadatas = [{"page": i} if i <= 3 else {"page": 3} for i in range(len(texts))]@@ -510,7 +498,6 @@ def test_faiss_search_not_found() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_search_not_found() -> None:"""Test what happens when document is not found."""texts = ["foo", "bar", "baz"]@@ -534,7 +521,6 @@ def test_faiss_add_texts() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_add_texts() -> None:"""Test end to end adding of texts."""# Create initial doc store.@@ -555,7 +541,6 @@ def test_faiss_add_texts_not_supported() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_add_texts_not_supported() -> None:"""Test adding of texts to a docstore that doesn't support it."""docsearch = FAISS(FakeEmbeddings(), None, FakeDocstore(), {})@@ -576,7 +561,6 @@ def test_faiss_local_save_load() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_local_save_load() -> None:"""Test end to end serialization."""texts = ["foo", "bar", "baz"]@@ -604,7 +588,6 @@ def test_faiss_similarity_search_with_relevance_scores() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_similarity_search_with_relevance_scores() -> None:"""Test the similarity search with normalized similarities."""texts = ["foo", "bar", "baz"]@@ -638,7 +621,6 @@ def test_faiss_similarity_search_with_relevance_scores_with_threshold() -> None:@pytest.mark.requires("faiss")async def test_faiss_asimilarity_search_with_relevance_scores_with_threshold() -> None:"""Test the similarity search with normalized similarities with score threshold."""texts = ["foo", "bar", "baz"]@@ -668,7 +650,6 @@ def test_faiss_invalid_normalize_fn() -> None:@pytest.mark.requires("faiss")async def test_faiss_async_invalid_normalize_fn() -> None:"""Test the similarity search with normalized similarities."""texts = ["foo", "bar", "baz"]@@ -689,7 +670,6 @@ def test_missing_normalize_score_fn() -> None:@pytest.mark.requires("faiss")async def test_async_missing_normalize_score_fn() -> None:"""Test doesn't perform similarity search without a valid distance strategy."""texts = ["foo", "bar", "baz"]@@ -713,7 +693,6 @@ def test_delete() -> None:@pytest.mark.requires("faiss")async def test_async_delete() -> None:"""Test the similarity search with normalized similarities."""ids = ["a", "b", "c"]