The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
langchain: Add ruff rule RUF (#31874)
Christophe Bornetba144c9d7f9f
diff --git a/libs/langchain/langchain/__init__.py b/libs/langchain/langchain/__init__.pyindex 0628b251a6..63de57ef4c 100644--- a/libs/langchain/langchain/__init__.py+++ b/libs/langchain/langchain/__init__.py@@ -1,4 +1,3 @@-# ruff: noqa: E402"""Main entrypoint into package."""import warnings@@ -391,50 +390,50 @@ def __getattr__(name: str) -> Any:__all__ = [- "LLMChain",- "LLMCheckerChain",- "LLMMathChain",- "ArxivAPIWrapper",- "GoldenQueryAPIWrapper",- "SelfAskWithSearchChain",- "SerpAPIWrapper",- "SerpAPIChain",- "SearxSearchWrapper",- "GoogleSearchAPIWrapper",- "GoogleSerperAPIWrapper",- "WolframAlphaAPIWrapper",- "WikipediaAPIWrapper",+ "FAISS","Anthropic",+ "ArxivAPIWrapper","Banana",+ "BasePromptTemplate","CerebriumAI","Cohere",+ "ConversationChain",+ "ElasticVectorSearch",+ "FewShotPromptTemplate","ForefrontAI",+ "GoldenQueryAPIWrapper",+ "GoogleSearchAPIWrapper",+ "GoogleSerperAPIWrapper","GooseAI",+ "HuggingFaceHub",+ "HuggingFacePipeline",+ "HuggingFaceTextGenInference",+ "InMemoryDocstore",+ "LLMChain",+ "LLMCheckerChain",+ "LLMMathChain",+ "LlamaCpp",+ "MRKLChain","Modal","OpenAI","Petals","PipelineAI",- "StochasticAI",- "Writer",- "BasePromptTemplate",+ "PowerBIDataset","Prompt",- "FewShotPromptTemplate","PromptTemplate",+ "QAWithSourcesChain","ReActChain",- "Wikipedia",- "HuggingFaceHub",- "SagemakerEndpoint",- "HuggingFacePipeline","SQLDatabase",- "PowerBIDataset",- "FAISS",- "MRKLChain",+ "SagemakerEndpoint",+ "SearxSearchWrapper",+ "SelfAskWithSearchChain",+ "SerpAPIChain",+ "SerpAPIWrapper",+ "StochasticAI","VectorDBQA",- "ElasticVectorSearch",- "InMemoryDocstore",- "ConversationChain","VectorDBQAWithSourcesChain",- "QAWithSourcesChain",- "LlamaCpp",- "HuggingFaceTextGenInference",+ "Wikipedia",+ "WikipediaAPIWrapper",+ "WolframAlphaAPIWrapper",+ "Writer",]diff --git a/libs/langchain/langchain/_api/__init__.py b/libs/langchain/langchain/_api/__init__.pyindex 1f746db82a..c80cf8c663 100644--- a/libs/langchain/langchain/_api/__init__.py+++ b/libs/langchain/langchain/_api/__init__.py@@ -19,10 +19,10 @@ from .deprecation import (from .module_import import create_importer__all__ = [- "deprecated","LangChainDeprecationWarning",+ "create_importer",+ "deprecated","suppress_langchain_deprecation_warning","surface_langchain_deprecation_warnings","warn_deprecated",- "create_importer",]diff --git a/libs/langchain/langchain/_api/deprecation.py b/libs/langchain/langchain/_api/deprecation.pyindex 6d5f2cf689..634e21944d 100644--- a/libs/langchain/langchain/_api/deprecation.py+++ b/libs/langchain/langchain/_api/deprecation.py@@ -15,9 +15,9 @@ AGENT_DEPRECATION_WARNING = ("details, refer to the ""`LangGraph documentation <https://langchain-ai.github.io/langgraph/>`_"" as well as guides for "- "`Migrating from AgentExecutor <https://python.langchain.com/docs/how_to/migrate_agent/>`_" # noqa: E501+ "`Migrating from AgentExecutor <https://python.langchain.com/docs/how_to/migrate_agent/>`_"" and LangGraph's "- "`Pre-built ReAct agent <https://langchain-ai.github.io/langgraph/how-tos/create-react-agent/>`_." # noqa: E501+ "`Pre-built ReAct agent <https://langchain-ai.github.io/langgraph/how-tos/create-react-agent/>`_.")@@ -27,6 +27,6 @@ __all__ = ["LangChainPendingDeprecationWarning","deprecated","suppress_langchain_deprecation_warning",- "warn_deprecated","surface_langchain_deprecation_warnings",+ "warn_deprecated",]diff --git a/libs/langchain/langchain/_api/path.py b/libs/langchain/langchain/_api/path.pyindex 5ee0fe817d..d542686269 100644--- a/libs/langchain/langchain/_api/path.py+++ b/libs/langchain/langchain/_api/path.py@@ -1,3 +1,3 @@from langchain_core._api.path import as_import_path, get_relative_path-__all__ = ["get_relative_path", "as_import_path"]+__all__ = ["as_import_path", "get_relative_path"]diff --git a/libs/langchain/langchain/adapters/openai.py b/libs/langchain/langchain/adapters/openai.pyindex 445eccd56b..79684273b4 100644--- a/libs/langchain/langchain/adapters/openai.py+++ b/libs/langchain/langchain/adapters/openai.py@@ -47,17 +47,17 @@ def __getattr__(name: str) -> Any:__all__ = [- "IndexableBaseModel",- "Choice",+ "Chat",+ "ChatCompletion",+ "ChatCompletionChunk","ChatCompletions",+ "Choice","ChoiceChunk",- "ChatCompletionChunk",+ "Completions",+ "IndexableBaseModel",+ "chat","convert_dict_to_message","convert_message_to_dict",- "convert_openai_messages",- "ChatCompletion","convert_messages_for_finetuning",- "Completions",- "Chat",- "chat",+ "convert_openai_messages",]diff --git a/libs/langchain/langchain/agents/__init__.py b/libs/langchain/langchain/agents/__init__.pyindex 7e99899d38..7353322652 100644--- a/libs/langchain/langchain/agents/__init__.py+++ b/libs/langchain/langchain/agents/__init__.py@@ -154,29 +154,29 @@ __all__ = ["ReActTextWorldAgent","SelfAskWithSearchChain","StructuredChatAgent",+ "Tool",+ "XMLAgent","ZeroShotAgent","create_json_agent",+ "create_json_chat_agent",+ "create_openai_functions_agent",+ "create_openai_tools_agent","create_openapi_agent","create_pbi_agent","create_pbi_chat_agent",+ "create_react_agent",+ "create_self_ask_with_search_agent","create_spark_sql_agent","create_sql_agent",+ "create_structured_chat_agent",+ "create_tool_calling_agent","create_vectorstore_agent","create_vectorstore_router_agent",+ "create_xml_agent","get_all_tool_names","initialize_agent","load_agent","load_huggingface_tool","load_tools",- "XMLAgent",- "create_openai_functions_agent",- "create_xml_agent",- "create_react_agent",- "create_openai_tools_agent",- "create_self_ask_with_search_agent",- "create_json_chat_agent",- "create_structured_chat_agent",- "create_tool_calling_agent",- "Tool","tool",]diff --git a/libs/langchain/langchain/agents/agent.py b/libs/langchain/langchain/agents/agent.pyindex d0fa9d376a..f860d40361 100644--- a/libs/langchain/langchain/agents/agent.py+++ b/libs/langchain/langchain/agents/agent.py@@ -1241,7 +1241,7 @@ class AgentExecutor(Chain)::meta private:"""if self.return_intermediate_steps:- return self._action_agent.return_values + ["intermediate_steps"]+ return [*self._action_agent.return_values, "intermediate_steps"]return self._action_agent.return_valuesdef lookup_tool(self, name: str) -> BaseTool:@@ -1349,7 +1349,7 @@ class AgentExecutor(Chain):"An output parsing error occurred. ""In order to pass this error back to the agent and have it try ""again, pass `handle_parsing_errors=True` to the AgentExecutor. "- f"This is the error: {str(e)}"+ f"This is the error: {e!s}")raise ValueError(msg)text = str(e)@@ -1485,7 +1485,7 @@ class AgentExecutor(Chain):"An output parsing error occurred. ""In order to pass this error back to the agent and have it try ""again, pass `handle_parsing_errors=True` to the AgentExecutor. "- f"This is the error: {str(e)}"+ f"This is the error: {e!s}")raise ValueError(msg)text = str(e)diff --git a/libs/langchain/langchain/agents/agent_toolkits/__init__.py b/libs/langchain/langchain/agents/agent_toolkits/__init__.pyindex 3c8d3062ac..e05174caad 100644--- a/libs/langchain/langchain/agents/agent_toolkits/__init__.py+++ b/libs/langchain/langchain/agents/agent_toolkits/__init__.py@@ -140,28 +140,28 @@ __all__ = ["JiraToolkit","JsonToolkit","MultionToolkit",- "NasaToolkit","NLAToolkit",+ "NasaToolkit","O365Toolkit","OpenAPIToolkit","PlayWrightBrowserToolkit","PowerBIToolkit",- "SlackToolkit",- "SteamToolkit","SQLDatabaseToolkit",+ "SlackToolkit","SparkSQLToolkit",+ "SteamToolkit","VectorStoreInfo","VectorStoreRouterToolkit","VectorStoreToolkit","ZapierToolkit",+ "create_conversational_retrieval_agent","create_json_agent","create_openapi_agent","create_pbi_agent","create_pbi_chat_agent",+ "create_retriever_tool","create_spark_sql_agent","create_sql_agent","create_vectorstore_agent","create_vectorstore_router_agent",- "create_conversational_retrieval_agent",- "create_retriever_tool",]diff --git a/libs/langchain/langchain/agents/agent_toolkits/github/toolkit.py b/libs/langchain/langchain/agents/agent_toolkits/github/toolkit.pyindex c5ce5db62d..148525725d 100644--- a/libs/langchain/langchain/agents/agent_toolkits/github/toolkit.py+++ b/libs/langchain/langchain/agents/agent_toolkits/github/toolkit.py@@ -51,19 +51,19 @@ def __getattr__(name: str) -> Any:__all__ = [- "NoInput",- "GetIssue",+ "BranchName","CommentOnIssue",- "GetPR",- "CreatePR","CreateFile",- "ReadFile",- "UpdateFile",+ "CreatePR",+ "CreateReviewRequest","DeleteFile","DirectoryPath",- "BranchName",+ "GetIssue",+ "GetPR",+ "GitHubToolkit",+ "NoInput",+ "ReadFile","SearchCode",- "CreateReviewRequest","SearchIssuesAndPRs",- "GitHubToolkit",+ "UpdateFile",]diff --git a/libs/langchain/langchain/agents/agent_toolkits/openapi/planner.py b/libs/langchain/langchain/agents/agent_toolkits/openapi/planner.pyindex ad276207c0..b9e27ded26 100644--- a/libs/langchain/langchain/agents/agent_toolkits/openapi/planner.py+++ b/libs/langchain/langchain/agents/agent_toolkits/openapi/planner.py@@ -43,10 +43,10 @@ def __getattr__(name: str) -> Any:__all__ = [+ "RequestsDeleteToolWithParsing","RequestsGetToolWithParsing",- "RequestsPostToolWithParsing","RequestsPatchToolWithParsing",+ "RequestsPostToolWithParsing","RequestsPutToolWithParsing",- "RequestsDeleteToolWithParsing","create_openapi_agent",]diff --git a/libs/langchain/langchain/agents/agent_toolkits/openapi/planner_prompt.py b/libs/langchain/langchain/agents/agent_toolkits/openapi/planner_prompt.pyindex 6ab49fc66c..27f64f184b 100644--- a/libs/langchain/langchain/agents/agent_toolkits/openapi/planner_prompt.py+++ b/libs/langchain/langchain/agents/agent_toolkits/openapi/planner_prompt.py@@ -83,21 +83,21 @@ def __getattr__(name: str) -> Any:__all__ = [- "API_PLANNER_PROMPT",- "API_PLANNER_TOOL_NAME",- "API_PLANNER_TOOL_DESCRIPTION","API_CONTROLLER_PROMPT",- "API_CONTROLLER_TOOL_NAME","API_CONTROLLER_TOOL_DESCRIPTION",+ "API_CONTROLLER_TOOL_NAME","API_ORCHESTRATOR_PROMPT",- "REQUESTS_GET_TOOL_DESCRIPTION",+ "API_PLANNER_PROMPT",+ "API_PLANNER_TOOL_DESCRIPTION",+ "API_PLANNER_TOOL_NAME",+ "PARSING_DELETE_PROMPT","PARSING_GET_PROMPT",- "REQUESTS_POST_TOOL_DESCRIPTION",- "PARSING_POST_PROMPT",- "REQUESTS_PATCH_TOOL_DESCRIPTION","PARSING_PATCH_PROMPT",- "REQUESTS_PUT_TOOL_DESCRIPTION",+ "PARSING_POST_PROMPT","PARSING_PUT_PROMPT","REQUESTS_DELETE_TOOL_DESCRIPTION",- "PARSING_DELETE_PROMPT",+ "REQUESTS_GET_TOOL_DESCRIPTION",+ "REQUESTS_PATCH_TOOL_DESCRIPTION",+ "REQUESTS_POST_TOOL_DESCRIPTION",+ "REQUESTS_PUT_TOOL_DESCRIPTION",]diff --git a/libs/langchain/langchain/agents/agent_toolkits/openapi/prompt.py b/libs/langchain/langchain/agents/agent_toolkits/openapi/prompt.pyindex 7f124bad0d..1f30bd4bbc 100644--- a/libs/langchain/langchain/agents/agent_toolkits/openapi/prompt.py+++ b/libs/langchain/langchain/agents/agent_toolkits/openapi/prompt.py@@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:return _import_attribute(name)-__all__ = ["OPENAPI_PREFIX", "OPENAPI_SUFFIX", "DESCRIPTION"]+__all__ = ["DESCRIPTION", "OPENAPI_PREFIX", "OPENAPI_SUFFIX"]diff --git a/libs/langchain/langchain/agents/agent_toolkits/openapi/toolkit.py b/libs/langchain/langchain/agents/agent_toolkits/openapi/toolkit.pyindex bb20794b8e..106c908fda 100644--- a/libs/langchain/langchain/agents/agent_toolkits/openapi/toolkit.py+++ b/libs/langchain/langchain/agents/agent_toolkits/openapi/toolkit.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "RequestsToolkit","OpenAPIToolkit",+ "RequestsToolkit",]diff --git a/libs/langchain/langchain/agents/agent_toolkits/powerbi/prompt.py b/libs/langchain/langchain/agents/agent_toolkits/powerbi/prompt.pyindex 325dbe0861..386f9cac0c 100644--- a/libs/langchain/langchain/agents/agent_toolkits/powerbi/prompt.py+++ b/libs/langchain/langchain/agents/agent_toolkits/powerbi/prompt.py@@ -29,8 +29,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "POWERBI_PREFIX",- "POWERBI_SUFFIX","POWERBI_CHAT_PREFIX","POWERBI_CHAT_SUFFIX",+ "POWERBI_PREFIX",+ "POWERBI_SUFFIX",]diff --git a/libs/langchain/langchain/agents/agent_toolkits/sql/prompt.py b/libs/langchain/langchain/agents/agent_toolkits/sql/prompt.pyindex e06162b62b..86ab8b6d5e 100644--- a/libs/langchain/langchain/agents/agent_toolkits/sql/prompt.py+++ b/libs/langchain/langchain/agents/agent_toolkits/sql/prompt.py@@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:return _import_attribute(name)-__all__ = ["SQL_PREFIX", "SQL_SUFFIX", "SQL_FUNCTIONS_SUFFIX"]+__all__ = ["SQL_FUNCTIONS_SUFFIX", "SQL_PREFIX", "SQL_SUFFIX"]diff --git a/libs/langchain/langchain/agents/format_scratchpad/__init__.py b/libs/langchain/langchain/agents/format_scratchpad/__init__.pyindex c34745e55b..39fc083d57 100644--- a/libs/langchain/langchain/agents/format_scratchpad/__init__.py+++ b/libs/langchain/langchain/agents/format_scratchpad/__init__.py@@ -16,10 +16,10 @@ from langchain.agents.format_scratchpad.tools import format_to_tool_messagesfrom langchain.agents.format_scratchpad.xml import format_xml__all__ = [- "format_xml",+ "format_log_to_messages",+ "format_log_to_str","format_to_openai_function_messages","format_to_openai_functions","format_to_tool_messages",- "format_log_to_str",- "format_log_to_messages",+ "format_xml",]diff --git a/libs/langchain/langchain/agents/format_scratchpad/openai_functions.py b/libs/langchain/langchain/agents/format_scratchpad/openai_functions.pyindex ee08a8f8a2..3055cc0554 100644--- a/libs/langchain/langchain/agents/format_scratchpad/openai_functions.py+++ b/libs/langchain/langchain/agents/format_scratchpad/openai_functions.py@@ -20,8 +20,9 @@ def _convert_agent_action_to_messages(the original tool invocation"""if isinstance(agent_action, AgentActionMessageLog):- return list(agent_action.message_log) + [- _create_function_message(agent_action, observation)+ return [+ *list(agent_action.message_log),+ _create_function_message(agent_action, observation),]return [AIMessage(content=agent_action.log)]diff --git a/libs/langchain/langchain/agents/format_scratchpad/tools.py b/libs/langchain/langchain/agents/format_scratchpad/tools.pyindex 3c43ff4e0a..422bafdf60 100644--- a/libs/langchain/langchain/agents/format_scratchpad/tools.py+++ b/libs/langchain/langchain/agents/format_scratchpad/tools.py@@ -54,8 +54,9 @@ def format_to_tool_messages(messages = []for agent_action, observation in intermediate_steps:if isinstance(agent_action, ToolAgentAction):- new_messages = list(agent_action.message_log) + [- _create_tool_message(agent_action, observation)+ new_messages = [+ *list(agent_action.message_log),+ _create_tool_message(agent_action, observation),]messages.extend([new for new in new_messages if new not in messages])else:diff --git a/libs/langchain/langchain/agents/output_parsers/__init__.py b/libs/langchain/langchain/agents/output_parsers/__init__.pyindex c5a8b97bdf..a1d056e6e0 100644--- a/libs/langchain/langchain/agents/output_parsers/__init__.py+++ b/libs/langchain/langchain/agents/output_parsers/__init__.py@@ -25,11 +25,11 @@ from langchain.agents.output_parsers.tools import ToolsAgentOutputParserfrom langchain.agents.output_parsers.xml import XMLAgentOutputParser__all__ = [+ "JSONAgentOutputParser",+ "OpenAIFunctionsAgentOutputParser",+ "ReActJsonSingleInputOutputParser","ReActSingleInputOutputParser","SelfAskOutputParser","ToolsAgentOutputParser",- "ReActJsonSingleInputOutputParser",- "OpenAIFunctionsAgentOutputParser","XMLAgentOutputParser",- "JSONAgentOutputParser",]diff --git a/libs/langchain/langchain/agents/self_ask_with_search/base.py b/libs/langchain/langchain/agents/self_ask_with_search/base.pyindex 63302caa75..9bf800be78 100644--- a/libs/langchain/langchain/agents/self_ask_with_search/base.py+++ b/libs/langchain/langchain/agents/self_ask_with_search/base.py@@ -189,7 +189,7 @@ def create_self_ask_with_search_agent(if len(tools) != 1:msg = "This agent expects exactly one tool"raise ValueError(msg)- tool = list(tools)[0]+ tool = next(iter(tools))if tool.name != "Intermediate Answer":msg = "This agent expects the tool to be named `Intermediate Answer`"raise ValueError(msg)diff --git a/libs/langchain/langchain/cache.py b/libs/langchain/langchain/cache.pyindex e8cee3c8cd..50e96cdd4b 100644--- a/libs/langchain/langchain/cache.py+++ b/libs/langchain/langchain/cache.py@@ -53,20 +53,20 @@ def __getattr__(name: str) -> Any:__all__ = [- "FullLLMCache",- "SQLAlchemyCache",- "SQLiteCache",- "UpstashRedisCache",- "RedisCache",- "RedisSemanticCache",- "GPTCache",- "MomentoCache",- "InMemoryCache",+ "AstraDBCache",+ "AstraDBSemanticCache",+ "AzureCosmosDBSemanticCache","CassandraCache","CassandraSemanticCache",+ "FullLLMCache","FullMd5LLMCache",+ "GPTCache",+ "InMemoryCache",+ "MomentoCache",+ "RedisCache",+ "RedisSemanticCache",+ "SQLAlchemyCache","SQLAlchemyMd5Cache",- "AstraDBCache",- "AstraDBSemanticCache",- "AzureCosmosDBSemanticCache",+ "SQLiteCache",+ "UpstashRedisCache",]diff --git a/libs/langchain/langchain/callbacks/__init__.py b/libs/langchain/langchain/callbacks/__init__.pyindex 92690fc902..72355d3fe4 100644--- a/libs/langchain/langchain/callbacks/__init__.py+++ b/libs/langchain/langchain/callbacks/__init__.py@@ -107,33 +107,33 @@ __all__ = ["AimCallbackHandler","ArgillaCallbackHandler","ArizeCallbackHandler",- "PromptLayerCallbackHandler","ArthurCallbackHandler",+ "AsyncIteratorCallbackHandler","ClearMLCallbackHandler","CometCallbackHandler","ContextCallbackHandler","FileCallbackHandler",+ "FinalStreamingStdOutCallbackHandler",+ "FlyteCallbackHandler","HumanApprovalCallbackHandler","InfinoCallbackHandler",- "MlflowCallbackHandler",+ "LLMThoughtLabeler","LLMonitorCallbackHandler",+ "LabelStudioCallbackHandler",+ "LangChainTracer",+ "MlflowCallbackHandler","OpenAICallbackHandler",+ "PromptLayerCallbackHandler",+ "SageMakerCallbackHandler","StdOutCallbackHandler",- "AsyncIteratorCallbackHandler","StreamingStdOutCallbackHandler",- "FinalStreamingStdOutCallbackHandler",- "LLMThoughtLabeler",- "LangChainTracer","StreamlitCallbackHandler",+ "TrubricsCallbackHandler","WandbCallbackHandler","WhyLabsCallbackHandler",+ "collect_runs","get_openai_callback","tracing_enabled","tracing_v2_enabled",- "collect_runs","wandb_tracing_enabled",- "FlyteCallbackHandler",- "SageMakerCallbackHandler",- "LabelStudioCallbackHandler",- "TrubricsCallbackHandler",]diff --git a/libs/langchain/langchain/callbacks/aim_callback.py b/libs/langchain/langchain/callbacks/aim_callback.pyindex aa57017a1f..1badd3957c 100644--- a/libs/langchain/langchain/callbacks/aim_callback.py+++ b/libs/langchain/langchain/callbacks/aim_callback.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "import_aim",- "BaseMetadataCallbackHandler","AimCallbackHandler",+ "BaseMetadataCallbackHandler",+ "import_aim",]diff --git a/libs/langchain/langchain/callbacks/base.py b/libs/langchain/langchain/callbacks/base.pyindex 49fab5ee7d..f360dd6d3b 100644--- a/libs/langchain/langchain/callbacks/base.py+++ b/libs/langchain/langchain/callbacks/base.py@@ -16,14 +16,14 @@ from langchain_core.callbacks import ()__all__ = [- "RetrieverManagerMixin",- "LLMManagerMixin",- "ChainManagerMixin",- "ToolManagerMixin",- "CallbackManagerMixin",- "RunManagerMixin",- "BaseCallbackHandler","AsyncCallbackHandler",+ "BaseCallbackHandler","BaseCallbackManager",+ "CallbackManagerMixin","Callbacks",+ "ChainManagerMixin",+ "LLMManagerMixin",+ "RetrieverManagerMixin",+ "RunManagerMixin",+ "ToolManagerMixin",]diff --git a/libs/langchain/langchain/callbacks/human.py b/libs/langchain/langchain/callbacks/human.pyindex 534dad9604..6cb2f95b85 100644--- a/libs/langchain/langchain/callbacks/human.py+++ b/libs/langchain/langchain/callbacks/human.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "HumanRejectedException",- "HumanApprovalCallbackHandler","AsyncHumanApprovalCallbackHandler",+ "HumanApprovalCallbackHandler",+ "HumanRejectedException",]diff --git a/libs/langchain/langchain/callbacks/labelstudio_callback.py b/libs/langchain/langchain/callbacks/labelstudio_callback.pyindex e12b49a1b8..790071ec11 100644--- a/libs/langchain/langchain/callbacks/labelstudio_callback.py+++ b/libs/langchain/langchain/callbacks/labelstudio_callback.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "LabelStudioCallbackHandler","LabelStudioMode","get_default_label_configs",- "LabelStudioCallbackHandler",]diff --git a/libs/langchain/langchain/callbacks/manager.py b/libs/langchain/langchain/callbacks/manager.pyindex da6ce69ca7..97fa12fad0 100644--- a/libs/langchain/langchain/callbacks/manager.py+++ b/libs/langchain/langchain/callbacks/manager.py@@ -58,7 +58,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "ahandle_event",+ "AsyncCallbackManager","AsyncCallbackManagerForChainGroup","AsyncCallbackManagerForChainRun","AsyncCallbackManagerForLLMRun",@@ -66,7 +66,6 @@ __all__ = ["AsyncCallbackManagerForToolRun","AsyncParentRunManager","AsyncRunManager",- "atrace_as_chain_group","BaseRunManager","CallbackManager","CallbackManagerForChainGroup",@@ -75,13 +74,14 @@ __all__ = ["CallbackManagerForRetrieverRun","CallbackManagerForToolRun","Callbacks",- "AsyncCallbackManager",+ "ParentRunManager",+ "RunManager",+ "ahandle_event",+ "atrace_as_chain_group","collect_runs","env_var_is_set","get_openai_callback","handle_event",- "ParentRunManager",- "RunManager","trace_as_chain_group","tracing_enabled","tracing_v2_enabled",diff --git a/libs/langchain/langchain/callbacks/mlflow_callback.py b/libs/langchain/langchain/callbacks/mlflow_callback.pyindex 738c3a5233..c1ec26ab2e 100644--- a/libs/langchain/langchain/callbacks/mlflow_callback.py+++ b/libs/langchain/langchain/callbacks/mlflow_callback.py@@ -31,8 +31,8 @@ def __getattr__(name: str) -> Any:__all__ = [+ "MlflowCallbackHandler",+ "MlflowLogger","analyze_text","construct_html_from_prompt_and_generation",- "MlflowLogger",- "MlflowCallbackHandler",]diff --git a/libs/langchain/langchain/callbacks/streamlit/mutable_expander.py b/libs/langchain/langchain/callbacks/streamlit/mutable_expander.pyindex 756593ba0b..f5209bb170 100644--- a/libs/langchain/langchain/callbacks/streamlit/mutable_expander.py+++ b/libs/langchain/langchain/callbacks/streamlit/mutable_expander.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "ChildType","ChildRecord",+ "ChildType","MutableExpander",]diff --git a/libs/langchain/langchain/callbacks/streamlit/streamlit_callback_handler.py b/libs/langchain/langchain/callbacks/streamlit/streamlit_callback_handler.pyindex 911561856d..15d1660ae1 100644--- a/libs/langchain/langchain/callbacks/streamlit/streamlit_callback_handler.py+++ b/libs/langchain/langchain/callbacks/streamlit/streamlit_callback_handler.py@@ -41,9 +41,9 @@ def __getattr__(name: str) -> Any:__all__ = [- "LLMThoughtState",- "ToolRecord",- "LLMThoughtLabeler","LLMThought",+ "LLMThoughtLabeler",+ "LLMThoughtState","StreamlitCallbackHandler",+ "ToolRecord",]diff --git a/libs/langchain/langchain/callbacks/tracers/__init__.py b/libs/langchain/langchain/callbacks/tracers/__init__.pyindex 744c6b863d..49c9be80f3 100644--- a/libs/langchain/langchain/callbacks/tracers/__init__.py+++ b/libs/langchain/langchain/callbacks/tracers/__init__.py@@ -31,8 +31,8 @@ def __getattr__(name: str) -> Any:__all__ = ["ConsoleCallbackHandler","FunctionCallbackHandler",- "LoggingCallbackHandler","LangChainTracer","LangChainTracerV1",+ "LoggingCallbackHandler","WandbTracer",]diff --git a/libs/langchain/langchain/callbacks/tracers/comet.py b/libs/langchain/langchain/callbacks/tracers/comet.pyindex e5433d95a2..d1cfe7d906 100644--- a/libs/langchain/langchain/callbacks/tracers/comet.py+++ b/libs/langchain/langchain/callbacks/tracers/comet.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "import_comet_llm_api","CometTracer",+ "import_comet_llm_api",]diff --git a/libs/langchain/langchain/callbacks/tracers/evaluation.py b/libs/langchain/langchain/callbacks/tracers/evaluation.pyindex 7283a540ef..fc4be68b46 100644--- a/libs/langchain/langchain/callbacks/tracers/evaluation.py+++ b/libs/langchain/langchain/callbacks/tracers/evaluation.py@@ -5,4 +5,4 @@ from langchain_core.tracers.evaluation import (wait_for_all_evaluators,)-__all__ = ["wait_for_all_evaluators", "EvaluatorCallbackHandler"]+__all__ = ["EvaluatorCallbackHandler", "wait_for_all_evaluators"]diff --git a/libs/langchain/langchain/callbacks/tracers/log_stream.py b/libs/langchain/langchain/callbacks/tracers/log_stream.pyindex 22b33c3768..54cc24935f 100644--- a/libs/langchain/langchain/callbacks/tracers/log_stream.py+++ b/libs/langchain/langchain/callbacks/tracers/log_stream.py@@ -6,4 +6,4 @@ from langchain_core.tracers.log_stream import (RunState,)-__all__ = ["LogEntry", "RunState", "RunLog", "RunLogPatch", "LogStreamCallbackHandler"]+__all__ = ["LogEntry", "LogStreamCallbackHandler", "RunLog", "RunLogPatch", "RunState"]diff --git a/libs/langchain/langchain/callbacks/tracers/stdout.py b/libs/langchain/langchain/callbacks/tracers/stdout.pyindex 716e2c30ba..5e96c73b75 100644--- a/libs/langchain/langchain/callbacks/tracers/stdout.py+++ b/libs/langchain/langchain/callbacks/tracers/stdout.py@@ -3,4 +3,4 @@ from langchain_core.tracers.stdout import (FunctionCallbackHandler,)-__all__ = ["FunctionCallbackHandler", "ConsoleCallbackHandler"]+__all__ = ["ConsoleCallbackHandler", "FunctionCallbackHandler"]diff --git a/libs/langchain/langchain/callbacks/utils.py b/libs/langchain/langchain/callbacks/utils.pyindex b20381a804..92c990a2bb 100644--- a/libs/langchain/langchain/callbacks/utils.py+++ b/libs/langchain/langchain/callbacks/utils.py@@ -37,12 +37,12 @@ def __getattr__(name: str) -> Any:__all__ = [- "import_spacy",- "import_pandas",- "import_textstat",+ "BaseMetadataCallbackHandler","_flatten_dict","flatten_dict","hash_string",+ "import_pandas",+ "import_spacy",+ "import_textstat","load_json",- "BaseMetadataCallbackHandler",]diff --git a/libs/langchain/langchain/chains/api/base.py b/libs/langchain/langchain/chains/api/base.pyindex 88122b9781..7fe4b9ce81 100644--- a/libs/langchain/langchain/chains/api/base.py+++ b/libs/langchain/langchain/chains/api/base.py@@ -61,7 +61,7 @@ try:message=("This class is deprecated and will be removed in langchain 1.0. ""See API reference for replacement: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.api.base.APIChain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.api.base.APIChain.html"),removal="1.0",)diff --git a/libs/langchain/langchain/chains/api/openapi/requests_chain.py b/libs/langchain/langchain/chains/api/openapi/requests_chain.pyindex 0d221ae24c..76e28a3a0f 100644--- a/libs/langchain/langchain/chains/api/openapi/requests_chain.py+++ b/libs/langchain/langchain/chains/api/openapi/requests_chain.py@@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:return _import_attribute(name)-__all__ = ["APIRequesterChain", "APIRequesterOutputParser", "REQUEST_TEMPLATE"]+__all__ = ["REQUEST_TEMPLATE", "APIRequesterChain", "APIRequesterOutputParser"]diff --git a/libs/langchain/langchain/chains/api/openapi/response_chain.py b/libs/langchain/langchain/chains/api/openapi/response_chain.pyindex 8664476226..6b4485294b 100644--- a/libs/langchain/langchain/chains/api/openapi/response_chain.py+++ b/libs/langchain/langchain/chains/api/openapi/response_chain.py@@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:return _import_attribute(name)-__all__ = ["APIResponderChain", "APIResponderOutputParser", "RESPONSE_TEMPLATE"]+__all__ = ["RESPONSE_TEMPLATE", "APIResponderChain", "APIResponderOutputParser"]diff --git a/libs/langchain/langchain/chains/base.py b/libs/langchain/langchain/chains/base.pyindex 1d63763a1e..9052b7dd6a 100644--- a/libs/langchain/langchain/chains/base.py+++ b/libs/langchain/langchain/chains/base.py@@ -521,7 +521,7 @@ class Chain(RunnableSerializable[dict[str, Any], dict[str, Any]], ABC):# If there are multiple input keys, but some get set by memory so that# only one is not set, we can still figure out which key it is._input_keys = _input_keys.difference(self.memory.memory_variables)- inputs = {list(_input_keys)[0]: inputs}+ inputs = {next(iter(_input_keys)): inputs}if self.memory is not None:external_context = self.memory.load_memory_variables(inputs)inputs = dict(inputs, **external_context)@@ -545,7 +545,7 @@ class Chain(RunnableSerializable[dict[str, Any], dict[str, Any]], ABC):# If there are multiple input keys, but some get set by memory so that# only one is not set, we can still figure out which key it is._input_keys = _input_keys.difference(self.memory.memory_variables)- inputs = {list(_input_keys)[0]: inputs}+ inputs = {next(iter(_input_keys)): inputs}if self.memory is not None:external_context = await self.memory.aload_memory_variables(inputs)inputs = dict(inputs, **external_context)diff --git a/libs/langchain/langchain/chains/combine_documents/__init__.py b/libs/langchain/langchain/chains/combine_documents/__init__.pyindex 6b038ec101..5c468195fa 100644--- a/libs/langchain/langchain/chains/combine_documents/__init__.py+++ b/libs/langchain/langchain/chains/combine_documents/__init__.py@@ -10,6 +10,6 @@ from langchain.chains.combine_documents.stuff import create_stuff_documents_chai__all__ = ["acollapse_docs","collapse_docs",- "split_list_of_docs","create_stuff_documents_chain",+ "split_list_of_docs",]diff --git a/libs/langchain/langchain/chains/combine_documents/base.py b/libs/langchain/langchain/chains/combine_documents/base.pyindex 76f1290a86..d8f00a099b 100644--- a/libs/langchain/langchain/chains/combine_documents/base.py+++ b/libs/langchain/langchain/chains/combine_documents/base.py@@ -163,7 +163,7 @@ class BaseCombineDocumentsChain(Chain, ABC):since="0.2.7",alternative=("example in API reference with more detail: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.combine_documents.base.AnalyzeDocumentChain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.combine_documents.base.AnalyzeDocumentChain.html"),removal="1.0",)diff --git a/libs/langchain/langchain/chains/combine_documents/map_reduce.py b/libs/langchain/langchain/chains/combine_documents/map_reduce.pyindex bd5201e826..9f8d3dbcc2 100644--- a/libs/langchain/langchain/chains/combine_documents/map_reduce.py+++ b/libs/langchain/langchain/chains/combine_documents/map_reduce.py@@ -133,7 +133,7 @@ class MapReduceDocumentsChain(BaseCombineDocumentsChain):"""_output_keys = super().output_keysif self.return_intermediate_steps:- _output_keys = _output_keys + ["intermediate_steps"]+ _output_keys = [*_output_keys, "intermediate_steps"]return _output_keysmodel_config = ConfigDict(@@ -161,8 +161,7 @@ class MapReduceDocumentsChain(BaseCombineDocumentsChain):)values["reduce_documents_chain"] = reduce_chaindel values["combine_document_chain"]- if "collapse_document_chain" in values:- del values["collapse_document_chain"]+ values.pop("collapse_document_chain", None)return valuesdiff --git a/libs/langchain/langchain/chains/combine_documents/map_rerank.py b/libs/langchain/langchain/chains/combine_documents/map_rerank.pyindex c84130a3bd..632bcf2fe9 100644--- a/libs/langchain/langchain/chains/combine_documents/map_rerank.py+++ b/libs/langchain/langchain/chains/combine_documents/map_rerank.py@@ -24,7 +24,7 @@ from langchain.output_parsers.regex import RegexParsermessage=("This class is deprecated. Please see the migration guide here for ""a recommended replacement: "- "https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain/" # noqa: E501+ "https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain/"),)class MapRerankDocumentsChain(BaseCombineDocumentsChain):@@ -112,7 +112,7 @@ class MapRerankDocumentsChain(BaseCombineDocumentsChain):"""_output_keys = super().output_keysif self.return_intermediate_steps:- _output_keys = _output_keys + ["intermediate_steps"]+ _output_keys = [*_output_keys, "intermediate_steps"]if self.metadata_keys is not None:_output_keys += self.metadata_keysreturn _output_keysdiff --git a/libs/langchain/langchain/chains/combine_documents/refine.py b/libs/langchain/langchain/chains/combine_documents/refine.pyindex 34ac3d6504..073d017300 100644--- a/libs/langchain/langchain/chains/combine_documents/refine.py+++ b/libs/langchain/langchain/chains/combine_documents/refine.py@@ -27,7 +27,7 @@ def _get_default_document_prompt() -> PromptTemplate:message=("This class is deprecated. Please see the migration guide here for ""a recommended replacement: "- "https://python.langchain.com/docs/versions/migrating_chains/refine_docs_chain/" # noqa: E501+ "https://python.langchain.com/docs/versions/migrating_chains/refine_docs_chain/"),)class RefineDocumentsChain(BaseCombineDocumentsChain):@@ -105,7 +105,7 @@ class RefineDocumentsChain(BaseCombineDocumentsChain):"""_output_keys = super().output_keysif self.return_intermediate_steps:- _output_keys = _output_keys + ["intermediate_steps"]+ _output_keys = [*_output_keys, "intermediate_steps"]return _output_keysmodel_config = ConfigDict(diff --git a/libs/langchain/langchain/chains/combine_documents/stuff.py b/libs/langchain/langchain/chains/combine_documents/stuff.pyindex ab837c9de9..e862b35594 100644--- a/libs/langchain/langchain/chains/combine_documents/stuff.py+++ b/libs/langchain/langchain/chains/combine_documents/stuff.py@@ -102,7 +102,7 @@ def create_stuff_documents_chain(message=("This class is deprecated. Use the `create_stuff_documents_chain` constructor ""instead. See migration guide here: "- "https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain/" # noqa: E501+ "https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain/"),)class StuffDocumentsChain(BaseCombineDocumentsChain):diff --git a/libs/langchain/langchain/chains/constitutional_ai/base.py b/libs/langchain/langchain/chains/constitutional_ai/base.pyindex cdcbb89d2d..9e8a0b22cd 100644--- a/libs/langchain/langchain/chains/constitutional_ai/base.py+++ b/libs/langchain/langchain/chains/constitutional_ai/base.py@@ -19,7 +19,7 @@ from langchain.chains.llm import LLMChainmessage=("This class is deprecated and will be removed in langchain 1.0. ""See API reference for replacement: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.constitutional_ai.base.ConstitutionalChain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.constitutional_ai.base.ConstitutionalChain.html"),removal="1.0",)diff --git a/libs/langchain/langchain/chains/conversation/base.py b/libs/langchain/langchain/chains/conversation/base.pyindex 314f3d7f4e..fd7dea5d73 100644--- a/libs/langchain/langchain/chains/conversation/base.py+++ b/libs/langchain/langchain/chains/conversation/base.py@@ -132,7 +132,7 @@ class ConversationChain(LLMChain):)raise ValueError(msg)prompt_variables = self.prompt.input_variables- expected_keys = memory_keys + [input_key]+ expected_keys = [*memory_keys, input_key]if set(expected_keys) != set(prompt_variables):msg = ("Got unexpected prompt input variables. The prompt expects "diff --git a/libs/langchain/langchain/chains/conversation/memory.py b/libs/langchain/langchain/chains/conversation/memory.pyindex 03230c4d62..f569fd1b03 100644--- a/libs/langchain/langchain/chains/conversation/memory.py+++ b/libs/langchain/langchain/chains/conversation/memory.py@@ -34,12 +34,12 @@ def __getattr__(name: str) -> Any:# This is only for backwards compatibility.__all__ = [- "ConversationSummaryBufferMemory",- "ConversationSummaryMemory",- "ConversationKGMemory",+ "CombinedMemory",+ "ConversationBufferMemory","ConversationBufferWindowMemory","ConversationEntityMemory",- "ConversationBufferMemory",- "CombinedMemory",+ "ConversationKGMemory","ConversationStringBufferMemory",+ "ConversationSummaryBufferMemory",+ "ConversationSummaryMemory",]diff --git a/libs/langchain/langchain/chains/conversational_retrieval/base.py b/libs/langchain/langchain/chains/conversational_retrieval/base.pyindex bb650f3f8e..bbb6078f24 100644--- a/libs/langchain/langchain/chains/conversational_retrieval/base.py+++ b/libs/langchain/langchain/chains/conversational_retrieval/base.py@@ -121,9 +121,9 @@ class BaseConversationalRetrievalChain(Chain):"""_output_keys = [self.output_key]if self.return_source_documents:- _output_keys = _output_keys + ["source_documents"]+ _output_keys = [*_output_keys, "source_documents"]if self.return_generated_question:- _output_keys = _output_keys + ["generated_question"]+ _output_keys = [*_output_keys, "generated_question"]return _output_keys@abstractmethoddiff --git a/libs/langchain/langchain/chains/ernie_functions/__init__.py b/libs/langchain/langchain/chains/ernie_functions/__init__.pyindex fd2e506818..b6da3255f6 100644--- a/libs/langchain/langchain/chains/ernie_functions/__init__.py+++ b/libs/langchain/langchain/chains/ernie_functions/__init__.py@@ -36,9 +36,9 @@ def __getattr__(name: str) -> Any:__all__ = ["convert_to_ernie_function",- "create_structured_output_chain","create_ernie_fn_chain",- "create_structured_output_runnable","create_ernie_fn_runnable",+ "create_structured_output_chain",+ "create_structured_output_runnable","get_ernie_output_parser",]diff --git a/libs/langchain/langchain/chains/graph_qa/cypher.py b/libs/langchain/langchain/chains/graph_qa/cypher.pyindex fbddc52eb5..d71a75d6e9 100644--- a/libs/langchain/langchain/chains/graph_qa/cypher.py+++ b/libs/langchain/langchain/chains/graph_qa/cypher.py@@ -31,9 +31,9 @@ def __getattr__(name: str) -> Any:__all__ = [- "GraphCypherQAChain",+ "CYPHER_GENERATION_PROMPT","INTERMEDIATE_STEPS_KEY",+ "GraphCypherQAChain","construct_schema","extract_cypher",- "CYPHER_GENERATION_PROMPT",]diff --git a/libs/langchain/langchain/chains/graph_qa/falkordb.py b/libs/langchain/langchain/chains/graph_qa/falkordb.pyindex 1aba6adff4..2f6832f06e 100644--- a/libs/langchain/langchain/chains/graph_qa/falkordb.py+++ b/libs/langchain/langchain/chains/graph_qa/falkordb.py@@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:return _import_attribute(name)-__all__ = ["FalkorDBQAChain", "INTERMEDIATE_STEPS_KEY", "extract_cypher"]+__all__ = ["INTERMEDIATE_STEPS_KEY", "FalkorDBQAChain", "extract_cypher"]diff --git a/libs/langchain/langchain/chains/graph_qa/gremlin.py b/libs/langchain/langchain/chains/graph_qa/gremlin.pyindex 20a7be6ab8..65d5bcb067 100644--- a/libs/langchain/langchain/chains/graph_qa/gremlin.py+++ b/libs/langchain/langchain/chains/graph_qa/gremlin.py@@ -30,7 +30,7 @@ def __getattr__(name: str) -> Any:__all__ = ["GRAPHDB_SPARQL_FIX_TEMPLATE",- "GremlinQAChain","INTERMEDIATE_STEPS_KEY",+ "GremlinQAChain","extract_gremlin",]diff --git a/libs/langchain/langchain/chains/graph_qa/neptune_sparql.py b/libs/langchain/langchain/chains/graph_qa/neptune_sparql.pyindex f4445b65d3..507866159d 100644--- a/libs/langchain/langchain/chains/graph_qa/neptune_sparql.py+++ b/libs/langchain/langchain/chains/graph_qa/neptune_sparql.py@@ -30,7 +30,7 @@ def __getattr__(name: str) -> Any:__all__ = ["INTERMEDIATE_STEPS_KEY",- "NeptuneSparqlQAChain","SPARQL_GENERATION_TEMPLATE",+ "NeptuneSparqlQAChain","extract_sparql",]diff --git a/libs/langchain/langchain/chains/graph_qa/prompts.py b/libs/langchain/langchain/chains/graph_qa/prompts.pyindex 1b7ac18131..6f35601f09 100644--- a/libs/langchain/langchain/chains/graph_qa/prompts.py+++ b/libs/langchain/langchain/chains/graph_qa/prompts.py@@ -74,7 +74,9 @@ __all__ = ["AQL_FIX_TEMPLATE","AQL_GENERATION_TEMPLATE","AQL_QA_TEMPLATE",+ "CYPHER_GENERATION_PROMPT","CYPHER_GENERATION_TEMPLATE",+ "CYPHER_QA_PROMPT","CYPHER_QA_TEMPLATE","GRAPHDB_QA_TEMPLATE","GRAPHDB_SPARQL_FIX_TEMPLATE",@@ -91,6 +93,4 @@ __all__ = ["SPARQL_GENERATION_UPDATE_TEMPLATE","SPARQL_INTENT_TEMPLATE","SPARQL_QA_TEMPLATE",- "CYPHER_QA_PROMPT",- "CYPHER_GENERATION_PROMPT",]diff --git a/libs/langchain/langchain/chains/llm_math/base.py b/libs/langchain/langchain/chains/llm_math/base.pyindex 674d599835..012a49c6b4 100644--- a/libs/langchain/langchain/chains/llm_math/base.py+++ b/libs/langchain/langchain/chains/llm_math/base.py@@ -26,7 +26,7 @@ from langchain.chains.llm_math.prompt import PROMPTmessage=("This class is deprecated and will be removed in langchain 1.0. ""See API reference for replacement: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.llm_math.base.LLMMathChain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.llm_math.base.LLMMathChain.html"),removal="1.0",)diff --git a/libs/langchain/langchain/chains/mapreduce.py b/libs/langchain/langchain/chains/mapreduce.pyindex 6e7842f221..04627f5863 100644--- a/libs/langchain/langchain/chains/mapreduce.py+++ b/libs/langchain/langchain/chains/mapreduce.py@@ -30,7 +30,7 @@ from langchain.chains.llm import LLMChainremoval="1.0",message=("Refer to migration guide here for a recommended implementation using "- "LangGraph: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain/" # noqa: E501+ "LangGraph: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain/"". See also LangGraph guides for map-reduce: ""https://langchain-ai.github.io/langgraph/how-tos/map-reduce/."),diff --git a/libs/langchain/langchain/chains/openai_functions/__init__.py b/libs/langchain/langchain/chains/openai_functions/__init__.pyindex 6312b61989..4dc4a79bb3 100644--- a/libs/langchain/langchain/chains/openai_functions/__init__.py+++ b/libs/langchain/langchain/chains/openai_functions/__init__.py@@ -28,17 +28,17 @@ from langchain.chains.structured_output.base import (__all__ = ["convert_to_openai_function",- "create_tagging_chain",- "create_tagging_chain_pydantic",- "create_extraction_chain_pydantic",- "create_extraction_chain","create_citation_fuzzy_match_chain","create_citation_fuzzy_match_runnable",- "create_qa_with_structure_chain",+ "create_extraction_chain",+ "create_extraction_chain_pydantic",+ "create_openai_fn_chain",+ "create_openai_fn_runnable", # backwards compatibility"create_qa_with_sources_chain",+ "create_qa_with_structure_chain","create_structured_output_chain",- "create_openai_fn_chain","create_structured_output_runnable", # backwards compatibility- "create_openai_fn_runnable", # backwards compatibility+ "create_tagging_chain",+ "create_tagging_chain_pydantic","get_openai_output_parser", # backwards compatibility]diff --git a/libs/langchain/langchain/chains/openai_functions/base.py b/libs/langchain/langchain/chains/openai_functions/base.pyindex a6c020621c..962541833c 100644--- a/libs/langchain/langchain/chains/openai_functions/base.py+++ b/libs/langchain/langchain/chains/openai_functions/base.py@@ -31,13 +31,13 @@ from langchain.chains.structured_output.base import ()__all__ = [- "get_openai_output_parser",- "create_openai_fn_runnable",- "create_structured_output_runnable", # deprecated- "create_openai_fn_chain", # deprecated- "create_structured_output_chain", # deprecated"PYTHON_TO_JSON_TYPES", # backwards compatibility"convert_to_openai_function", # backwards compatibility+ "create_openai_fn_chain", # deprecated+ "create_openai_fn_runnable",+ "create_structured_output_chain", # deprecated+ "create_structured_output_runnable", # deprecated+ "get_openai_output_parser",]diff --git a/libs/langchain/langchain/chains/openai_functions/openapi.py b/libs/langchain/langchain/chains/openai_functions/openapi.pyindex 146e95cba5..0c8f463eb0 100644--- a/libs/langchain/langchain/chains/openai_functions/openapi.py+++ b/libs/langchain/langchain/chains/openai_functions/openapi.py@@ -69,7 +69,7 @@ def _openapi_params_to_json_schema(params: list[Parameter], spec: OpenAPISpec) -if p.param_schema:schema = spec.get_schema(p.param_schema)else:- media_type_schema = list(p.content.values())[0].media_type_schema+ media_type_schema = next(iter(p.content.values())).media_type_schemaschema = spec.get_schema(media_type_schema)if p.description and not schema.description:schema.description = p.description@@ -140,7 +140,7 @@ def openapi_spec_to_openai_fn(schema.json(exclude_none=True))if len(media_types) == 1:- media_type, schema_dict = list(media_types.items())[0]+ media_type, schema_dict = next(iter(media_types.items()))key = "json" if media_type == "application/json" else "data"request_args[key] = schema_dictelif len(media_types) > 1:@@ -242,7 +242,7 @@ class SimpleRequestChain(Chain):message=("This function is deprecated and will be removed in langchain 1.0. ""See API reference for replacement: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.openapi.get_openapi_chain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.openapi.get_openapi_chain.html"),removal="1.0",)diff --git a/libs/langchain/langchain/chains/openai_functions/qa_with_structure.py b/libs/langchain/langchain/chains/openai_functions/qa_with_structure.pyindex e9579e9bce..421f9ec73c 100644--- a/libs/langchain/langchain/chains/openai_functions/qa_with_structure.py+++ b/libs/langchain/langchain/chains/openai_functions/qa_with_structure.py@@ -32,7 +32,7 @@ class AnswerWithSources(BaseModel):message=("This function is deprecated. Refer to this guide on retrieval and question ""answering with structured responses: "- "https://python.langchain.com/docs/how_to/qa_sources/#structure-sources-in-model-response" # noqa: E501+ "https://python.langchain.com/docs/how_to/qa_sources/#structure-sources-in-model-response"),)def create_qa_with_structure_chain(@@ -115,7 +115,7 @@ def create_qa_with_structure_chain(message=("This function is deprecated. Refer to this guide on retrieval and question ""answering with sources: "- "https://python.langchain.com/docs/how_to/qa_sources/#structure-sources-in-model-response" # noqa: E501+ "https://python.langchain.com/docs/how_to/qa_sources/#structure-sources-in-model-response"),)def create_qa_with_sources_chain(diff --git a/libs/langchain/langchain/chains/qa_generation/base.py b/libs/langchain/langchain/chains/qa_generation/base.pyindex 0a90acb023..ca106a7fae 100644--- a/libs/langchain/langchain/chains/qa_generation/base.py+++ b/libs/langchain/langchain/chains/qa_generation/base.py@@ -19,7 +19,7 @@ from langchain.chains.qa_generation.prompt import PROMPT_SELECTORsince="0.2.7",alternative=("example in API reference with more detail: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_generation.base.QAGenerationChain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_generation.base.QAGenerationChain.html"),removal="1.0",)diff --git a/libs/langchain/langchain/chains/qa_with_sources/base.py b/libs/langchain/langchain/chains/qa_with_sources/base.pyindex 7b2b371ee0..ac77e06a8d 100644--- a/libs/langchain/langchain/chains/qa_with_sources/base.py+++ b/libs/langchain/langchain/chains/qa_with_sources/base.py@@ -118,7 +118,7 @@ class BaseQAWithSourcesChain(Chain, ABC):"""_output_keys = [self.answer_key, self.sources_answer_key]if self.return_source_documents:- _output_keys = _output_keys + ["source_documents"]+ _output_keys = [*_output_keys, "source_documents"]return _output_keys@model_validator(mode="before")diff --git a/libs/langchain/langchain/chains/qa_with_sources/loading.py b/libs/langchain/langchain/chains/qa_with_sources/loading.pyindex 5bd0d4d1fd..9fd8a3587d 100644--- a/libs/langchain/langchain/chains/qa_with_sources/loading.py+++ b/libs/langchain/langchain/chains/qa_with_sources/loading.py@@ -167,10 +167,10 @@ def _load_refine_chain("https://python.langchain.com/docs/how_to/qa_sources/""\nSee also the following migration guides for replacements ""based on `chain_type`:\n"- "stuff: https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain\n" # noqa: E501- "map_reduce: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain\n" # noqa: E501- "refine: https://python.langchain.com/docs/versions/migrating_chains/refine_chain\n" # noqa: E501- "map_rerank: https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain\n" # noqa: E501+ "stuff: https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain\n"+ "map_reduce: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain\n"+ "refine: https://python.langchain.com/docs/versions/migrating_chains/refine_chain\n"+ "map_rerank: https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain\n"),)def load_qa_with_sources_chain(diff --git a/libs/langchain/langchain/chains/query_constructor/ir.py b/libs/langchain/langchain/chains/query_constructor/ir.pyindex f714015967..60453c8f6d 100644--- a/libs/langchain/langchain/chains/query_constructor/ir.py+++ b/libs/langchain/langchain/chains/query_constructor/ir.py@@ -12,12 +12,12 @@ from langchain_core.structured_query import ()__all__ = [- "Visitor",- "Expr",- "Operator","Comparator",- "FilterDirective","Comparison",+ "Expr",+ "FilterDirective","Operation",+ "Operator","StructuredQuery",+ "Visitor",]diff --git a/libs/langchain/langchain/chains/question_answering/chain.py b/libs/langchain/langchain/chains/question_answering/chain.pyindex 853fb00b0a..e42444c6be 100644--- a/libs/langchain/langchain/chains/question_answering/chain.py+++ b/libs/langchain/langchain/chains/question_answering/chain.py@@ -229,10 +229,10 @@ def _load_refine_chain(message=("This class is deprecated. See the following migration guides for replacements ""based on `chain_type`:\n"- "stuff: https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain\n" # noqa: E501- "map_reduce: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain\n" # noqa: E501- "refine: https://python.langchain.com/docs/versions/migrating_chains/refine_chain\n" # noqa: E501- "map_rerank: https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain\n" # noqa: E501+ "stuff: https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain\n"+ "map_reduce: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain\n"+ "refine: https://python.langchain.com/docs/versions/migrating_chains/refine_chain\n"+ "map_rerank: https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain\n""\nSee also guides on retrieval and question-answering here: ""https://python.langchain.com/docs/how_to/#qa-with-rag"),diff --git a/libs/langchain/langchain/chains/retrieval_qa/base.py b/libs/langchain/langchain/chains/retrieval_qa/base.pyindex fbce2eac11..a6a7da9fe2 100644--- a/libs/langchain/langchain/chains/retrieval_qa/base.py+++ b/libs/langchain/langchain/chains/retrieval_qa/base.py@@ -69,7 +69,7 @@ class BaseRetrievalQA(Chain):"""_output_keys = [self.output_key]if self.return_source_documents:- _output_keys = _output_keys + ["source_documents"]+ _output_keys = [*_output_keys, "source_documents"]return _output_keys@classmethoddiff --git a/libs/langchain/langchain/chains/router/__init__.py b/libs/langchain/langchain/chains/router/__init__.pyindex 5ccd5eac9e..b948749683 100644--- a/libs/langchain/langchain/chains/router/__init__.py+++ b/libs/langchain/langchain/chains/router/__init__.py@@ -4,9 +4,9 @@ from langchain.chains.router.multi_prompt import MultiPromptChainfrom langchain.chains.router.multi_retrieval_qa import MultiRetrievalQAChain__all__ = [- "RouterChain",- "MultiRouteChain",+ "LLMRouterChain","MultiPromptChain","MultiRetrievalQAChain",- "LLMRouterChain",+ "MultiRouteChain",+ "RouterChain",]diff --git a/libs/langchain/langchain/chains/router/llm_router.py b/libs/langchain/langchain/chains/router/llm_router.pyindex 2b74952d75..b62845d0f5 100644--- a/libs/langchain/langchain/chains/router/llm_router.py+++ b/libs/langchain/langchain/chains/router/llm_router.py@@ -27,7 +27,7 @@ from langchain.chains.router.base import RouterChainmessage=("Use RunnableLambda to select from multiple prompt templates. See example ""in API reference: "- "https://api.python.langchain.com/en/latest/chains/langchain.chains.router.llm_router.LLMRouterChain.html" # noqa: E501+ "https://api.python.langchain.com/en/latest/chains/langchain.chains.router.llm_router.LLMRouterChain.html"),)class LLMRouterChain(RouterChain):diff --git a/libs/langchain/langchain/chains/router/multi_prompt.py b/libs/langchain/langchain/chains/router/multi_prompt.pyindex 8b3f398b38..c57b63949b 100644--- a/libs/langchain/langchain/chains/router/multi_prompt.py+++ b/libs/langchain/langchain/chains/router/multi_prompt.py@@ -21,7 +21,7 @@ from langchain.chains.router.multi_prompt_prompt import MULTI_PROMPT_ROUTER_TEMPremoval="1.0",message=("Please see migration guide here for recommended implementation: "- "https://python.langchain.com/docs/versions/migrating_chains/multi_prompt_chain/" # noqa: E501+ "https://python.langchain.com/docs/versions/migrating_chains/multi_prompt_chain/"),)class MultiPromptChain(MultiRouteChain):diff --git a/libs/langchain/langchain/chains/structured_output/__init__.py b/libs/langchain/langchain/chains/structured_output/__init__.pyindex d387a7cbe4..10bd6808bc 100644--- a/libs/langchain/langchain/chains/structured_output/__init__.py+++ b/libs/langchain/langchain/chains/structured_output/__init__.py@@ -3,4 +3,4 @@ from langchain.chains.structured_output.base import (create_structured_output_runnable,)-__all__ = ["create_structured_output_runnable", "create_openai_fn_runnable"]+__all__ = ["create_openai_fn_runnable", "create_structured_output_runnable"]diff --git a/libs/langchain/langchain/chat_loaders/facebook_messenger.py b/libs/langchain/langchain/chat_loaders/facebook_messenger.pyindex 37e2f18a3f..46a5ea8eab 100644--- a/libs/langchain/langchain/chat_loaders/facebook_messenger.py+++ b/libs/langchain/langchain/chat_loaders/facebook_messenger.py@@ -29,4 +29,4 @@ def __getattr__(name: str) -> Any:return import_lookup(name)-__all__ = ["SingleFileFacebookMessengerChatLoader", "FolderFacebookMessengerChatLoader"]+__all__ = ["FolderFacebookMessengerChatLoader", "SingleFileFacebookMessengerChatLoader"]diff --git a/libs/langchain/langchain/chat_loaders/langsmith.py b/libs/langchain/langchain/chat_loaders/langsmith.pyindex aa90fd429f..066b9c538b 100644--- a/libs/langchain/langchain/chat_loaders/langsmith.py+++ b/libs/langchain/langchain/chat_loaders/langsmith.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "LangSmithRunChatLoader","LangSmithDatasetChatLoader",+ "LangSmithRunChatLoader",]diff --git a/libs/langchain/langchain/chat_loaders/utils.py b/libs/langchain/langchain/chat_loaders/utils.pyindex 04570354f2..f557d76111 100644--- a/libs/langchain/langchain/chat_loaders/utils.py+++ b/libs/langchain/langchain/chat_loaders/utils.py@@ -29,8 +29,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "merge_chat_runs_in_session",- "merge_chat_runs",- "map_ai_messages_in_session","map_ai_messages",+ "map_ai_messages_in_session",+ "merge_chat_runs",+ "merge_chat_runs_in_session",]diff --git a/libs/langchain/langchain/chat_models/__init__.py b/libs/langchain/langchain/chat_models/__init__.pyindex 17530d1939..0d7280ded3 100644--- a/libs/langchain/langchain/chat_models/__init__.py+++ b/libs/langchain/langchain/chat_models/__init__.py@@ -43,35 +43,35 @@ def __getattr__(name: str) -> None:__all__ = [- "init_chat_model",- "ChatOpenAI",- "BedrockChat","AzureChatOpenAI",- "FakeListChatModel",- "PromptLayerChatOpenAI",- "ChatDatabricks",- "ChatEverlyAI",+ "BedrockChat","ChatAnthropic",+ "ChatAnyscale",+ "ChatBaichuan","ChatCohere",+ "ChatDatabricks",+ "ChatEverlyAI",+ "ChatFireworks","ChatGooglePalm",- "ChatMlflow",+ "ChatHunyuan",+ "ChatJavelinAIGateway",+ "ChatKonko",+ "ChatLiteLLM","ChatMLflowAIGateway",+ "ChatMlflow","ChatOllama",+ "ChatOpenAI","ChatVertexAI",- "JinaChat",+ "ChatYandexGPT",+ "ErnieBotChat",+ "FakeListChatModel",+ "GigaChat","HumanInputChatModel",+ "JinaChat","MiniMaxChat",- "ChatAnyscale",- "ChatLiteLLM",- "ErnieBotChat",- "ChatJavelinAIGateway",- "ChatKonko","PaiEasChatEndpoint",+ "PromptLayerChatOpenAI","QianfanChatEndpoint",- "ChatFireworks",- "ChatYandexGPT",- "ChatBaichuan",- "ChatHunyuan",- "GigaChat","VolcEngineMaasChat",+ "init_chat_model",]diff --git a/libs/langchain/langchain/chat_models/anthropic.py b/libs/langchain/langchain/chat_models/anthropic.pyindex aa92589617..6478cf11aa 100644--- a/libs/langchain/langchain/chat_models/anthropic.py+++ b/libs/langchain/langchain/chat_models/anthropic.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "convert_messages_to_prompt_anthropic","ChatAnthropic",+ "convert_messages_to_prompt_anthropic",]diff --git a/libs/langchain/langchain/chat_models/azureml_endpoint.py b/libs/langchain/langchain/chat_models/azureml_endpoint.pyindex ebcc0fdccd..3be1a3de38 100644--- a/libs/langchain/langchain/chat_models/azureml_endpoint.py+++ b/libs/langchain/langchain/chat_models/azureml_endpoint.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "LlamaContentFormatter","AzureMLChatOnlineEndpoint",+ "LlamaContentFormatter",]diff --git a/libs/langchain/langchain/chat_models/base.py b/libs/langchain/langchain/chat_models/base.pyindex dee5c5f7ff..2c465d9756 100644--- a/libs/langchain/langchain/chat_models/base.py+++ b/libs/langchain/langchain/chat_models/base.py@@ -31,12 +31,12 @@ from pydantic import BaseModelfrom typing_extensions import TypeAlias, override__all__ = [- "init_chat_model",# For backwards compatibility"BaseChatModel","SimpleChatModel",- "generate_from_stream","agenerate_from_stream",+ "generate_from_stream",+ "init_chat_model",]diff --git a/libs/langchain/langchain/chat_models/bedrock.py b/libs/langchain/langchain/chat_models/bedrock.pyindex d2d2817284..3943f0276d 100644--- a/libs/langchain/langchain/chat_models/bedrock.py+++ b/libs/langchain/langchain/chat_models/bedrock.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ChatPromptAdapter","BedrockChat",+ "ChatPromptAdapter",]diff --git a/libs/langchain/langchain/chat_models/fake.py b/libs/langchain/langchain/chat_models/fake.pyindex 261d5fa5f3..8e7a05b365 100644--- a/libs/langchain/langchain/chat_models/fake.py+++ b/libs/langchain/langchain/chat_models/fake.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "FakeMessagesListChatModel","FakeListChatModel",+ "FakeMessagesListChatModel",]diff --git a/libs/langchain/langchain/chat_models/volcengine_maas.py b/libs/langchain/langchain/chat_models/volcengine_maas.pyindex 9c4571140c..858a2f0441 100644--- a/libs/langchain/langchain/chat_models/volcengine_maas.py+++ b/libs/langchain/langchain/chat_models/volcengine_maas.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "convert_dict_to_message","VolcEngineMaasChat",+ "convert_dict_to_message",]diff --git a/libs/langchain/langchain/docstore/base.py b/libs/langchain/langchain/docstore/base.pyindex 34c0f19724..c5416c247e 100644--- a/libs/langchain/langchain/docstore/base.py+++ b/libs/langchain/langchain/docstore/base.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "Docstore","AddableMixin",+ "Docstore",]diff --git a/libs/langchain/langchain/document_loaders/__init__.py b/libs/langchain/langchain/document_loaders/__init__.pyindex d5a6b9726c..577ea73055 100644--- a/libs/langchain/langchain/document_loaders/__init__.py+++ b/libs/langchain/langchain/document_loaders/__init__.py@@ -380,15 +380,13 @@ def __getattr__(name: str) -> Any:__all__ = [- "AcreomLoader",- "AsyncHtmlLoader",- "AsyncChromiumLoader","AZLyricsLoader","AcreomLoader",+ "AcreomLoader","AirbyteCDKLoader","AirbyteGongLoader",- "AirbyteJSONLoader","AirbyteHubspotLoader",+ "AirbyteJSONLoader","AirbyteSalesforceLoader","AirbyteShopifyLoader","AirbyteStripeLoader",@@ -400,6 +398,8 @@ __all__ = ["ArcGISLoader","ArxivLoader","AssemblyAIAudioTranscriptLoader",+ "AsyncChromiumLoader",+ "AsyncHtmlLoader","AsyncHtmlLoader","AzureAIDataLoader","AzureBlobStorageContainerLoader",@@ -441,14 +441,14 @@ __all__ = ["GCSDirectoryLoader","GCSFileLoader","GeoDataFrameLoader",- "GithubFileLoader","GitHubIssuesLoader","GitLoader","GitbookLoader",+ "GithubFileLoader","GoogleApiClient","GoogleApiYoutubeLoader",- "GoogleSpeechToTextLoader","GoogleDriveLoader",+ "GoogleSpeechToTextLoader","GutenbergLoader","HNLoader","HuggingFaceDatasetLoader",@@ -458,8 +458,8 @@ __all__ = ["IuguLoader","JSONLoader","JoplinLoader",- "LarkSuiteDocLoader","LakeFSLoader",+ "LarkSuiteDocLoader","MHTMLLoader","MWDumpLoader","MastodonTootsLoader",@@ -483,13 +483,13 @@ __all__ = ["PDFMinerLoader","PDFMinerPDFasHTMLLoader","PDFPlumberLoader",+ "PagedPDFSplitter","PlaywrightURLLoader","PolarsDataFrameLoader","PsychicLoader","PubMedLoader","PyMuPDFLoader","PyPDFDirectoryLoader",- "PagedPDFSplitter","PyPDFLoader","PyPDFium2Loader","PySparkDataFrameLoader",@@ -513,9 +513,9 @@ __all__ = ["TelegramChatApiLoader","TelegramChatFileLoader","TelegramChatLoader",- "TensorflowDatasetLoader","TencentCOSDirectoryLoader","TencentCOSFileLoader",+ "TensorflowDatasetLoader","TextLoader","ToMarkdownLoader","TomlLoader",diff --git a/libs/langchain/langchain/document_loaders/airbyte.py b/libs/langchain/langchain/document_loaders/airbyte.pyindex 57c4c6c5d3..8707f73416 100644--- a/libs/langchain/langchain/document_loaders/airbyte.py+++ b/libs/langchain/langchain/document_loaders/airbyte.py@@ -38,11 +38,11 @@ def __getattr__(name: str) -> Any:__all__ = ["AirbyteCDKLoader",+ "AirbyteGongLoader","AirbyteHubspotLoader",+ "AirbyteSalesforceLoader",+ "AirbyteShopifyLoader","AirbyteStripeLoader","AirbyteTypeformLoader","AirbyteZendeskSupportLoader",- "AirbyteShopifyLoader",- "AirbyteSalesforceLoader",- "AirbyteGongLoader",]diff --git a/libs/langchain/langchain/document_loaders/assemblyai.py b/libs/langchain/langchain/document_loaders/assemblyai.pyindex 2cff9381a2..b1fc724e1d 100644--- a/libs/langchain/langchain/document_loaders/assemblyai.py+++ b/libs/langchain/langchain/document_loaders/assemblyai.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "TranscriptFormat","AssemblyAIAudioTranscriptLoader",+ "TranscriptFormat",]diff --git a/libs/langchain/langchain/document_loaders/base.py b/libs/langchain/langchain/document_loaders/base.pyindex 4b0bf30b11..ac8e0565a5 100644--- a/libs/langchain/langchain/document_loaders/base.py+++ b/libs/langchain/langchain/document_loaders/base.py@@ -1,3 +1,3 @@from langchain_core.document_loaders import BaseBlobParser, BaseLoader-__all__ = ["BaseLoader", "BaseBlobParser"]+__all__ = ["BaseBlobParser", "BaseLoader"]diff --git a/libs/langchain/langchain/document_loaders/blob_loaders/__init__.py b/libs/langchain/langchain/document_loaders/blob_loaders/__init__.pyindex 67898e4c2a..d91d1658fa 100644--- a/libs/langchain/langchain/document_loaders/blob_loaders/__init__.py+++ b/libs/langchain/langchain/document_loaders/blob_loaders/__init__.py@@ -29,8 +29,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "BlobLoader","Blob",+ "BlobLoader","FileSystemBlobLoader","YoutubeAudioLoader",]diff --git a/libs/langchain/langchain/document_loaders/blockchain.py b/libs/langchain/langchain/document_loaders/blockchain.pyindex b815c6e967..8eb83e81b7 100644--- a/libs/langchain/langchain/document_loaders/blockchain.py+++ b/libs/langchain/langchain/document_loaders/blockchain.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "BlockchainType","BlockchainDocumentLoader",+ "BlockchainType",]diff --git a/libs/langchain/langchain/document_loaders/chatgpt.py b/libs/langchain/langchain/document_loaders/chatgpt.pyindex e9ab0934fd..c117dec644 100644--- a/libs/langchain/langchain/document_loaders/chatgpt.py+++ b/libs/langchain/langchain/document_loaders/chatgpt.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "concatenate_rows","ChatGPTLoader",+ "concatenate_rows",]diff --git a/libs/langchain/langchain/document_loaders/confluence.py b/libs/langchain/langchain/document_loaders/confluence.pyindex f91b828032..71e4e8adf0 100644--- a/libs/langchain/langchain/document_loaders/confluence.py+++ b/libs/langchain/langchain/document_loaders/confluence.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ContentFormat","ConfluenceLoader",+ "ContentFormat",]diff --git a/libs/langchain/langchain/document_loaders/email.py b/libs/langchain/langchain/document_loaders/email.pyindex 4d462e0a1a..0ce8eb05c5 100644--- a/libs/langchain/langchain/document_loaders/email.py+++ b/libs/langchain/langchain/document_loaders/email.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "UnstructuredEmailLoader","OutlookMessageLoader",+ "UnstructuredEmailLoader",]diff --git a/libs/langchain/langchain/document_loaders/facebook_chat.py b/libs/langchain/langchain/document_loaders/facebook_chat.pyindex bdf5d219b7..34fb0a10e2 100644--- a/libs/langchain/langchain/document_loaders/facebook_chat.py+++ b/libs/langchain/langchain/document_loaders/facebook_chat.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "concatenate_rows","FacebookChatLoader",+ "concatenate_rows",]diff --git a/libs/langchain/langchain/document_loaders/notebook.py b/libs/langchain/langchain/document_loaders/notebook.pyindex e29dcde56e..ea0e7f7f9b 100644--- a/libs/langchain/langchain/document_loaders/notebook.py+++ b/libs/langchain/langchain/document_loaders/notebook.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "NotebookLoader","concatenate_cells","remove_newlines",- "NotebookLoader",]diff --git a/libs/langchain/langchain/document_loaders/parsers/__init__.py b/libs/langchain/langchain/document_loaders/parsers/__init__.pyindex a0c3930e81..2cf826708b 100644--- a/libs/langchain/langchain/document_loaders/parsers/__init__.py+++ b/libs/langchain/langchain/document_loaders/parsers/__init__.py@@ -53,6 +53,6 @@ __all__ = ["PDFMinerParser","PDFPlumberParser","PyMuPDFParser",- "PyPDFium2Parser","PyPDFParser",+ "PyPDFium2Parser",]diff --git a/libs/langchain/langchain/document_loaders/parsers/docai.py b/libs/langchain/langchain/document_loaders/parsers/docai.pyindex bdc293253b..57f1baec2d 100644--- a/libs/langchain/langchain/document_loaders/parsers/docai.py+++ b/libs/langchain/langchain/document_loaders/parsers/docai.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "DocAIParsingResults","DocAIParser",+ "DocAIParsingResults",]diff --git a/libs/langchain/langchain/document_loaders/parsers/pdf.py b/libs/langchain/langchain/document_loaders/parsers/pdf.pyindex 398134eed6..f6924f2b53 100644--- a/libs/langchain/langchain/document_loaders/parsers/pdf.py+++ b/libs/langchain/langchain/document_loaders/parsers/pdf.py@@ -39,12 +39,12 @@ def __getattr__(name: str) -> Any:__all__ = [- "extract_from_images_with_rapidocr",- "PyPDFParser",+ "AmazonTextractPDFParser",+ "DocumentIntelligenceParser","PDFMinerParser",+ "PDFPlumberParser","PyMuPDFParser",+ "PyPDFParser","PyPDFium2Parser",- "PDFPlumberParser",- "AmazonTextractPDFParser",- "DocumentIntelligenceParser",+ "extract_from_images_with_rapidocr",]diff --git a/libs/langchain/langchain/document_loaders/pdf.py b/libs/langchain/langchain/document_loaders/pdf.pyindex 9e5a39ae46..8f50b2e6c6 100644--- a/libs/langchain/langchain/document_loaders/pdf.py+++ b/libs/langchain/langchain/document_loaders/pdf.py@@ -49,17 +49,17 @@ def __getattr__(name: str) -> Any:__all__ = [- "UnstructuredPDFLoader",+ "AmazonTextractPDFLoader","BasePDFLoader",+ "DocumentIntelligenceLoader",+ "MathpixPDFLoader","OnlinePDFLoader",- "PagedPDFSplitter",- "PyPDFium2Loader",- "PyPDFDirectoryLoader","PDFMinerLoader","PDFMinerPDFasHTMLLoader",- "PyMuPDFLoader",- "MathpixPDFLoader","PDFPlumberLoader",- "AmazonTextractPDFLoader",- "DocumentIntelligenceLoader",+ "PagedPDFSplitter",+ "PyMuPDFLoader",+ "PyPDFDirectoryLoader",+ "PyPDFium2Loader",+ "UnstructuredPDFLoader",]diff --git a/libs/langchain/langchain/document_loaders/telegram.py b/libs/langchain/langchain/document_loaders/telegram.pyindex 14523f65c4..f5499606db 100644--- a/libs/langchain/langchain/document_loaders/telegram.py+++ b/libs/langchain/langchain/document_loaders/telegram.py@@ -31,8 +31,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "concatenate_rows",+ "TelegramChatApiLoader","TelegramChatFileLoader",+ "concatenate_rows","text_to_docs",- "TelegramChatApiLoader",]diff --git a/libs/langchain/langchain/document_loaders/unstructured.py b/libs/langchain/langchain/document_loaders/unstructured.pyindex 242d3a07b7..9911b38890 100644--- a/libs/langchain/langchain/document_loaders/unstructured.py+++ b/libs/langchain/langchain/document_loaders/unstructured.py@@ -43,12 +43,12 @@ def __getattr__(name: str) -> Any:__all__ = [- "satisfies_min_unstructured_version",- "validate_unstructured_version",+ "UnstructuredAPIFileIOLoader",+ "UnstructuredAPIFileLoader","UnstructuredBaseLoader",+ "UnstructuredFileIOLoader","UnstructuredFileLoader","get_elements_from_api",- "UnstructuredAPIFileLoader",- "UnstructuredFileIOLoader",- "UnstructuredAPIFileIOLoader",+ "satisfies_min_unstructured_version",+ "validate_unstructured_version",]diff --git a/libs/langchain/langchain/document_loaders/url_playwright.py b/libs/langchain/langchain/document_loaders/url_playwright.pyindex dd692cf509..acbd018283 100644--- a/libs/langchain/langchain/document_loaders/url_playwright.py+++ b/libs/langchain/langchain/document_loaders/url_playwright.py@@ -28,6 +28,6 @@ def __getattr__(name: str) -> Any:__all__ = ["PlaywrightEvaluator",- "UnstructuredHtmlEvaluator","PlaywrightURLLoader",+ "UnstructuredHtmlEvaluator",]diff --git a/libs/langchain/langchain/document_loaders/whatsapp_chat.py b/libs/langchain/langchain/document_loaders/whatsapp_chat.pyindex 3fc2133e49..d37aa09f98 100644--- a/libs/langchain/langchain/document_loaders/whatsapp_chat.py+++ b/libs/langchain/langchain/document_loaders/whatsapp_chat.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "concatenate_rows","WhatsAppChatLoader",+ "concatenate_rows",]diff --git a/libs/langchain/langchain/document_loaders/youtube.py b/libs/langchain/langchain/document_loaders/youtube.pyindex cf69678312..a36445c2c6 100644--- a/libs/langchain/langchain/document_loaders/youtube.py+++ b/libs/langchain/langchain/document_loaders/youtube.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "YoutubeLoader",- "GoogleApiYoutubeLoader","GoogleApiClient",+ "GoogleApiYoutubeLoader",+ "YoutubeLoader",]diff --git a/libs/langchain/langchain/document_transformers/__init__.py b/libs/langchain/langchain/document_transformers/__init__.pyindex adfd277c33..e3bd8ab87a 100644--- a/libs/langchain/langchain/document_transformers/__init__.py+++ b/libs/langchain/langchain/document_transformers/__init__.py@@ -63,15 +63,15 @@ def __getattr__(name: str) -> Any:__all__ = ["BeautifulSoupTransformer",+ "DoctranPropertyExtractor","DoctranQATransformer","DoctranTextTranslator",- "DoctranPropertyExtractor","EmbeddingsClusteringFilter","EmbeddingsRedundantFilter","GoogleTranslateTransformer",- "get_stateful_documents",+ "Html2TextTransformer","LongContextReorder","NucliaTextTransformer","OpenAIMetadataTagger",- "Html2TextTransformer",+ "get_stateful_documents",]diff --git a/libs/langchain/langchain/document_transformers/embeddings_redundant_filter.py b/libs/langchain/langchain/document_transformers/embeddings_redundant_filter.pyindex 2230444af6..cb79b88c20 100644--- a/libs/langchain/langchain/document_transformers/embeddings_redundant_filter.py+++ b/libs/langchain/langchain/document_transformers/embeddings_redundant_filter.py@@ -41,10 +41,10 @@ def __getattr__(name: str) -> Any:__all__ = [- "EmbeddingsRedundantFilter","EmbeddingsClusteringFilter",+ "EmbeddingsRedundantFilter","_DocumentWithState",- "get_stateful_documents",- "_get_embeddings_from_stateful_docs","_filter_similar_embeddings",+ "_get_embeddings_from_stateful_docs",+ "get_stateful_documents",]diff --git a/libs/langchain/langchain/embeddings/__init__.py b/libs/langchain/langchain/embeddings/__init__.pyindex 8c8ef661c5..87b20ba4e8 100644--- a/libs/langchain/langchain/embeddings/__init__.py+++ b/libs/langchain/langchain/embeddings/__init__.py@@ -187,8 +187,8 @@ __all__ = ["ErnieEmbeddings","FakeEmbeddings","FastEmbedEmbeddings",- "GooglePalmEmbeddings","GPT4AllEmbeddings",+ "GooglePalmEmbeddings","GradientEmbeddings","HuggingFaceBgeEmbeddings","HuggingFaceEmbeddings",diff --git a/libs/langchain/langchain/embeddings/base.py b/libs/langchain/langchain/embeddings/base.pyindex eea04a10f9..40f50418ae 100644--- a/libs/langchain/langchain/embeddings/base.py+++ b/libs/langchain/langchain/embeddings/base.py@@ -229,6 +229,6 @@ def init_embeddings(__all__ = [- "init_embeddings","Embeddings", # This one is for backwards compatibility+ "init_embeddings",]diff --git a/libs/langchain/langchain/embeddings/fake.py b/libs/langchain/langchain/embeddings/fake.pyindex 8b17af0cb9..9ba9421e3e 100644--- a/libs/langchain/langchain/embeddings/fake.py+++ b/libs/langchain/langchain/embeddings/fake.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "FakeEmbeddings","DeterministicFakeEmbedding",+ "FakeEmbeddings",]diff --git a/libs/langchain/langchain/embeddings/huggingface.py b/libs/langchain/langchain/embeddings/huggingface.pyindex 5627bbedbb..d473ae9fbc 100644--- a/libs/langchain/langchain/embeddings/huggingface.py+++ b/libs/langchain/langchain/embeddings/huggingface.py@@ -29,8 +29,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "HuggingFaceEmbeddings",- "HuggingFaceInstructEmbeddings","HuggingFaceBgeEmbeddings",+ "HuggingFaceEmbeddings","HuggingFaceInferenceAPIEmbeddings",+ "HuggingFaceInstructEmbeddings",]diff --git a/libs/langchain/langchain/evaluation/__init__.py b/libs/langchain/langchain/evaluation/__init__.pyindex df95a44ea2..22afbccf4e 100644--- a/libs/langchain/langchain/evaluation/__init__.py+++ b/libs/langchain/langchain/evaluation/__init__.py@@ -95,34 +95,34 @@ from langchain.evaluation.string_distance import ()__all__ = [- "EvaluatorType",- "ExactMatchStringEvaluator",- "RegexMatchStringEvaluator",- "PairwiseStringEvalChain",- "LabeledPairwiseStringEvalChain",- "QAEvalChain",- "CotQAEvalChain",+ "AgentTrajectoryEvaluator","ContextQAEvalChain",- "StringEvaluator",- "PairwiseStringEvaluator",- "TrajectoryEvalChain",- "CriteriaEvalChain",+ "CotQAEvalChain","Criteria",+ "CriteriaEvalChain","EmbeddingDistance","EmbeddingDistanceEvalChain",+ "EvaluatorType",+ "ExactMatchStringEvaluator",+ "JsonEditDistanceEvaluator",+ "JsonEqualityEvaluator",+ "JsonSchemaEvaluator",+ "JsonValidityEvaluator",+ "LabeledCriteriaEvalChain",+ "LabeledPairwiseStringEvalChain",+ "LabeledScoreStringEvalChain","PairwiseEmbeddingDistanceEvalChain",+ "PairwiseStringDistanceEvalChain",+ "PairwiseStringEvalChain",+ "PairwiseStringEvaluator",+ "QAEvalChain",+ "RegexMatchStringEvaluator",+ "ScoreStringEvalChain","StringDistance","StringDistanceEvalChain",- "PairwiseStringDistanceEvalChain",- "LabeledCriteriaEvalChain",- "load_evaluators",- "load_evaluator",+ "StringEvaluator",+ "TrajectoryEvalChain","load_dataset",- "AgentTrajectoryEvaluator",- "ScoreStringEvalChain",- "LabeledScoreStringEvalChain",- "JsonValidityEvaluator",- "JsonEqualityEvaluator",- "JsonEditDistanceEvaluator",- "JsonSchemaEvaluator",+ "load_evaluator",+ "load_evaluators",]diff --git a/libs/langchain/langchain/evaluation/comparison/__init__.py b/libs/langchain/langchain/evaluation/comparison/__init__.pyindex 2835991375..2b2d5c47e2 100644--- a/libs/langchain/langchain/evaluation/comparison/__init__.py+++ b/libs/langchain/langchain/evaluation/comparison/__init__.py@@ -33,4 +33,4 @@ from langchain.evaluation.comparison.eval_chain import (PairwiseStringEvalChain,)-__all__ = ["PairwiseStringEvalChain", "LabeledPairwiseStringEvalChain"]+__all__ = ["LabeledPairwiseStringEvalChain", "PairwiseStringEvalChain"]diff --git a/libs/langchain/langchain/evaluation/criteria/__init__.py b/libs/langchain/langchain/evaluation/criteria/__init__.pyindex 6440c8c0ea..e8ab983bab 100644--- a/libs/langchain/langchain/evaluation/criteria/__init__.py+++ b/libs/langchain/langchain/evaluation/criteria/__init__.py@@ -53,4 +53,4 @@ from langchain.evaluation.criteria.eval_chain import (LabeledCriteriaEvalChain,)-__all__ = ["CriteriaEvalChain", "LabeledCriteriaEvalChain", "Criteria"]+__all__ = ["Criteria", "CriteriaEvalChain", "LabeledCriteriaEvalChain"]diff --git a/libs/langchain/langchain/evaluation/qa/__init__.py b/libs/langchain/langchain/evaluation/qa/__init__.pyindex 4677fa1f44..15b33219cc 100644--- a/libs/langchain/langchain/evaluation/qa/__init__.py+++ b/libs/langchain/langchain/evaluation/qa/__init__.py@@ -7,4 +7,4 @@ from langchain.evaluation.qa.eval_chain import ()from langchain.evaluation.qa.generate_chain import QAGenerateChain-__all__ = ["QAEvalChain", "QAGenerateChain", "ContextQAEvalChain", "CotQAEvalChain"]+__all__ = ["ContextQAEvalChain", "CotQAEvalChain", "QAEvalChain", "QAGenerateChain"]diff --git a/libs/langchain/langchain/evaluation/scoring/__init__.py b/libs/langchain/langchain/evaluation/scoring/__init__.pyindex 29b414bcdf..0d780659f6 100644--- a/libs/langchain/langchain/evaluation/scoring/__init__.py+++ b/libs/langchain/langchain/evaluation/scoring/__init__.py@@ -28,4 +28,4 @@ from langchain.evaluation.scoring.eval_chain import (ScoreStringEvalChain,)-__all__ = ["ScoreStringEvalChain", "LabeledScoreStringEvalChain"]+__all__ = ["LabeledScoreStringEvalChain", "ScoreStringEvalChain"]diff --git a/libs/langchain/langchain/evaluation/scoring/eval_chain.py b/libs/langchain/langchain/evaluation/scoring/eval_chain.pyindex aa3d307fb5..4ae86e0054 100644--- a/libs/langchain/langchain/evaluation/scoring/eval_chain.py+++ b/libs/langchain/langchain/evaluation/scoring/eval_chain.py@@ -133,7 +133,7 @@ class ScoreStringResultOutputParser(BaseOutputParser[dict]):if match:verdict = match.group(1)- if not match or verdict not in list("123456789") + ["10"]:+ if not match or verdict not in [*list("123456789"), "10"]:msg = (f"Invalid output: {text}. ""Output must contain a double bracketed string\diff --git a/libs/langchain/langchain/graphs/__init__.py b/libs/langchain/langchain/graphs/__init__.pyindex 58210016b2..cf645c6b08 100644--- a/libs/langchain/langchain/graphs/__init__.py+++ b/libs/langchain/langchain/graphs/__init__.py@@ -44,14 +44,14 @@ def __getattr__(name: str) -> Any:__all__ = [+ "ArangoGraph",+ "FalkorDBGraph",+ "HugeGraph",+ "KuzuGraph","MemgraphGraph",- "NetworkxEntityGraph",- "Neo4jGraph","NebulaGraph",+ "Neo4jGraph","NeptuneGraph",- "KuzuGraph",- "HugeGraph",+ "NetworkxEntityGraph","RdfGraph",- "ArangoGraph",- "FalkorDBGraph",]diff --git a/libs/langchain/langchain/graphs/graph_document.py b/libs/langchain/langchain/graphs/graph_document.pyindex 6848bca961..c2520be464 100644--- a/libs/langchain/langchain/graphs/graph_document.py+++ b/libs/langchain/langchain/graphs/graph_document.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "GraphDocument","Node","Relationship",- "GraphDocument",]diff --git a/libs/langchain/langchain/graphs/networkx_graph.py b/libs/langchain/langchain/graphs/networkx_graph.pyindex 1b360f15b8..b084239435 100644--- a/libs/langchain/langchain/graphs/networkx_graph.py+++ b/libs/langchain/langchain/graphs/networkx_graph.py@@ -30,7 +30,7 @@ def __getattr__(name: str) -> Any:__all__ = ["KnowledgeTriple",- "parse_triples",- "get_entities","NetworkxEntityGraph",+ "get_entities",+ "parse_triples",]diff --git a/libs/langchain/langchain/indexes/__init__.py b/libs/langchain/langchain/indexes/__init__.pyindex 11b95a38e3..c4e282cfdf 100644--- a/libs/langchain/langchain/indexes/__init__.py+++ b/libs/langchain/langchain/indexes/__init__.py@@ -40,11 +40,11 @@ def __getattr__(name: str) -> Any:__all__ = [- # Keep sorted- "aindex","GraphIndexCreator",- "index","IndexingResult","SQLRecordManager","VectorstoreIndexCreator",+ # Keep sorted+ "aindex",+ "index",]diff --git a/libs/langchain/langchain/llms/__init__.py b/libs/langchain/langchain/llms/__init__.pyindex 30337d8f36..f108db5fe8 100644--- a/libs/langchain/langchain/llms/__init__.py+++ b/libs/langchain/langchain/llms/__init__.py@@ -566,6 +566,8 @@ def __getattr__(name: str) -> Any:__all__ = ["AI21",+ "RWKV",+ "VLLM","AlephAlpha","AmazonAPIGateway","Anthropic",@@ -591,8 +593,8 @@ __all__ = ["FakeListLLM","Fireworks","ForefrontAI",- "GigaChat","GPT4All",+ "GigaChat","GooglePalm","GooseAI","GradientLLM",@@ -601,18 +603,20 @@ __all__ = ["HuggingFacePipeline","HuggingFaceTextGenInference","HumanInputLLM",+ "JavelinAIGateway","KoboldApiLLM","LlamaCpp",- "TextGen","ManifestWrapper","Minimax","MlflowAIGateway","Modal","MosaicML",- "Nebula","NIBittensorLLM","NLPCloud",+ "Nebula",+ "OctoAIEndpoint","Ollama",+ "OpaquePrompts","OpenAI","OpenAIChat","OpenLLM",@@ -624,28 +628,24 @@ __all__ = ["PredictionGuard","PromptLayerOpenAI","PromptLayerOpenAIChat",- "OpaquePrompts",- "RWKV",+ "QianfanLLMEndpoint","Replicate","SagemakerEndpoint","SelfHostedHuggingFaceLLM","SelfHostedPipeline","StochasticAI",+ "TextGen","TitanTakeoff","TitanTakeoffPro","Tongyi",+ "VLLMOpenAI","VertexAI","VertexAIModelGarden",- "VLLM",- "VLLMOpenAI",+ "VolcEngineMaasLLM","WatsonxLLM","Writer",- "OctoAIEndpoint","Xinference",- "JavelinAIGateway",- "QianfanLLMEndpoint","YandexGPT",- "VolcEngineMaasLLM",]diff --git a/libs/langchain/langchain/llms/ai21.py b/libs/langchain/langchain/llms/ai21.pyindex 7bdb2168cd..306d203618 100644--- a/libs/langchain/langchain/llms/ai21.py+++ b/libs/langchain/langchain/llms/ai21.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "AI21PenaltyData","AI21",+ "AI21PenaltyData",]diff --git a/libs/langchain/langchain/llms/azureml_endpoint.py b/libs/langchain/langchain/llms/azureml_endpoint.pyindex 6b47cfbb87..cbe04f1cde 100644--- a/libs/langchain/langchain/llms/azureml_endpoint.py+++ b/libs/langchain/langchain/llms/azureml_endpoint.py@@ -38,11 +38,11 @@ def __getattr__(name: str) -> Any:__all__ = ["AzureMLEndpointClient",+ "AzureMLOnlineEndpoint","ContentFormatterBase",+ "CustomOpenAIContentFormatter",+ "DollyContentFormatter","GPT2ContentFormatter",- "OSSContentFormatter","HFContentFormatter",- "DollyContentFormatter",- "CustomOpenAIContentFormatter",- "AzureMLOnlineEndpoint",+ "OSSContentFormatter",]diff --git a/libs/langchain/langchain/llms/base.py b/libs/langchain/langchain/llms/base.pyindex 85bd0dd232..335fbadbcf 100644--- a/libs/langchain/langchain/llms/base.py+++ b/libs/langchain/langchain/llms/base.py@@ -6,7 +6,7 @@ from langchain_core.language_models.llms import ()__all__ = [- "BaseLanguageModel",- "BaseLLM","LLM",+ "BaseLLM",+ "BaseLanguageModel",]diff --git a/libs/langchain/langchain/llms/bedrock.py b/libs/langchain/langchain/llms/bedrock.pyindex 052bc8a7a7..c97f94be12 100644--- a/libs/langchain/langchain/llms/bedrock.py+++ b/libs/langchain/langchain/llms/bedrock.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "BedrockBase","Bedrock",+ "BedrockBase",]diff --git a/libs/langchain/langchain/llms/gradient_ai.py b/libs/langchain/langchain/llms/gradient_ai.pyindex 83dbd68697..5c286c62b6 100644--- a/libs/langchain/langchain/llms/gradient_ai.py+++ b/libs/langchain/langchain/llms/gradient_ai.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "TrainResult","GradientLLM",+ "TrainResult",]diff --git a/libs/langchain/langchain/llms/loading.py b/libs/langchain/langchain/llms/loading.pyindex 7517da6b94..2fde6e394e 100644--- a/libs/langchain/langchain/llms/loading.py+++ b/libs/langchain/langchain/llms/loading.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "load_llm_from_config","load_llm",+ "load_llm_from_config",]diff --git a/libs/langchain/langchain/llms/openai.py b/libs/langchain/langchain/llms/openai.pyindex 8f88b4b053..ead0be7a19 100644--- a/libs/langchain/langchain/llms/openai.py+++ b/libs/langchain/langchain/llms/openai.py@@ -25,8 +25,8 @@ def __getattr__(name: str) -> Any:__all__ = [+ "AzureOpenAI","BaseOpenAI","OpenAI",- "AzureOpenAI","OpenAIChat",]diff --git a/libs/langchain/langchain/llms/sagemaker_endpoint.py b/libs/langchain/langchain/llms/sagemaker_endpoint.pyindex 101f6e6655..beb467e42a 100644--- a/libs/langchain/langchain/llms/sagemaker_endpoint.py+++ b/libs/langchain/langchain/llms/sagemaker_endpoint.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SagemakerEndpoint","LLMContentHandler",+ "SagemakerEndpoint",]diff --git a/libs/langchain/langchain/load/dump.py b/libs/langchain/langchain/load/dump.pyindex fd9552018c..473f57ab09 100644--- a/libs/langchain/langchain/load/dump.py+++ b/libs/langchain/langchain/load/dump.py@@ -1,3 +1,3 @@from langchain_core.load.dump import default, dumpd, dumps-__all__ = ["default", "dumps", "dumpd"]+__all__ = ["default", "dumpd", "dumps"]diff --git a/libs/langchain/langchain/load/load.py b/libs/langchain/langchain/load/load.pyindex 5a32ea081f..2415a3db51 100644--- a/libs/langchain/langchain/load/load.py+++ b/libs/langchain/langchain/load/load.py@@ -1,3 +1,3 @@from langchain_core.load.load import Reviver, load, loads-__all__ = ["Reviver", "loads", "load"]+__all__ = ["Reviver", "load", "loads"]diff --git a/libs/langchain/langchain/load/serializable.py b/libs/langchain/langchain/load/serializable.pyindex d1c0772d61..d20850ad0b 100644--- a/libs/langchain/langchain/load/serializable.py+++ b/libs/langchain/langchain/load/serializable.py@@ -10,10 +10,10 @@ from langchain_core.load.serializable import (__all__ = ["BaseSerialized",+ "Serializable","SerializedConstructor",- "SerializedSecret","SerializedNotImplemented",- "try_neq_default",- "Serializable",+ "SerializedSecret","to_json_not_implemented",+ "try_neq_default",]diff --git a/libs/langchain/langchain/memory/__init__.py b/libs/langchain/langchain/memory/__init__.pyindex de0281c828..b47225522b 100644--- a/libs/langchain/langchain/memory/__init__.py+++ b/libs/langchain/langchain/memory/__init__.py@@ -139,15 +139,15 @@ __all__ = ["ReadOnlySharedMemory","RedisChatMessageHistory","RedisEntityStore",- "SingleStoreDBChatMessageHistory","SQLChatMessageHistory","SQLiteEntityStore","SimpleMemory",+ "SingleStoreDBChatMessageHistory","StreamlitChatMessageHistory",+ "UpstashRedisChatMessageHistory",+ "UpstashRedisEntityStore","VectorStoreRetrieverMemory","XataChatMessageHistory","ZepChatMessageHistory","ZepMemory",- "UpstashRedisEntityStore",- "UpstashRedisChatMessageHistory",]diff --git a/libs/langchain/langchain/memory/buffer.py b/libs/langchain/langchain/memory/buffer.pyindex 394acdf2bd..1bd8a48b88 100644--- a/libs/langchain/langchain/memory/buffer.py+++ b/libs/langchain/langchain/memory/buffer.py@@ -150,7 +150,7 @@ class ConversationStringBufferMemory(BaseMemory):if len(outputs) != 1:msg = f"One output key expected, got {outputs.keys()}"raise ValueError(msg)- output_key = list(outputs.keys())[0]+ output_key = next(iter(outputs.keys()))else:output_key = self.output_keyhuman = f"{self.human_prefix}: " + inputs[prompt_input_key]diff --git a/libs/langchain/langchain/memory/chat_memory.py b/libs/langchain/langchain/memory/chat_memory.pyindex f8bfde0db1..4a18ce8d44 100644--- a/libs/langchain/langchain/memory/chat_memory.py+++ b/libs/langchain/langchain/memory/chat_memory.py@@ -49,7 +49,7 @@ class BaseChatMemory(BaseMemory, ABC):prompt_input_key = self.input_keyif self.output_key is None:if len(outputs) == 1:- output_key = list(outputs.keys())[0]+ output_key = next(iter(outputs.keys()))elif "output" in outputs:output_key = "output"warnings.warn(diff --git a/libs/langchain/langchain/memory/chat_message_histories/__init__.py b/libs/langchain/langchain/memory/chat_message_histories/__init__.pyindex 91910137f6..367aee4f47 100644--- a/libs/langchain/langchain/memory/chat_message_histories/__init__.py+++ b/libs/langchain/langchain/memory/chat_message_histories/__init__.py@@ -75,8 +75,8 @@ __all__ = ["PostgresChatMessageHistory","RedisChatMessageHistory","RocksetChatMessageHistory",- "SingleStoreDBChatMessageHistory","SQLChatMessageHistory",+ "SingleStoreDBChatMessageHistory","StreamlitChatMessageHistory","UpstashRedisChatMessageHistory","XataChatMessageHistory",diff --git a/libs/langchain/langchain/memory/entity.py b/libs/langchain/langchain/memory/entity.pyindex c52eb5e6b8..861857fa2c 100644--- a/libs/langchain/langchain/memory/entity.py+++ b/libs/langchain/langchain/memory/entity.py@@ -348,7 +348,7 @@ class SQLiteEntityStore(BaseEntityStore):def get(self, key: str, default: Optional[str] = None) -> Optional[str]:"""Retrieves a value, safely quoting the table name."""# `?` placeholder is used for the value to prevent SQL injection- # noqa since we validate for malicious table/session names in `__init__`+ # Ignore S608 since we validate for malicious table/session names in `__init__`query = f'SELECT value FROM "{self.full_table_name}" WHERE key = ?' # noqa: S608cursor = self._execute_query(query, (key,))result = cursor.fetchone()@@ -358,7 +358,7 @@ class SQLiteEntityStore(BaseEntityStore):"""Inserts or replaces a value, safely quoting the table name."""if not value:return self.delete(key)- # noqa since we validate for malicious table/session names in `__init__`+ # Ignore S608 since we validate for malicious table/session names in `__init__`query = ("INSERT OR REPLACE INTO " # noqa: S608f'"{self.full_table_name}" (key, value) VALUES (?, ?)'@@ -368,19 +368,19 @@ class SQLiteEntityStore(BaseEntityStore):def delete(self, key: str) -> None:"""Deletes a key-value pair, safely quoting the table name."""- # noqa since we validate for malicious table/session names in `__init__`+ # Ignore S608 since we validate for malicious table/session names in `__init__`query = f'DELETE FROM "{self.full_table_name}" WHERE key = ?' # noqa: S608self._execute_query(query, (key,))def exists(self, key: str) -> bool:"""Checks for the existence of a key, safely quoting the table name."""- # noqa since we validate for malicious table/session names in `__init__`+ # Ignore S608 since we validate for malicious table/session names in `__init__`query = f'SELECT 1 FROM "{self.full_table_name}" WHERE key = ? LIMIT 1' # noqa: S608cursor = self._execute_query(query, (key,))return cursor.fetchone() is not Nonedef clear(self) -> None:- # noqa since we validate for malicious table/session names in `__init__`+ # Ignore S608 since we validate for malicious table/session names in `__init__`query = f"""DELETE FROM {self.full_table_name}""" # noqa: S608diff --git a/libs/langchain/langchain/memory/summary.py b/libs/langchain/langchain/memory/summary.pyindex c604704e39..98825a10c3 100644--- a/libs/langchain/langchain/memory/summary.py+++ b/libs/langchain/langchain/memory/summary.py@@ -22,7 +22,7 @@ from langchain.memory.prompt import SUMMARY_PROMPTremoval="1.0",message=("Refer here for how to incorporate summaries of conversation history: "- "https://langchain-ai.github.io/langgraph/how-tos/memory/add-summary-conversation-history/" # noqa: E501+ "https://langchain-ai.github.io/langgraph/how-tos/memory/add-summary-conversation-history/"),)class SummarizerMixin(BaseModel):diff --git a/libs/langchain/langchain/memory/utils.py b/libs/langchain/langchain/memory/utils.pyindex 79b0504415..6415d3b597 100644--- a/libs/langchain/langchain/memory/utils.py+++ b/libs/langchain/langchain/memory/utils.py@@ -14,7 +14,7 @@ def get_prompt_input_key(inputs: dict[str, Any], memory_variables: list[str]) ->"""# "stop" is a special key that can be passed as input but is not used to# format the prompt.- prompt_input_keys = list(set(inputs).difference(memory_variables + ["stop"]))+ prompt_input_keys = list(set(inputs).difference([*memory_variables, "stop"]))if len(prompt_input_keys) != 1:msg = f"One input key expected got {prompt_input_keys}"raise ValueError(msg)diff --git a/libs/langchain/langchain/memory/vectorstore_token_buffer_memory.py b/libs/langchain/langchain/memory/vectorstore_token_buffer_memory.pyindex 6235b9ed23..b839bb1d51 100644--- a/libs/langchain/langchain/memory/vectorstore_token_buffer_memory.py+++ b/libs/langchain/langchain/memory/vectorstore_token_buffer_memory.py@@ -167,7 +167,6 @@ class ConversationVectorStoreTokenBufferMemory(ConversationTokenBufferMemory):self._pop_and_store_interaction(buffer)def _pop_and_store_interaction(self, buffer: list[BaseMessage]) -> None:- input_ = buffer.pop(0)output = buffer.pop(0)timestamp = self._timestamps.pop(0).strftime(TIMESTAMP_FORMAT)# Split AI output into smaller chunks to avoid creating documents@@ -175,7 +174,7 @@ class ConversationVectorStoreTokenBufferMemory(ConversationTokenBufferMemory):ai_chunks = self._split_long_ai_text(str(output.content))for index, chunk in enumerate(ai_chunks):self.memory_retriever.save_context(- {"Human": f"<{timestamp}/00> {str(input_.content)}"},+ {"Human": f"<{timestamp}/00> {input.content!s}"},{"AI": f"<{timestamp}/{index:02}> {chunk}"},)diff --git a/libs/langchain/langchain/output_parsers/__init__.py b/libs/langchain/langchain/output_parsers/__init__.pyindex c06b7713c6..bff4ddb8f2 100644--- a/libs/langchain/langchain/output_parsers/__init__.py+++ b/libs/langchain/langchain/output_parsers/__init__.py@@ -67,12 +67,15 @@ __all__ = ["DatetimeOutputParser","EnumOutputParser","GuardrailsOutputParser",+ "JsonOutputKeyToolsParser",+ "JsonOutputToolsParser","ListOutputParser","MarkdownListOutputParser","NumberedListOutputParser","OutputFixingParser","PandasDataFrameOutputParser","PydanticOutputParser",+ "PydanticToolsParser","RegexDictParser","RegexParser","ResponseSchema",@@ -80,8 +83,5 @@ __all__ = ["RetryWithErrorOutputParser","StructuredOutputParser","XMLOutputParser",- "JsonOutputToolsParser",- "PydanticToolsParser",- "JsonOutputKeyToolsParser","YamlOutputParser",]diff --git a/libs/langchain/langchain/output_parsers/json.py b/libs/langchain/langchain/output_parsers/json.pyindex 20b06e3bca..a7b52d89e4 100644--- a/libs/langchain/langchain/output_parsers/json.py+++ b/libs/langchain/langchain/output_parsers/json.py@@ -9,7 +9,7 @@ from langchain_core.utils.json import (__all__ = ["SimpleJsonOutputParser",- "parse_partial_json",- "parse_json_markdown","parse_and_check_json_markdown",+ "parse_json_markdown",+ "parse_partial_json",]diff --git a/libs/langchain/langchain/output_parsers/list.py b/libs/langchain/langchain/output_parsers/list.pyindex b5ffd8a3ab..d8001bce75 100644--- a/libs/langchain/langchain/output_parsers/list.py+++ b/libs/langchain/langchain/output_parsers/list.py@@ -6,8 +6,8 @@ from langchain_core.output_parsers.list import ()__all__ = [- "ListOutputParser","CommaSeparatedListOutputParser",- "NumberedListOutputParser",+ "ListOutputParser","MarkdownListOutputParser",+ "NumberedListOutputParser",]diff --git a/libs/langchain/langchain/output_parsers/openai_functions.py b/libs/langchain/langchain/output_parsers/openai_functions.pyindex 800b66b652..607e347264 100644--- a/libs/langchain/langchain/output_parsers/openai_functions.py+++ b/libs/langchain/langchain/output_parsers/openai_functions.py@@ -6,8 +6,8 @@ from langchain_core.output_parsers.openai_functions import ()__all__ = [- "PydanticOutputFunctionsParser",- "PydanticAttrOutputFunctionsParser",- "JsonOutputFunctionsParser","JsonKeyOutputFunctionsParser",+ "JsonOutputFunctionsParser",+ "PydanticAttrOutputFunctionsParser",+ "PydanticOutputFunctionsParser",]diff --git a/libs/langchain/langchain/output_parsers/openai_tools.py b/libs/langchain/langchain/output_parsers/openai_tools.pyindex 57a1a66722..bf7b62e88f 100644--- a/libs/langchain/langchain/output_parsers/openai_tools.py+++ b/libs/langchain/langchain/output_parsers/openai_tools.py@@ -4,4 +4,4 @@ from langchain_core.output_parsers.openai_tools import (PydanticToolsParser,)-__all__ = ["PydanticToolsParser", "JsonOutputToolsParser", "JsonOutputKeyToolsParser"]+__all__ = ["JsonOutputKeyToolsParser", "JsonOutputToolsParser", "PydanticToolsParser"]diff --git a/libs/langchain/langchain/prompts/__init__.py b/libs/langchain/langchain/prompts/__init__.pyindex 63ace4e271..7a4ae58c78 100644--- a/libs/langchain/langchain/prompts/__init__.py+++ b/libs/langchain/langchain/prompts/__init__.py@@ -82,6 +82,7 @@ __all__ = ["BasePromptTemplate","ChatMessagePromptTemplate","ChatPromptTemplate",+ "FewShotChatMessagePromptTemplate","FewShotPromptTemplate","FewShotPromptWithTemplates","HumanMessagePromptTemplate",@@ -90,11 +91,10 @@ __all__ = ["MessagesPlaceholder","NGramOverlapExampleSelector","PipelinePromptTemplate",+ "Prompt","PromptTemplate","SemanticSimilarityExampleSelector","StringPromptTemplate","SystemMessagePromptTemplate","load_prompt",- "FewShotChatMessagePromptTemplate",- "Prompt",]diff --git a/libs/langchain/langchain/prompts/base.py b/libs/langchain/langchain/prompts/base.pyindex a315ec92d8..085bda5b93 100644--- a/libs/langchain/langchain/prompts/base.py+++ b/libs/langchain/langchain/prompts/base.py@@ -10,12 +10,12 @@ from langchain_core.prompts import (from langchain_core.prompts.string import _get_jinja2_variables_from_template__all__ = [- "jinja2_formatter",- "validate_jinja2",- "check_valid_template",- "get_template_variables",- "StringPromptTemplate","BasePromptTemplate",+ "StringPromptTemplate","StringPromptValue","_get_jinja2_variables_from_template",+ "check_valid_template",+ "get_template_variables",+ "jinja2_formatter",+ "validate_jinja2",]diff --git a/libs/langchain/langchain/prompts/chat.py b/libs/langchain/langchain/prompts/chat.pyindex cf3403e941..c79534b12c 100644--- a/libs/langchain/langchain/prompts/chat.py+++ b/libs/langchain/langchain/prompts/chat.py@@ -16,22 +16,22 @@ from langchain_core.prompts.chat import ()__all__ = [+ "AIMessagePromptTemplate",+ "BaseChatPromptTemplate","BaseMessagePromptTemplate",- "MessagesPlaceholder","BaseStringMessagePromptTemplate","ChatMessagePromptTemplate",- "HumanMessagePromptTemplate",- "AIMessagePromptTemplate",- "SystemMessagePromptTemplate",- "BaseChatPromptTemplate","ChatPromptTemplate","ChatPromptValue","ChatPromptValueConcrete",- "_convert_to_message",- "_create_template_from_message_type",- "MessagePromptTemplateT",+ "HumanMessagePromptTemplate","MessageLike","MessageLikeRepresentation",+ "MessagePromptTemplateT",+ "MessagesPlaceholder",+ "SystemMessagePromptTemplate",+ "_convert_to_message",+ "_create_template_from_message_type",]from langchain_core.prompts.message import BaseMessagePromptTemplatediff --git a/libs/langchain/langchain/prompts/example_selector/semantic_similarity.py b/libs/langchain/langchain/prompts/example_selector/semantic_similarity.pyindex e921236d87..4942632bce 100644--- a/libs/langchain/langchain/prompts/example_selector/semantic_similarity.py+++ b/libs/langchain/langchain/prompts/example_selector/semantic_similarity.py@@ -5,7 +5,7 @@ from langchain_core.example_selectors.semantic_similarity import ()__all__ = [- "sorted_values",- "SemanticSimilarityExampleSelector","MaxMarginalRelevanceExampleSelector",+ "SemanticSimilarityExampleSelector",+ "sorted_values",]diff --git a/libs/langchain/langchain/prompts/few_shot.py b/libs/langchain/langchain/prompts/few_shot.pyindex 67b3106271..d3f64d2140 100644--- a/libs/langchain/langchain/prompts/few_shot.py+++ b/libs/langchain/langchain/prompts/few_shot.py@@ -5,7 +5,7 @@ from langchain_core.prompts.few_shot import ()__all__ = [- "FewShotPromptTemplate","FewShotChatMessagePromptTemplate",+ "FewShotPromptTemplate","_FewShotPromptTemplateMixin",]diff --git a/libs/langchain/langchain/prompts/loading.py b/libs/langchain/langchain/prompts/loading.pyindex b1dfcd9069..ecc52f6892 100644--- a/libs/langchain/langchain/prompts/loading.py+++ b/libs/langchain/langchain/prompts/loading.py@@ -11,13 +11,13 @@ from langchain_core.prompts.loading import (from langchain_core.utils.loading import try_load_from_hub__all__ = [- "load_prompt_from_config",- "load_prompt",- "try_load_from_hub","_load_examples","_load_few_shot_prompt","_load_output_parser","_load_prompt","_load_prompt_from_file","_load_template",+ "load_prompt",+ "load_prompt_from_config",+ "try_load_from_hub",]diff --git a/libs/langchain/langchain/prompts/prompt.py b/libs/langchain/langchain/prompts/prompt.pyindex 5e35f878ba..e11c5a49bd 100644--- a/libs/langchain/langchain/prompts/prompt.py+++ b/libs/langchain/langchain/prompts/prompt.py@@ -3,4 +3,4 @@ from langchain_core.prompts.prompt import PromptTemplate# For backwards compatibility.Prompt = PromptTemplate-__all__ = ["PromptTemplate", "Prompt"]+__all__ = ["Prompt", "PromptTemplate"]diff --git a/libs/langchain/langchain/retrievers/__init__.py b/libs/langchain/langchain/retrievers/__init__.pyindex ba28b14cd7..4e5540a21c 100644--- a/libs/langchain/langchain/retrievers/__init__.py+++ b/libs/langchain/langchain/retrievers/__init__.py@@ -148,8 +148,8 @@ __all__ = ["GoogleDocumentAIWarehouseRetriever","GoogleVertexAIMultiTurnSearchRetriever","GoogleVertexAISearchRetriever",- "KayAiRetriever","KNNRetriever",+ "KayAiRetriever","LlamaIndexGraphRetriever","LlamaIndexRetriever","MergerRetriever",@@ -157,22 +157,22 @@ __all__ = ["MilvusRetriever","MultiQueryRetriever","MultiVectorRetriever",+ "NeuralDBRetriever","OutlineRetriever","ParentDocumentRetriever","PineconeHybridSearchRetriever","PubMedRetriever",- "RemoteLangChainRetriever","RePhraseQueryRetriever",- "SelfQueryRetriever",+ "RemoteLangChainRetriever","SVMRetriever",- "TavilySearchAPIRetriever",+ "SelfQueryRetriever","TFIDFRetriever",+ "TavilySearchAPIRetriever","TimeWeightedVectorStoreRetriever","VespaRetriever","WeaviateHybridSearchRetriever","WebResearchRetriever","WikipediaRetriever","ZepRetriever",- "NeuralDBRetriever","ZillizRetriever",]diff --git a/libs/langchain/langchain/retrievers/bedrock.py b/libs/langchain/langchain/retrievers/bedrock.pyindex 25558d924b..24237bff93 100644--- a/libs/langchain/langchain/retrievers/bedrock.py+++ b/libs/langchain/langchain/retrievers/bedrock.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "VectorSearchConfig",- "RetrievalConfig","AmazonKnowledgeBasesRetriever",+ "RetrievalConfig",+ "VectorSearchConfig",]diff --git a/libs/langchain/langchain/retrievers/bm25.py b/libs/langchain/langchain/retrievers/bm25.pyindex e5dc419522..0539c8f86b 100644--- a/libs/langchain/langchain/retrievers/bm25.py+++ b/libs/langchain/langchain/retrievers/bm25.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "default_preprocessing_func","BM25Retriever",+ "default_preprocessing_func",]diff --git a/libs/langchain/langchain/retrievers/docarray.py b/libs/langchain/langchain/retrievers/docarray.pyindex 7f433c5859..429f3fb81d 100644--- a/libs/langchain/langchain/retrievers/docarray.py+++ b/libs/langchain/langchain/retrievers/docarray.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearchType","DocArrayRetriever",+ "SearchType",]diff --git a/libs/langchain/langchain/retrievers/document_compressors/__init__.py b/libs/langchain/langchain/retrievers/document_compressors/__init__.pyindex c9590d7e67..2afd3a9260 100644--- a/libs/langchain/langchain/retrievers/document_compressors/__init__.py+++ b/libs/langchain/langchain/retrievers/document_compressors/__init__.py@@ -33,12 +33,12 @@ def __getattr__(name: str) -> Any:__all__ = [+ "CohereRerank",+ "CrossEncoderReranker","DocumentCompressorPipeline","EmbeddingsFilter","FlashrankRerank",- "LLMListwiseRerank","LLMChainExtractor","LLMChainFilter",- "CohereRerank",- "CrossEncoderReranker",+ "LLMListwiseRerank",]diff --git a/libs/langchain/langchain/retrievers/google_vertex_ai_search.py b/libs/langchain/langchain/retrievers/google_vertex_ai_search.pyindex 1f8a71de6c..71b167f59a 100644--- a/libs/langchain/langchain/retrievers/google_vertex_ai_search.py+++ b/libs/langchain/langchain/retrievers/google_vertex_ai_search.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "GoogleVertexAISearchRetriever",- "GoogleVertexAIMultiTurnSearchRetriever","GoogleCloudEnterpriseSearchRetriever",+ "GoogleVertexAIMultiTurnSearchRetriever",+ "GoogleVertexAISearchRetriever",]diff --git a/libs/langchain/langchain/retrievers/kendra.py b/libs/langchain/langchain/retrievers/kendra.pyindex 824c6569cf..1d68af913d 100644--- a/libs/langchain/langchain/retrievers/kendra.py+++ b/libs/langchain/langchain/retrievers/kendra.py@@ -49,18 +49,18 @@ def __getattr__(name: str) -> Any:__all__ = [- "clean_excerpt",- "combined_text",- "Highlight",- "TextWithHighLights",- "AdditionalResultAttributeValue","AdditionalResultAttribute",- "DocumentAttributeValue",+ "AdditionalResultAttributeValue",+ "AmazonKendraRetriever","DocumentAttribute",- "ResultItem",- "QueryResultItem",- "RetrieveResultItem",+ "DocumentAttributeValue",+ "Highlight","QueryResult",+ "QueryResultItem",+ "ResultItem","RetrieveResult",- "AmazonKendraRetriever",+ "RetrieveResultItem",+ "TextWithHighLights",+ "clean_excerpt",+ "combined_text",]diff --git a/libs/langchain/langchain/retrievers/llama_index.py b/libs/langchain/langchain/retrievers/llama_index.pyindex a86b9e0d3d..2551e8ca94 100644--- a/libs/langchain/langchain/retrievers/llama_index.py+++ b/libs/langchain/langchain/retrievers/llama_index.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "LlamaIndexRetriever","LlamaIndexGraphRetriever",+ "LlamaIndexRetriever",]diff --git a/libs/langchain/langchain/retrievers/milvus.py b/libs/langchain/langchain/retrievers/milvus.pyindex bd9fd8536b..e0db238c22 100644--- a/libs/langchain/langchain/retrievers/milvus.py+++ b/libs/langchain/langchain/retrievers/milvus.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "MilvusRetriever","MilvusRetreiver",+ "MilvusRetriever",]diff --git a/libs/langchain/langchain/retrievers/zilliz.py b/libs/langchain/langchain/retrievers/zilliz.pyindex 3b07c57c3b..32c40f5b58 100644--- a/libs/langchain/langchain/retrievers/zilliz.py+++ b/libs/langchain/langchain/retrievers/zilliz.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ZillizRetriever","ZillizRetreiver",+ "ZillizRetriever",]diff --git a/libs/langchain/langchain/schema/__init__.py b/libs/langchain/langchain/schema/__init__.pyindex 7853f3ec52..6c8c4f61a0 100644--- a/libs/langchain/langchain/schema/__init__.py+++ b/libs/langchain/langchain/schema/__init__.py@@ -43,40 +43,40 @@ Memory = BaseMemory_message_to_dict = message_to_dict__all__ = [- "BaseCache",- "BaseMemory",- "BaseStore",- "AgentFinish",+ "RUN_KEY",+ "AIMessage","AgentAction",- "Document",+ "AgentFinish",+ "BaseCache","BaseChatMessageHistory","BaseDocumentTransformer",+ "BaseLLMOutputParser",+ "BaseMemory","BaseMessage",+ "BaseOutputParser",+ "BasePromptTemplate",+ "BaseRetriever",+ "BaseStore",+ "ChatGeneration","ChatMessage",+ "ChatResult",+ "Document","FunctionMessage",+ "Generation","HumanMessage",- "AIMessage",- "SystemMessage",- "messages_from_dict",- "messages_to_dict",- "message_to_dict",- "_message_to_dict",- "_message_from_dict",- "get_buffer_string",- "RunInfo","LLMResult",- "ChatResult",- "ChatGeneration",- "Generation",- "PromptValue","LangChainException",- "BaseRetriever",- "RUN_KEY","Memory","OutputParserException",+ "PromptValue",+ "RunInfo","StrOutputParser",- "BaseOutputParser",- "BaseLLMOutputParser",- "BasePromptTemplate",+ "SystemMessage",+ "_message_from_dict",+ "_message_to_dict","format_document",+ "get_buffer_string",+ "message_to_dict",+ "messages_from_dict",+ "messages_to_dict",]diff --git a/libs/langchain/langchain/schema/cache.py b/libs/langchain/langchain/schema/cache.pyindex 8407af18c8..d74e1c4cae 100644--- a/libs/langchain/langchain/schema/cache.py+++ b/libs/langchain/langchain/schema/cache.py@@ -1,3 +1,3 @@from langchain_core.caches import RETURN_VAL_TYPE, BaseCache-__all__ = ["BaseCache", "RETURN_VAL_TYPE"]+__all__ = ["RETURN_VAL_TYPE", "BaseCache"]diff --git a/libs/langchain/langchain/schema/callbacks/base.py b/libs/langchain/langchain/schema/callbacks/base.pyindex ab2053a075..945344a223 100644--- a/libs/langchain/langchain/schema/callbacks/base.py+++ b/libs/langchain/langchain/schema/callbacks/base.py@@ -11,13 +11,13 @@ from langchain_core.callbacks.base import ()__all__ = [- "RetrieverManagerMixin",- "LLMManagerMixin",- "ChainManagerMixin",- "ToolManagerMixin",- "CallbackManagerMixin",- "RunManagerMixin",- "BaseCallbackHandler","AsyncCallbackHandler",+ "BaseCallbackHandler","BaseCallbackManager",+ "CallbackManagerMixin",+ "ChainManagerMixin",+ "LLMManagerMixin",+ "RetrieverManagerMixin",+ "RunManagerMixin",+ "ToolManagerMixin",]diff --git a/libs/langchain/langchain/schema/callbacks/manager.py b/libs/langchain/langchain/schema/callbacks/manager.pyindex a459e1bb69..221abe68c7 100644--- a/libs/langchain/langchain/schema/callbacks/manager.py+++ b/libs/langchain/langchain/schema/callbacks/manager.py@@ -28,28 +28,28 @@ from langchain_core.tracers.context import (from langchain_core.utils.env import env_var_is_set__all__ = [- "tracing_enabled",- "tracing_v2_enabled",- "collect_runs",- "trace_as_chain_group",- "handle_event",- "BaseRunManager",- "RunManager",- "ParentRunManager",- "AsyncRunManager",- "AsyncParentRunManager",- "CallbackManagerForLLMRun",- "AsyncCallbackManagerForLLMRun",- "CallbackManagerForChainRun",+ "AsyncCallbackManager",+ "AsyncCallbackManagerForChainGroup","AsyncCallbackManagerForChainRun",- "CallbackManagerForToolRun",- "AsyncCallbackManagerForToolRun",- "CallbackManagerForRetrieverRun",+ "AsyncCallbackManagerForLLMRun","AsyncCallbackManagerForRetrieverRun",+ "AsyncCallbackManagerForToolRun",+ "AsyncParentRunManager",+ "AsyncRunManager",+ "BaseRunManager","CallbackManager","CallbackManagerForChainGroup",- "AsyncCallbackManager",- "AsyncCallbackManagerForChainGroup",- "register_configure_hook",+ "CallbackManagerForChainRun",+ "CallbackManagerForLLMRun",+ "CallbackManagerForRetrieverRun",+ "CallbackManagerForToolRun",+ "ParentRunManager",+ "RunManager",+ "collect_runs","env_var_is_set",+ "handle_event",+ "register_configure_hook",+ "trace_as_chain_group",+ "tracing_enabled",+ "tracing_v2_enabled",]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/base.py b/libs/langchain/langchain/schema/callbacks/tracers/base.pyindex 833f30d4df..6288d12655 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/base.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/base.py@@ -1,4 +1,4 @@from langchain_core.exceptions import TracerExceptionfrom langchain_core.tracers.base import BaseTracer-__all__ = ["TracerException", "BaseTracer"]+__all__ = ["BaseTracer", "TracerException"]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/evaluation.py b/libs/langchain/langchain/schema/callbacks/tracers/evaluation.pyindex 363c74fcc8..4c7dd113fe 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/evaluation.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/evaluation.py@@ -3,4 +3,4 @@ from langchain_core.tracers.evaluation import (wait_for_all_evaluators,)-__all__ = ["wait_for_all_evaluators", "EvaluatorCallbackHandler"]+__all__ = ["EvaluatorCallbackHandler", "wait_for_all_evaluators"]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/langchain.py b/libs/langchain/langchain/schema/callbacks/tracers/langchain.pyindex 8415dfab94..dc8b0f0d05 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/langchain.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/langchain.py@@ -5,4 +5,4 @@ from langchain_core.tracers.langchain import (wait_for_all_tracers,)-__all__ = ["log_error_once", "wait_for_all_tracers", "get_client", "LangChainTracer"]+__all__ = ["LangChainTracer", "get_client", "log_error_once", "wait_for_all_tracers"]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/langchain_v1.py b/libs/langchain/langchain/schema/callbacks/tracers/langchain_v1.pyindex fca2d7590f..c0668cd2ef 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/langchain_v1.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/langchain_v1.py@@ -1,3 +1,3 @@from langchain_core.tracers.langchain_v1 import LangChainTracerV1, get_headers-__all__ = ["get_headers", "LangChainTracerV1"]+__all__ = ["LangChainTracerV1", "get_headers"]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/log_stream.py b/libs/langchain/langchain/schema/callbacks/tracers/log_stream.pyindex ef3dd946d6..54cc24935f 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/log_stream.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/log_stream.py@@ -6,4 +6,4 @@ from langchain_core.tracers.log_stream import (RunState,)-__all__ = ["LogEntry", "RunState", "RunLogPatch", "RunLog", "LogStreamCallbackHandler"]+__all__ = ["LogEntry", "LogStreamCallbackHandler", "RunLog", "RunLogPatch", "RunState"]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/schemas.py b/libs/langchain/langchain/schema/callbacks/tracers/schemas.pyindex 6fb49dbf72..e8f34027d3 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/schemas.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/schemas.py@@ -13,15 +13,15 @@ from langchain_core.tracers.schemas import ()__all__ = [- "RunTypeEnum",- "TracerSessionV1Base",- "TracerSessionV1Create",- "TracerSessionV1",- "TracerSessionBase",- "TracerSession","BaseRun",- "LLMRun","ChainRun",- "ToolRun",+ "LLMRun","Run",+ "RunTypeEnum",+ "ToolRun",+ "TracerSession",+ "TracerSessionBase",+ "TracerSessionV1",+ "TracerSessionV1Base",+ "TracerSessionV1Create",]diff --git a/libs/langchain/langchain/schema/callbacks/tracers/stdout.py b/libs/langchain/langchain/schema/callbacks/tracers/stdout.pyindex b2ef6fdcfe..fdd6b80cd2 100644--- a/libs/langchain/langchain/schema/callbacks/tracers/stdout.py+++ b/libs/langchain/langchain/schema/callbacks/tracers/stdout.py@@ -6,8 +6,8 @@ from langchain_core.tracers.stdout import ()__all__ = [- "try_json_stringify",- "elapsed",- "FunctionCallbackHandler","ConsoleCallbackHandler",+ "FunctionCallbackHandler",+ "elapsed",+ "try_json_stringify",]diff --git a/libs/langchain/langchain/schema/document.py b/libs/langchain/langchain/schema/document.pyindex 8b5b254be9..266f6afbae 100644--- a/libs/langchain/langchain/schema/document.py+++ b/libs/langchain/langchain/schema/document.py@@ -1,3 +1,3 @@from langchain_core.documents import BaseDocumentTransformer, Document-__all__ = ["Document", "BaseDocumentTransformer"]+__all__ = ["BaseDocumentTransformer", "Document"]diff --git a/libs/langchain/langchain/schema/language_model.py b/libs/langchain/langchain/schema/language_model.pyindex 63a0292bed..99e5921dd8 100644--- a/libs/langchain/langchain/schema/language_model.py+++ b/libs/langchain/langchain/schema/language_model.py@@ -7,9 +7,9 @@ from langchain_core.language_models import (from langchain_core.language_models.base import _get_token_ids_default_method__all__ = [- "get_tokenizer","BaseLanguageModel",- "_get_token_ids_default_method","LanguageModelInput","LanguageModelOutput",+ "_get_token_ids_default_method",+ "get_tokenizer",]diff --git a/libs/langchain/langchain/schema/messages.py b/libs/langchain/langchain/schema/messages.pyindex 2c42e6091e..0cae2fa4a8 100644--- a/libs/langchain/langchain/schema/messages.py+++ b/libs/langchain/langchain/schema/messages.py@@ -26,26 +26,26 @@ from langchain_core.messages import (_message_to_dict = message_to_dict__all__ = [- "get_buffer_string",+ "AIMessage",+ "AIMessageChunk",+ "AnyMessage","BaseMessage",- "merge_content","BaseMessageChunk",+ "ChatMessage",+ "ChatMessageChunk",+ "FunctionMessage",+ "FunctionMessageChunk","HumanMessage","HumanMessageChunk",- "AIMessage",- "AIMessageChunk","SystemMessage","SystemMessageChunk",- "FunctionMessage",- "FunctionMessageChunk","ToolMessage","ToolMessageChunk",- "ChatMessage",- "ChatMessageChunk",- "messages_to_dict",- "messages_from_dict",- "_message_to_dict","_message_from_dict",+ "_message_to_dict",+ "get_buffer_string",+ "merge_content","message_to_dict",- "AnyMessage",+ "messages_from_dict",+ "messages_to_dict",]diff --git a/libs/langchain/langchain/schema/output.py b/libs/langchain/langchain/schema/output.pyindex 970986df56..bb08d5751e 100644--- a/libs/langchain/langchain/schema/output.py+++ b/libs/langchain/langchain/schema/output.py@@ -9,11 +9,11 @@ from langchain_core.outputs import ()__all__ = [- "Generation",- "GenerationChunk","ChatGeneration","ChatGenerationChunk",- "RunInfo","ChatResult",+ "Generation",+ "GenerationChunk","LLMResult",+ "RunInfo",]diff --git a/libs/langchain/langchain/schema/output_parser.py b/libs/langchain/langchain/schema/output_parser.pyindex b0d8e03a7b..0b2652cafd 100644--- a/libs/langchain/langchain/schema/output_parser.py+++ b/libs/langchain/langchain/schema/output_parser.py@@ -13,13 +13,13 @@ from langchain_core.output_parsers.base import TNoOpOutputParser = StrOutputParser__all__ = [- "BaseLLMOutputParser",+ "BaseCumulativeTransformOutputParser","BaseGenerationOutputParser",+ "BaseLLMOutputParser","BaseOutputParser","BaseTransformOutputParser",- "BaseCumulativeTransformOutputParser","NoOpOutputParser",- "StrOutputParser","OutputParserException",+ "StrOutputParser","T",]diff --git a/libs/langchain/langchain/schema/runnable/__init__.py b/libs/langchain/langchain/schema/runnable/__init__.pyindex c76c6ffb93..995bf67121 100644--- a/libs/langchain/langchain/schema/runnable/__init__.py+++ b/libs/langchain/langchain/schema/runnable/__init__.py@@ -38,13 +38,11 @@ from langchain_core.runnables.utils import (__all__ = ["ConfigurableField",- "ConfigurableFieldSingleOption","ConfigurableFieldMultiOption",- "patch_config",+ "ConfigurableFieldSingleOption","RouterInput","RouterRunnable","Runnable",- "RunnableSerializable","RunnableBinding","RunnableBranch","RunnableConfig",@@ -54,5 +52,7 @@ __all__ = ["RunnableParallel","RunnablePassthrough","RunnableSequence",+ "RunnableSerializable","RunnableWithFallbacks",+ "patch_config",]diff --git a/libs/langchain/langchain/schema/runnable/base.py b/libs/langchain/langchain/schema/runnable/base.pyindex c9bde22100..c55cc4130d 100644--- a/libs/langchain/langchain/schema/runnable/base.py+++ b/libs/langchain/langchain/schema/runnable/base.py@@ -20,19 +20,19 @@ RunnableMap = RunnableParallel__all__ = ["Input",- "Output",- "RunnableLike","Other",+ "Output","Runnable",- "RunnableSerializable",- "RunnableSequence",- "RunnableParallel",+ "RunnableBinding",+ "RunnableBindingBase",+ "RunnableEach",+ "RunnableEachBase","RunnableGenerator","RunnableLambda",- "RunnableEachBase",- "RunnableEach",- "RunnableBindingBase",- "RunnableBinding",+ "RunnableLike","RunnableMap",+ "RunnableParallel",+ "RunnableSequence",+ "RunnableSerializable","coerce_to_runnable",]diff --git a/libs/langchain/langchain/schema/runnable/config.py b/libs/langchain/langchain/schema/runnable/config.pyindex af0179f975..88caa14b01 100644--- a/libs/langchain/langchain/schema/runnable/config.py+++ b/libs/langchain/langchain/schema/runnable/config.py@@ -15,13 +15,13 @@ from langchain_core.runnables.config import (__all__ = ["EmptyDict","RunnableConfig",- "ensure_config",- "get_config_list",- "patch_config",- "merge_configs","acall_func_with_variable_args","call_func_with_variable_args",- "get_callback_manager_for_config",+ "ensure_config","get_async_callback_manager_for_config",+ "get_callback_manager_for_config",+ "get_config_list","get_executor_for_config",+ "merge_configs",+ "patch_config",]diff --git a/libs/langchain/langchain/schema/runnable/configurable.py b/libs/langchain/langchain/schema/runnable/configurable.pyindex a1463d5746..4e0ac78e56 100644--- a/libs/langchain/langchain/schema/runnable/configurable.py+++ b/libs/langchain/langchain/schema/runnable/configurable.py@@ -8,8 +8,8 @@ from langchain_core.runnables.configurable import (__all__ = ["DynamicRunnable",+ "RunnableConfigurableAlternatives","RunnableConfigurableFields","StrEnum",- "RunnableConfigurableAlternatives","make_options_spec",]diff --git a/libs/langchain/langchain/schema/runnable/history.py b/libs/langchain/langchain/schema/runnable/history.pyindex 423b192be6..54fde64862 100644--- a/libs/langchain/langchain/schema/runnable/history.py+++ b/libs/langchain/langchain/schema/runnable/history.py@@ -5,7 +5,7 @@ from langchain_core.runnables.history import ()__all__ = [- "RunnableWithMessageHistory","GetSessionHistoryCallable","MessagesOrDictWithMessages",+ "RunnableWithMessageHistory",]diff --git a/libs/langchain/langchain/schema/runnable/passthrough.py b/libs/langchain/langchain/schema/runnable/passthrough.pyindex aed683d384..b9a4d84b3e 100644--- a/libs/langchain/langchain/schema/runnable/passthrough.py+++ b/libs/langchain/langchain/schema/runnable/passthrough.py@@ -5,4 +5,4 @@ from langchain_core.runnables.passthrough import (identity,)-__all__ = ["aidentity", "identity", "RunnablePassthrough", "RunnableAssign"]+__all__ = ["RunnableAssign", "RunnablePassthrough", "aidentity", "identity"]diff --git a/libs/langchain/langchain/schema/runnable/utils.py b/libs/langchain/langchain/schema/runnable/utils.pyindex 1a03a6afbc..7e9ce44567 100644--- a/libs/langchain/langchain/schema/runnable/utils.py+++ b/libs/langchain/langchain/schema/runnable/utils.py@@ -25,27 +25,27 @@ from langchain_core.runnables.utils import ()__all__ = [- "accepts_run_manager",- "accepts_config",- "IsLocalDict",- "IsFunctionArgDict",- "GetLambdaSource",- "get_function_first_arg_dict_keys",- "get_lambda_source",- "indent_lines_after_first",+ "Addable","AddableDict",- "SupportsAdd",- "add",+ "AnyConfigurableField","ConfigurableField",- "ConfigurableFieldSingleOption","ConfigurableFieldMultiOption",+ "ConfigurableFieldSingleOption","ConfigurableFieldSpec",- "get_unique_config_specs",+ "GetLambdaSource",+ "Input",+ "IsFunctionArgDict",+ "IsLocalDict",+ "Output",+ "SupportsAdd","aadd",+ "accepts_config",+ "accepts_run_manager",+ "add","gated_coro","gather_with_concurrency",- "Input",- "Output",- "Addable",- "AnyConfigurableField",+ "get_function_first_arg_dict_keys",+ "get_lambda_source",+ "get_unique_config_specs",+ "indent_lines_after_first",]diff --git a/libs/langchain/langchain/schema/vectorstore.py b/libs/langchain/langchain/schema/vectorstore.pyindex 776dbce00d..4accfef0b8 100644--- a/libs/langchain/langchain/schema/vectorstore.py+++ b/libs/langchain/langchain/schema/vectorstore.py@@ -1,3 +1,3 @@from langchain_core.vectorstores import VST, VectorStore, VectorStoreRetriever-__all__ = ["VectorStore", "VectorStoreRetriever", "VST"]+__all__ = ["VST", "VectorStore", "VectorStoreRetriever"]diff --git a/libs/langchain/langchain/smith/__init__.py b/libs/langchain/langchain/smith/__init__.pyindex 2c6c1af61c..ffdf2dd4d1 100644--- a/libs/langchain/langchain/smith/__init__.py+++ b/libs/langchain/langchain/smith/__init__.py@@ -96,7 +96,7 @@ from langchain.smith.evaluation import ()__all__ = [+ "RunEvalConfig","arun_on_dataset","run_on_dataset",- "RunEvalConfig",]diff --git a/libs/langchain/langchain/smith/evaluation/__init__.py b/libs/langchain/langchain/smith/evaluation/__init__.pyindex 125dfdcfce..56e4a11708 100644--- a/libs/langchain/langchain/smith/evaluation/__init__.py+++ b/libs/langchain/langchain/smith/evaluation/__init__.py@@ -61,8 +61,8 @@ from langchain.smith.evaluation.string_run_evaluator import StringRunEvaluatorCh__all__ = ["InputFormatError",+ "RunEvalConfig",+ "StringRunEvaluatorChain","arun_on_dataset","run_on_dataset",- "StringRunEvaluatorChain",- "RunEvalConfig",]diff --git a/libs/langchain/langchain/smith/evaluation/runner_utils.py b/libs/langchain/langchain/smith/evaluation/runner_utils.pyindex d65d9e6a51..45546f864c 100644--- a/libs/langchain/langchain/smith/evaluation/runner_utils.py+++ b/libs/langchain/langchain/smith/evaluation/runner_utils.py@@ -512,7 +512,7 @@ def _determine_reference_key()raise ValueError(msg)elif example_outputs and len(example_outputs) == 1:- reference_key = list(example_outputs)[0]+ reference_key = next(iter(example_outputs))else:reference_key = Nonereturn reference_key@@ -693,9 +693,8 @@ async def _arun_llm("""if input_mapper is not None:prompt_or_messages = input_mapper(inputs)- if (- isinstance(prompt_or_messages, str)- or isinstance(prompt_or_messages, list)+ if isinstance(prompt_or_messages, str) or (+ isinstance(prompt_or_messages, list)and all(isinstance(msg, BaseMessage) for msg in prompt_or_messages)):return await llm.ainvoke(@@ -810,7 +809,7 @@ async def _arun_llm_or_chain(logger.warning(f"{chain_or_llm} failed for example {example.id} "f"with inputs {example.inputs}"- f"\n{repr(e)}"+ f"\n{e!r}")result = EvalError(Error=e)return result@@ -846,9 +845,8 @@ def _run_llm(# Most of this is legacy code; we could probably remove a lot of it.if input_mapper is not None:prompt_or_messages = input_mapper(inputs)- if (- isinstance(prompt_or_messages, str)- or isinstance(prompt_or_messages, list)+ if isinstance(prompt_or_messages, str) or (+ isinstance(prompt_or_messages, list)and all(isinstance(msg, BaseMessage) for msg in prompt_or_messages)):llm_output: Union[str, BaseMessage] = llm.invoke(@@ -1094,9 +1092,7 @@ class _DatasetRunContainer:project_id=self.project.id,)except Exception as e:- logger.error(- f"Error running batch evaluator {repr(evaluator)}: {e}"- )+ logger.error(f"Error running batch evaluator {evaluator!r}: {e}")return aggregate_feedbackdef _collect_metrics(self) -> tuple[dict[str, _RowResult], dict[str, Run]]:@@ -1157,14 +1153,14 @@ class _DatasetRunContainer:agg_feedback = results.get_aggregate_feedback()_display_aggregate_results(agg_feedback)except Exception as e:- logger.debug(f"Failed to print aggregate feedback: {repr(e)}")+ logger.debug(f"Failed to print aggregate feedback: {e!r}")try:# Closing the project permits name changing and metric optimizationsself.client.update_project(self.project.id, end_time=datetime.now(timezone.utc))except Exception as e:- logger.debug(f"Failed to close project: {repr(e)}")+ logger.debug(f"Failed to close project: {e!r}")return results@classmethoddiff --git a/libs/langchain/langchain/smith/evaluation/string_run_evaluator.py b/libs/langchain/langchain/smith/evaluation/string_run_evaluator.pyindex d08d029165..0c07887b97 100644--- a/libs/langchain/langchain/smith/evaluation/string_run_evaluator.py+++ b/libs/langchain/langchain/smith/evaluation/string_run_evaluator.py@@ -219,7 +219,7 @@ class StringExampleMapper(Serializable):" specify a reference_key.")raise ValueError(msg)- output = list(example.outputs.values())[0]+ output = next(iter(example.outputs.values()))elif self.reference_key not in example.outputs:msg = (f"Example {example.id} does not have reference key"diff --git a/libs/langchain/langchain/storage/__init__.py b/libs/langchain/langchain/storage/__init__.pyindex 1ccdfab2d0..095638630b 100644--- a/libs/langchain/langchain/storage/__init__.py+++ b/libs/langchain/langchain/storage/__init__.py@@ -44,8 +44,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "create_kv_docstore",- "create_lc_store","EncoderBackedStore","InMemoryByteStore","InMemoryStore",@@ -54,4 +52,6 @@ __all__ = ["RedisStore","UpstashRedisByteStore","UpstashRedisStore",+ "create_kv_docstore",+ "create_lc_store",]diff --git a/libs/langchain/langchain/storage/in_memory.py b/libs/langchain/langchain/storage/in_memory.pyindex 24c4df6f42..296bc19a02 100644--- a/libs/langchain/langchain/storage/in_memory.py+++ b/libs/langchain/langchain/storage/in_memory.py@@ -7,7 +7,7 @@ primarily for unit testing purposes.from langchain_core.stores import InMemoryBaseStore, InMemoryByteStore, InMemoryStore__all__ = [- "InMemoryStore","InMemoryBaseStore","InMemoryByteStore",+ "InMemoryStore",]diff --git a/libs/langchain/langchain/storage/upstash_redis.py b/libs/langchain/langchain/storage/upstash_redis.pyindex 59f3b10699..35aba2ed09 100644--- a/libs/langchain/langchain/storage/upstash_redis.py+++ b/libs/langchain/langchain/storage/upstash_redis.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "UpstashRedisStore","UpstashRedisByteStore",+ "UpstashRedisStore",]diff --git a/libs/langchain/langchain/text_splitter.py b/libs/langchain/langchain/text_splitter.pyindex 9303f0c6ed..039140b08d 100644--- a/libs/langchain/langchain/text_splitter.py+++ b/libs/langchain/langchain/text_splitter.py@@ -27,24 +27,24 @@ from langchain_text_splitters.sentence_transformers import (from langchain_text_splitters.spacy import SpacyTextSplitter__all__ = [- "TokenTextSplitter",- "TextSplitter",- "Tokenizer",- "Language",- "RecursiveCharacterTextSplitter",- "RecursiveJsonSplitter",- "LatexTextSplitter",- "PythonCodeTextSplitter",- "KonlpyTextSplitter",- "SpacyTextSplitter",- "NLTKTextSplitter",- "split_text_on_tokens",- "SentenceTransformersTokenTextSplitter",+ "CharacterTextSplitter","ElementType",+ "HTMLHeaderTextSplitter","HeaderType",+ "KonlpyTextSplitter",+ "Language",+ "LatexTextSplitter","LineType",- "HTMLHeaderTextSplitter","MarkdownHeaderTextSplitter","MarkdownTextSplitter",- "CharacterTextSplitter",+ "NLTKTextSplitter",+ "PythonCodeTextSplitter",+ "RecursiveCharacterTextSplitter",+ "RecursiveJsonSplitter",+ "SentenceTransformersTokenTextSplitter",+ "SpacyTextSplitter",+ "TextSplitter",+ "TokenTextSplitter",+ "Tokenizer",+ "split_text_on_tokens",]diff --git a/libs/langchain/langchain/tools/__init__.py b/libs/langchain/langchain/tools/__init__.pyindex 55ea272212..1451ab170a 100644--- a/libs/langchain/langchain/tools/__init__.py+++ b/libs/langchain/langchain/tools/__init__.py@@ -85,10 +85,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "StructuredTool",- "BaseTool",- "tool",- "Tool","AINAppOps","AINOwnerOps","AINRuleOps",@@ -106,6 +102,7 @@ __all__ = ["BaseRequestsTool","BaseSQLDatabaseTool","BaseSparkSQLTool",+ "BaseTool","BearlyInterpreterTool","BingSearchResults","BingSearchRun",@@ -141,8 +138,6 @@ __all__ = ["GoogleSearchRun","GoogleSerperResults","GoogleSerperRun",- "SearchAPIResults",- "SearchAPIRun","HumanInputRun","IFTTTWebhook","InfoPowerBITool",@@ -169,20 +164,21 @@ __all__ = ["OpenAPISpec","OpenWeatherMapQueryRun","PubmedQueryRun",- "RedditSearchRun","QueryCheckerTool","QueryPowerBITool","QuerySQLCheckerTool","QuerySQLDataBaseTool","QuerySparkSQLTool","ReadFileTool",+ "RedditSearchRun","RequestsDeleteTool","RequestsGetTool","RequestsPatchTool","RequestsPostTool","RequestsPutTool",- "SteamWebAPIQueryRun","SceneXplainTool",+ "SearchAPIResults",+ "SearchAPIRun","SearxSearchResults","SearxSearchRun","ShellTool",@@ -191,9 +187,12 @@ __all__ = ["SlackScheduleMessage","SlackSendMessage","SleepTool",- "StdInInquireTool","StackExchangeTool",+ "StdInInquireTool",+ "SteamWebAPIQueryRun","SteamshipImageGenerationTool",+ "StructuredTool",+ "Tool","VectorStoreQATool","VectorStoreQAWithSourcesTool","WikipediaQueryRun",@@ -204,4 +203,5 @@ __all__ = ["ZapierNLAListActions","ZapierNLARunAction","format_tool_to_openai_function",+ "tool",]diff --git a/libs/langchain/langchain/tools/ainetwork/app.py b/libs/langchain/langchain/tools/ainetwork/app.pyindex a28e83008d..ce01f9dbd5 100644--- a/libs/langchain/langchain/tools/ainetwork/app.py+++ b/libs/langchain/langchain/tools/ainetwork/app.py@@ -24,7 +24,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "AINAppOps","AppOperationType","AppSchema",- "AINAppOps",]diff --git a/libs/langchain/langchain/tools/ainetwork/base.py b/libs/langchain/langchain/tools/ainetwork/base.pyindex 608c882fa9..20e14d6b39 100644--- a/libs/langchain/langchain/tools/ainetwork/base.py+++ b/libs/langchain/langchain/tools/ainetwork/base.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "OperationType","AINBaseTool",+ "OperationType",]diff --git a/libs/langchain/langchain/tools/ainetwork/owner.py b/libs/langchain/langchain/tools/ainetwork/owner.pyindex 1cf8259d72..381a80b370 100644--- a/libs/langchain/langchain/tools/ainetwork/owner.py+++ b/libs/langchain/langchain/tools/ainetwork/owner.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "RuleSchema","AINOwnerOps",+ "RuleSchema",]diff --git a/libs/langchain/langchain/tools/ainetwork/rule.py b/libs/langchain/langchain/tools/ainetwork/rule.pyindex 564960485a..1404ef0bea 100644--- a/libs/langchain/langchain/tools/ainetwork/rule.py+++ b/libs/langchain/langchain/tools/ainetwork/rule.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "RuleSchema","AINRuleOps",+ "RuleSchema",]diff --git a/libs/langchain/langchain/tools/ainetwork/transfer.py b/libs/langchain/langchain/tools/ainetwork/transfer.pyindex 2aa04dd9fd..25c60629a4 100644--- a/libs/langchain/langchain/tools/ainetwork/transfer.py+++ b/libs/langchain/langchain/tools/ainetwork/transfer.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "TransferSchema","AINTransfer",+ "TransferSchema",]diff --git a/libs/langchain/langchain/tools/ainetwork/value.py b/libs/langchain/langchain/tools/ainetwork/value.pyindex f2a5876f54..ab8d5ab996 100644--- a/libs/langchain/langchain/tools/ainetwork/value.py+++ b/libs/langchain/langchain/tools/ainetwork/value.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ValueSchema","AINValueOps",+ "ValueSchema",]diff --git a/libs/langchain/langchain/tools/amadeus/closest_airport.py b/libs/langchain/langchain/tools/amadeus/closest_airport.pyindex e51baaa39a..71c38dc91c 100644--- a/libs/langchain/langchain/tools/amadeus/closest_airport.py+++ b/libs/langchain/langchain/tools/amadeus/closest_airport.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ClosestAirportSchema","AmadeusClosestAirport",+ "ClosestAirportSchema",]diff --git a/libs/langchain/langchain/tools/amadeus/flight_search.py b/libs/langchain/langchain/tools/amadeus/flight_search.pyindex b83247b206..34ce3fe29a 100644--- a/libs/langchain/langchain/tools/amadeus/flight_search.py+++ b/libs/langchain/langchain/tools/amadeus/flight_search.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "FlightSearchSchema","AmadeusFlightSearch",+ "FlightSearchSchema",]diff --git a/libs/langchain/langchain/tools/azure_cognitive_services/__init__.py b/libs/langchain/langchain/tools/azure_cognitive_services/__init__.pyindex 7922cd4fb8..572a55dc57 100644--- a/libs/langchain/langchain/tools/azure_cognitive_services/__init__.py+++ b/libs/langchain/langchain/tools/azure_cognitive_services/__init__.py@@ -33,8 +33,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "AzureCogsImageAnalysisTool","AzureCogsFormRecognizerTool",+ "AzureCogsImageAnalysisTool","AzureCogsSpeech2TextTool","AzureCogsText2SpeechTool","AzureCogsTextAnalyticsHealthTool",diff --git a/libs/langchain/langchain/tools/base.py b/libs/langchain/langchain/tools/base.pyindex ff81eaa895..ecacb95349 100644--- a/libs/langchain/langchain/tools/base.py+++ b/libs/langchain/langchain/tools/base.py@@ -9,11 +9,11 @@ from langchain_core.tools import ()__all__ = [- "SchemaAnnotationError",- "create_schema_from_function",- "ToolException","BaseTool",- "Tool",+ "SchemaAnnotationError","StructuredTool",+ "Tool",+ "ToolException",+ "create_schema_from_function","tool",]diff --git a/libs/langchain/langchain/tools/bearly/tool.py b/libs/langchain/langchain/tools/bearly/tool.pyindex 64af4a9c4c..c57e5bc1b4 100644--- a/libs/langchain/langchain/tools/bearly/tool.py+++ b/libs/langchain/langchain/tools/bearly/tool.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "BearlyInterpreterTool","BearlyInterpreterToolArguments","FileInfo",- "BearlyInterpreterTool",]diff --git a/libs/langchain/langchain/tools/bing_search/__init__.py b/libs/langchain/langchain/tools/bing_search/__init__.pyindex 517695ad63..1f8906ca5e 100644--- a/libs/langchain/langchain/tools/bing_search/__init__.py+++ b/libs/langchain/langchain/tools/bing_search/__init__.py@@ -24,6 +24,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "BingSearchRun","BingSearchResults",+ "BingSearchRun",]diff --git a/libs/langchain/langchain/tools/bing_search/tool.py b/libs/langchain/langchain/tools/bing_search/tool.pyindex 20f887149b..894747fcea 100644--- a/libs/langchain/langchain/tools/bing_search/tool.py+++ b/libs/langchain/langchain/tools/bing_search/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "BingSearchRun","BingSearchResults",+ "BingSearchRun",]diff --git a/libs/langchain/langchain/tools/dataforseo_api_search/__init__.py b/libs/langchain/langchain/tools/dataforseo_api_search/__init__.pyindex 2fdf6e4f86..04ace1e69b 100644--- a/libs/langchain/langchain/tools/dataforseo_api_search/__init__.py+++ b/libs/langchain/langchain/tools/dataforseo_api_search/__init__.py@@ -29,6 +29,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "DataForSeoAPISearchRun","DataForSeoAPISearchResults",+ "DataForSeoAPISearchRun",]diff --git a/libs/langchain/langchain/tools/dataforseo_api_search/tool.py b/libs/langchain/langchain/tools/dataforseo_api_search/tool.pyindex 8d1b02852b..f704197724 100644--- a/libs/langchain/langchain/tools/dataforseo_api_search/tool.py+++ b/libs/langchain/langchain/tools/dataforseo_api_search/tool.py@@ -27,6 +27,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "DataForSeoAPISearchRun","DataForSeoAPISearchResults",+ "DataForSeoAPISearchRun",]diff --git a/libs/langchain/langchain/tools/ddg_search/tool.py b/libs/langchain/langchain/tools/ddg_search/tool.pyindex e386ac3551..79de66770e 100644--- a/libs/langchain/langchain/tools/ddg_search/tool.py+++ b/libs/langchain/langchain/tools/ddg_search/tool.py@@ -26,7 +26,7 @@ def __getattr__(name: str) -> Any:__all__ = ["DDGInput",- "DuckDuckGoSearchRun","DuckDuckGoSearchResults",+ "DuckDuckGoSearchRun","DuckDuckGoSearchTool",]diff --git a/libs/langchain/langchain/tools/e2b_data_analysis/tool.py b/libs/langchain/langchain/tools/e2b_data_analysis/tool.pyindex 479c5eae28..d79dd9fb20 100644--- a/libs/langchain/langchain/tools/e2b_data_analysis/tool.py+++ b/libs/langchain/langchain/tools/e2b_data_analysis/tool.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "UploadedFile",- "E2BDataAnalysisToolArguments","E2BDataAnalysisTool",+ "E2BDataAnalysisToolArguments",+ "UploadedFile",]diff --git a/libs/langchain/langchain/tools/edenai/__init__.py b/libs/langchain/langchain/tools/edenai/__init__.pyindex 3c33655d61..5b20a3e819 100644--- a/libs/langchain/langchain/tools/edenai/__init__.py+++ b/libs/langchain/langchain/tools/edenai/__init__.py@@ -43,8 +43,8 @@ __all__ = ["EdenAiObjectDetectionTool","EdenAiParsingIDTool","EdenAiParsingInvoiceTool",- "EdenAiTextToSpeechTool","EdenAiSpeechToTextTool","EdenAiTextModerationTool",+ "EdenAiTextToSpeechTool","EdenaiTool",]diff --git a/libs/langchain/langchain/tools/file_management/__init__.py b/libs/langchain/langchain/tools/file_management/__init__.pyindex bb0c3bec16..e317d44b20 100644--- a/libs/langchain/langchain/tools/file_management/__init__.py+++ b/libs/langchain/langchain/tools/file_management/__init__.py@@ -40,8 +40,8 @@ __all__ = ["CopyFileTool","DeleteFileTool","FileSearchTool",+ "ListDirectoryTool","MoveFileTool","ReadFileTool","WriteFileTool",- "ListDirectoryTool",]diff --git a/libs/langchain/langchain/tools/file_management/copy.py b/libs/langchain/langchain/tools/file_management/copy.pyindex 308d882eab..38bc848c8a 100644--- a/libs/langchain/langchain/tools/file_management/copy.py+++ b/libs/langchain/langchain/tools/file_management/copy.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "FileCopyInput","CopyFileTool",+ "FileCopyInput",]diff --git a/libs/langchain/langchain/tools/file_management/delete.py b/libs/langchain/langchain/tools/file_management/delete.pyindex 01943a7b25..616516f602 100644--- a/libs/langchain/langchain/tools/file_management/delete.py+++ b/libs/langchain/langchain/tools/file_management/delete.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "FileDeleteInput","DeleteFileTool",+ "FileDeleteInput",]diff --git a/libs/langchain/langchain/tools/gmail/__init__.py b/libs/langchain/langchain/tools/gmail/__init__.pyindex 59e81e9f69..24daa53f8f 100644--- a/libs/langchain/langchain/tools/gmail/__init__.py+++ b/libs/langchain/langchain/tools/gmail/__init__.py@@ -34,8 +34,8 @@ def __getattr__(name: str) -> Any:__all__ = ["GmailCreateDraft",- "GmailSendMessage",- "GmailSearch","GmailGetMessage","GmailGetThread",+ "GmailSearch",+ "GmailSendMessage",]diff --git a/libs/langchain/langchain/tools/gmail/get_message.py b/libs/langchain/langchain/tools/gmail/get_message.pyindex fea9ab4f02..4720068f38 100644--- a/libs/langchain/langchain/tools/gmail/get_message.py+++ b/libs/langchain/langchain/tools/gmail/get_message.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearchArgsSchema","GmailGetMessage",+ "SearchArgsSchema",]diff --git a/libs/langchain/langchain/tools/gmail/search.py b/libs/langchain/langchain/tools/gmail/search.pyindex 07278cffae..9f04a7da37 100644--- a/libs/langchain/langchain/tools/gmail/search.py+++ b/libs/langchain/langchain/tools/gmail/search.py@@ -24,7 +24,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "GmailSearch","Resource","SearchArgsSchema",- "GmailSearch",]diff --git a/libs/langchain/langchain/tools/gmail/send_message.py b/libs/langchain/langchain/tools/gmail/send_message.pyindex 94b8fdd39b..c9f864160e 100644--- a/libs/langchain/langchain/tools/gmail/send_message.py+++ b/libs/langchain/langchain/tools/gmail/send_message.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SendMessageSchema","GmailSendMessage",+ "SendMessageSchema",]diff --git a/libs/langchain/langchain/tools/google_search/__init__.py b/libs/langchain/langchain/tools/google_search/__init__.pyindex 0d1da9422b..e5e88512ea 100644--- a/libs/langchain/langchain/tools/google_search/__init__.py+++ b/libs/langchain/langchain/tools/google_search/__init__.py@@ -24,6 +24,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "GoogleSearchRun","GoogleSearchResults",+ "GoogleSearchRun",]diff --git a/libs/langchain/langchain/tools/google_search/tool.py b/libs/langchain/langchain/tools/google_search/tool.pyindex 8484216e0e..bc73774b34 100644--- a/libs/langchain/langchain/tools/google_search/tool.py+++ b/libs/langchain/langchain/tools/google_search/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "GoogleSearchRun","GoogleSearchResults",+ "GoogleSearchRun",]diff --git a/libs/langchain/langchain/tools/google_serper/__init__.py b/libs/langchain/langchain/tools/google_serper/__init__.pyindex 9fe3a567b2..ad20b9bab4 100644--- a/libs/langchain/langchain/tools/google_serper/__init__.py+++ b/libs/langchain/langchain/tools/google_serper/__init__.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "GoogleSerperRun","GoogleSerperResults",+ "GoogleSerperRun",]diff --git a/libs/langchain/langchain/tools/google_serper/tool.py b/libs/langchain/langchain/tools/google_serper/tool.pyindex 9ccbf937d3..8ef0c3765e 100644--- a/libs/langchain/langchain/tools/google_serper/tool.py+++ b/libs/langchain/langchain/tools/google_serper/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "GoogleSerperRun","GoogleSerperResults",+ "GoogleSerperRun",]diff --git a/libs/langchain/langchain/tools/json/tool.py b/libs/langchain/langchain/tools/json/tool.pyindex f4812cf50e..5edf1c798d 100644--- a/libs/langchain/langchain/tools/json/tool.py+++ b/libs/langchain/langchain/tools/json/tool.py@@ -24,7 +24,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "JsonSpec",- "JsonListKeysTool","JsonGetValueTool",+ "JsonListKeysTool",+ "JsonSpec",]diff --git a/libs/langchain/langchain/tools/memorize/tool.py b/libs/langchain/langchain/tools/memorize/tool.pyindex d0e72223ce..3eb0b171c1 100644--- a/libs/langchain/langchain/tools/memorize/tool.py+++ b/libs/langchain/langchain/tools/memorize/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "TrainableLLM","Memorize",+ "TrainableLLM",]diff --git a/libs/langchain/langchain/tools/multion/__init__.py b/libs/langchain/langchain/tools/multion/__init__.pyindex c3030878cc..008add06af 100644--- a/libs/langchain/langchain/tools/multion/__init__.py+++ b/libs/langchain/langchain/tools/multion/__init__.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "MultionCloseSession","MultionCreateSession","MultionUpdateSession",- "MultionCloseSession",]diff --git a/libs/langchain/langchain/tools/multion/update_session.py b/libs/langchain/langchain/tools/multion/update_session.pyindex e49da10ea9..1ea53af6b8 100644--- a/libs/langchain/langchain/tools/multion/update_session.py+++ b/libs/langchain/langchain/tools/multion/update_session.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "UpdateSessionSchema","MultionUpdateSession",+ "UpdateSessionSchema",]diff --git a/libs/langchain/langchain/tools/office365/__init__.py b/libs/langchain/langchain/tools/office365/__init__.pyindex d2108510a6..abee304b3e 100644--- a/libs/langchain/langchain/tools/office365/__init__.py+++ b/libs/langchain/langchain/tools/office365/__init__.py@@ -33,9 +33,9 @@ def __getattr__(name: str) -> Any:__all__ = [+ "O365CreateDraftMessage","O365SearchEmails","O365SearchEvents",- "O365CreateDraftMessage",- "O365SendMessage","O365SendEvent",+ "O365SendMessage",]diff --git a/libs/langchain/langchain/tools/office365/events_search.py b/libs/langchain/langchain/tools/office365/events_search.pyindex 1a4a82e0a1..e7b958eb0b 100644--- a/libs/langchain/langchain/tools/office365/events_search.py+++ b/libs/langchain/langchain/tools/office365/events_search.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearchEventsInput","O365SearchEvents",+ "SearchEventsInput",]diff --git a/libs/langchain/langchain/tools/office365/messages_search.py b/libs/langchain/langchain/tools/office365/messages_search.pyindex 5ae016bf7c..62fe766be0 100644--- a/libs/langchain/langchain/tools/office365/messages_search.py+++ b/libs/langchain/langchain/tools/office365/messages_search.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearchEmailsInput","O365SearchEmails",+ "SearchEmailsInput",]diff --git a/libs/langchain/langchain/tools/office365/send_event.py b/libs/langchain/langchain/tools/office365/send_event.pyindex 4b7d11a3fe..c11bde74b2 100644--- a/libs/langchain/langchain/tools/office365/send_event.py+++ b/libs/langchain/langchain/tools/office365/send_event.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SendEventSchema","O365SendEvent",+ "SendEventSchema",]diff --git a/libs/langchain/langchain/tools/office365/send_message.py b/libs/langchain/langchain/tools/office365/send_message.pyindex 09949f6721..cd64d20179 100644--- a/libs/langchain/langchain/tools/office365/send_message.py+++ b/libs/langchain/langchain/tools/office365/send_message.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SendMessageSchema","O365SendMessage",+ "SendMessageSchema",]diff --git a/libs/langchain/langchain/tools/openapi/utils/api_models.py b/libs/langchain/langchain/tools/openapi/utils/api_models.pyindex a587d635cb..72aad25ca3 100644--- a/libs/langchain/langchain/tools/openapi/utils/api_models.py+++ b/libs/langchain/langchain/tools/openapi/utils/api_models.py@@ -41,14 +41,14 @@ def __getattr__(name: str) -> Any:__all__ = [- "PRIMITIVE_TYPES",- "APIPropertyLocation",- "SUPPORTED_LOCATIONS","INVALID_LOCATION_TEMPL",+ "PRIMITIVE_TYPES","SCHEMA_TYPE",- "APIPropertyBase",+ "SUPPORTED_LOCATIONS",+ "APIOperation","APIProperty",- "APIRequestBodyProperty",+ "APIPropertyBase",+ "APIPropertyLocation","APIRequestBody",- "APIOperation",+ "APIRequestBodyProperty",]diff --git a/libs/langchain/langchain/tools/playwright/__init__.py b/libs/langchain/langchain/tools/playwright/__init__.pyindex 352088c202..bd8c90bc0c 100644--- a/libs/langchain/langchain/tools/playwright/__init__.py+++ b/libs/langchain/langchain/tools/playwright/__init__.py@@ -37,11 +37,11 @@ def __getattr__(name: str) -> Any:__all__ = [- "NavigateTool",- "NavigateBackTool",- "ExtractTextTool",- "ExtractHyperlinksTool",- "GetElementsTool","ClickTool","CurrentWebPageTool",+ "ExtractHyperlinksTool",+ "ExtractTextTool",+ "GetElementsTool",+ "NavigateBackTool",+ "NavigateTool",]diff --git a/libs/langchain/langchain/tools/playwright/click.py b/libs/langchain/langchain/tools/playwright/click.pyindex 75e601d1af..92d8498fb2 100644--- a/libs/langchain/langchain/tools/playwright/click.py+++ b/libs/langchain/langchain/tools/playwright/click.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ClickToolInput","ClickTool",+ "ClickToolInput",]diff --git a/libs/langchain/langchain/tools/playwright/extract_hyperlinks.py b/libs/langchain/langchain/tools/playwright/extract_hyperlinks.pyindex e8320e6de7..0cdd9575e7 100644--- a/libs/langchain/langchain/tools/playwright/extract_hyperlinks.py+++ b/libs/langchain/langchain/tools/playwright/extract_hyperlinks.py@@ -27,6 +27,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ExtractHyperlinksToolInput","ExtractHyperlinksTool",+ "ExtractHyperlinksToolInput",]diff --git a/libs/langchain/langchain/tools/playwright/get_elements.py b/libs/langchain/langchain/tools/playwright/get_elements.pyindex 75d6d7768a..a1df91015e 100644--- a/libs/langchain/langchain/tools/playwright/get_elements.py+++ b/libs/langchain/langchain/tools/playwright/get_elements.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "GetElementsToolInput","GetElementsTool",+ "GetElementsToolInput",]diff --git a/libs/langchain/langchain/tools/playwright/navigate.py b/libs/langchain/langchain/tools/playwright/navigate.pyindex 734ef229ee..c185754c3b 100644--- a/libs/langchain/langchain/tools/playwright/navigate.py+++ b/libs/langchain/langchain/tools/playwright/navigate.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "NavigateToolInput","NavigateTool",+ "NavigateToolInput",]diff --git a/libs/langchain/langchain/tools/plugin.py b/libs/langchain/langchain/tools/plugin.pyindex 47c71e8e7d..8db6f8fbb5 100644--- a/libs/langchain/langchain/tools/plugin.py+++ b/libs/langchain/langchain/tools/plugin.py@@ -25,8 +25,8 @@ def __getattr__(name: str) -> Any:__all__ = [- "ApiConfig","AIPlugin",- "AIPluginToolSchema","AIPluginTool",+ "AIPluginToolSchema",+ "ApiConfig",]diff --git a/libs/langchain/langchain/tools/powerbi/tool.py b/libs/langchain/langchain/tools/powerbi/tool.pyindex 3cd4166738..92663ae967 100644--- a/libs/langchain/langchain/tools/powerbi/tool.py+++ b/libs/langchain/langchain/tools/powerbi/tool.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "QueryPowerBITool","InfoPowerBITool","ListPowerBITool",+ "QueryPowerBITool",]diff --git a/libs/langchain/langchain/tools/reddit_search/tool.py b/libs/langchain/langchain/tools/reddit_search/tool.pyindex 29c9bed96f..e8645b06d0 100644--- a/libs/langchain/langchain/tools/reddit_search/tool.py+++ b/libs/langchain/langchain/tools/reddit_search/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "RedditSearchSchema","RedditSearchRun",+ "RedditSearchSchema",]diff --git a/libs/langchain/langchain/tools/render.py b/libs/langchain/langchain/tools/render.pyindex c97546016c..cbe6e2bb0e 100644--- a/libs/langchain/langchain/tools/render.py+++ b/libs/langchain/langchain/tools/render.py@@ -16,8 +16,8 @@ from langchain_core.utils.function_calling import ()__all__ = [+ "format_tool_to_openai_function",+ "format_tool_to_openai_tool","render_text_description","render_text_description_and_args",- "format_tool_to_openai_tool",- "format_tool_to_openai_function",]diff --git a/libs/langchain/langchain/tools/requests/tool.py b/libs/langchain/langchain/tools/requests/tool.pyindex 9a7efd6f5e..693f10a01b 100644--- a/libs/langchain/langchain/tools/requests/tool.py+++ b/libs/langchain/langchain/tools/requests/tool.py@@ -34,9 +34,9 @@ def __getattr__(name: str) -> Any:__all__ = ["BaseRequestsTool",+ "RequestsDeleteTool","RequestsGetTool",- "RequestsPostTool","RequestsPatchTool",+ "RequestsPostTool","RequestsPutTool",- "RequestsDeleteTool",]diff --git a/libs/langchain/langchain/tools/searchapi/tool.py b/libs/langchain/langchain/tools/searchapi/tool.pyindex 18c69cb69c..52d05d6052 100644--- a/libs/langchain/langchain/tools/searchapi/tool.py+++ b/libs/langchain/langchain/tools/searchapi/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearchAPIRun","SearchAPIResults",+ "SearchAPIRun",]diff --git a/libs/langchain/langchain/tools/searx_search/tool.py b/libs/langchain/langchain/tools/searx_search/tool.pyindex 94b4e56020..4d0d35f411 100644--- a/libs/langchain/langchain/tools/searx_search/tool.py+++ b/libs/langchain/langchain/tools/searx_search/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearxSearchRun","SearxSearchResults",+ "SearxSearchRun",]diff --git a/libs/langchain/langchain/tools/slack/get_message.py b/libs/langchain/langchain/tools/slack/get_message.pyindex 8969bae32a..6eff6eaab1 100644--- a/libs/langchain/langchain/tools/slack/get_message.py+++ b/libs/langchain/langchain/tools/slack/get_message.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SlackGetMessageSchema","SlackGetMessage",+ "SlackGetMessageSchema",]diff --git a/libs/langchain/langchain/tools/spark_sql/tool.py b/libs/langchain/langchain/tools/spark_sql/tool.pyindex afec32b09d..d1b3e5b120 100644--- a/libs/langchain/langchain/tools/spark_sql/tool.py+++ b/libs/langchain/langchain/tools/spark_sql/tool.py@@ -32,8 +32,8 @@ def __getattr__(name: str) -> Any:__all__ = ["BaseSparkSQLTool",- "QuerySparkSQLTool","InfoSparkSQLTool","ListSparkSQLTool","QueryCheckerTool",+ "QuerySparkSQLTool",]diff --git a/libs/langchain/langchain/tools/sql_database/tool.py b/libs/langchain/langchain/tools/sql_database/tool.pyindex 1df1d645a1..ea75a5795b 100644--- a/libs/langchain/langchain/tools/sql_database/tool.py+++ b/libs/langchain/langchain/tools/sql_database/tool.py@@ -32,8 +32,8 @@ def __getattr__(name: str) -> Any:__all__ = ["BaseSQLDatabaseTool",- "QuerySQLDataBaseTool","InfoSQLDatabaseTool","ListSQLDatabaseTool","QuerySQLCheckerTool",+ "QuerySQLDataBaseTool",]diff --git a/libs/langchain/langchain/tools/tavily_search/__init__.py b/libs/langchain/langchain/tools/tavily_search/__init__.pyindex 17a9bc59fd..1c86551132 100644--- a/libs/langchain/langchain/tools/tavily_search/__init__.py+++ b/libs/langchain/langchain/tools/tavily_search/__init__.py@@ -27,6 +27,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "TavilySearchResults","TavilyAnswer",+ "TavilySearchResults",]diff --git a/libs/langchain/langchain/tools/tavily_search/tool.py b/libs/langchain/langchain/tools/tavily_search/tool.pyindex fabf4efac7..ed98e485f2 100644--- a/libs/langchain/langchain/tools/tavily_search/tool.py+++ b/libs/langchain/langchain/tools/tavily_search/tool.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "TavilyAnswer","TavilyInput","TavilySearchResults",- "TavilyAnswer",]diff --git a/libs/langchain/langchain/tools/zapier/__init__.py b/libs/langchain/langchain/tools/zapier/__init__.pyindex 573590b041..8820520a3e 100644--- a/libs/langchain/langchain/tools/zapier/__init__.py+++ b/libs/langchain/langchain/tools/zapier/__init__.py@@ -24,6 +24,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ZapierNLARunAction","ZapierNLAListActions",+ "ZapierNLARunAction",]diff --git a/libs/langchain/langchain/tools/zapier/tool.py b/libs/langchain/langchain/tools/zapier/tool.pyindex b69ab3f32f..3211624589 100644--- a/libs/langchain/langchain/tools/zapier/tool.py+++ b/libs/langchain/langchain/tools/zapier/tool.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ZapierNLARunAction","ZapierNLAListActions",+ "ZapierNLARunAction",]diff --git a/libs/langchain/langchain/utilities/__init__.py b/libs/langchain/langchain/utilities/__init__.pyindex 1ee41550b5..818d6d8310 100644--- a/libs/langchain/langchain/utilities/__init__.py+++ b/libs/langchain/langchain/utilities/__init__.py@@ -130,13 +130,13 @@ __all__ = ["DuckDuckGoSearchAPIWrapper","GoldenQueryAPIWrapper","GoogleFinanceAPIWrapper",- "GoogleLensAPIWrapper","GoogleJobsAPIWrapper",+ "GoogleLensAPIWrapper","GooglePlacesAPIWrapper","GoogleScholarAPIWrapper",- "GoogleTrendsAPIWrapper","GoogleSearchAPIWrapper","GoogleSerperAPIWrapper",+ "GoogleTrendsAPIWrapper","GraphQLAPIWrapper","JiraAPIWrapper","LambdaWrapper",@@ -150,7 +150,7 @@ __all__ = ["PowerBIDataset","PubMedAPIWrapper","Requests",- "SteamWebAPIWrapper",+ "RequestsWrapper","SQLDatabase","SceneXplainAPIWrapper","SearchApiAPIWrapper",@@ -158,8 +158,8 @@ __all__ = ["SerpAPIWrapper","SparkSQL","StackExchangeAPIWrapper",+ "SteamWebAPIWrapper","TensorflowDatasets",- "RequestsWrapper","TextRequestsWrapper","TwilioAPIWrapper","WikipediaAPIWrapper",diff --git a/libs/langchain/langchain/utilities/arcee.py b/libs/langchain/langchain/utilities/arcee.pyindex db6adef312..5a4268af67 100644--- a/libs/langchain/langchain/utilities/arcee.py+++ b/libs/langchain/langchain/utilities/arcee.py@@ -35,11 +35,11 @@ def __getattr__(name: str) -> Any:__all__ = [- "ArceeRoute",- "DALMFilterType",- "DALMFilter",- "ArceeDocumentSource","ArceeDocument","ArceeDocumentAdapter",+ "ArceeDocumentSource",+ "ArceeRoute","ArceeWrapper",+ "DALMFilter",+ "DALMFilterType",]diff --git a/libs/langchain/langchain/utilities/clickup.py b/libs/langchain/langchain/utilities/clickup.pyindex d7a6d1265e..c03c7f25b7 100644--- a/libs/langchain/langchain/utilities/clickup.py+++ b/libs/langchain/langchain/utilities/clickup.py@@ -35,11 +35,11 @@ def __getattr__(name: str) -> Any:__all__ = [- "Component",- "Task","CUList",+ "ClickupAPIWrapper",+ "Component","Member",- "Team","Space",- "ClickupAPIWrapper",+ "Task",+ "Team",]diff --git a/libs/langchain/langchain/utilities/opaqueprompts.py b/libs/langchain/langchain/utilities/opaqueprompts.pyindex 07780a9d99..3316792dbe 100644--- a/libs/langchain/langchain/utilities/opaqueprompts.py+++ b/libs/langchain/langchain/utilities/opaqueprompts.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "sanitize","desanitize",+ "sanitize",]diff --git a/libs/langchain/langchain/utilities/sql_database.py b/libs/langchain/langchain/utilities/sql_database.pyindex c5648057ac..3bce1dafa1 100644--- a/libs/langchain/langchain/utilities/sql_database.py+++ b/libs/langchain/langchain/utilities/sql_database.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "truncate_word","SQLDatabase",+ "truncate_word",]diff --git a/libs/langchain/langchain/utilities/vertexai.py b/libs/langchain/langchain/utilities/vertexai.pyindex 6b9fca5cd8..68073c77d6 100644--- a/libs/langchain/langchain/utilities/vertexai.py+++ b/libs/langchain/langchain/utilities/vertexai.py@@ -30,7 +30,7 @@ def __getattr__(name: str) -> Any:__all__ = ["create_retry_decorator",- "raise_vertex_import_error",- "init_vertexai","get_client_info",+ "init_vertexai",+ "raise_vertex_import_error",]diff --git a/libs/langchain/langchain/utils/__init__.py b/libs/langchain/langchain/utils/__init__.pyindex edd3840a3c..a21d037097 100644--- a/libs/langchain/langchain/utils/__init__.py+++ b/libs/langchain/langchain/utils/__init__.py@@ -60,12 +60,12 @@ __all__ = ["convert_to_secret_str","cosine_similarity","cosine_similarity_top_k",+ "formatter","get_bolded_text","get_color_mapping","get_colored_text","get_from_dict_or_env","get_from_env",- "formatter","get_pydantic_field_names","guard_import","mock_now",diff --git a/libs/langchain/langchain/utils/aiter.py b/libs/langchain/langchain/utils/aiter.pyindex cab956b5d0..1ba006d6af 100644--- a/libs/langchain/langchain/utils/aiter.py+++ b/libs/langchain/langchain/utils/aiter.py@@ -1,3 +1,3 @@from langchain_core.utils.aiter import NoLock, Tee, py_anext-__all__ = ["py_anext", "NoLock", "Tee"]+__all__ = ["NoLock", "Tee", "py_anext"]diff --git a/libs/langchain/langchain/utils/html.py b/libs/langchain/langchain/utils/html.pyindex a5684b2e07..efe6d725c9 100644--- a/libs/langchain/langchain/utils/html.py+++ b/libs/langchain/langchain/utils/html.py@@ -9,11 +9,11 @@ from langchain_core.utils.html import ()__all__ = [+ "DEFAULT_LINK_REGEX","PREFIXES_TO_IGNORE",+ "PREFIXES_TO_IGNORE_REGEX","SUFFIXES_TO_IGNORE","SUFFIXES_TO_IGNORE_REGEX",- "PREFIXES_TO_IGNORE_REGEX",- "DEFAULT_LINK_REGEX",- "find_all_links","extract_sub_links",+ "find_all_links",]diff --git a/libs/langchain/langchain/utils/input.py b/libs/langchain/langchain/utils/input.pyindex 563cc50607..bff9f875d8 100644--- a/libs/langchain/langchain/utils/input.py+++ b/libs/langchain/langchain/utils/input.py@@ -5,4 +5,4 @@ from langchain_core.utils.input import (print_text,)-__all__ = ["get_color_mapping", "get_colored_text", "get_bolded_text", "print_text"]+__all__ = ["get_bolded_text", "get_color_mapping", "get_colored_text", "print_text"]diff --git a/libs/langchain/langchain/utils/iter.py b/libs/langchain/langchain/utils/iter.pyindex a405972124..a905911b1d 100644--- a/libs/langchain/langchain/utils/iter.py+++ b/libs/langchain/langchain/utils/iter.py@@ -1,3 +1,3 @@from langchain_core.utils.iter import NoLock, Tee, batch_iterate, tee_peer-__all__ = ["NoLock", "tee_peer", "Tee", "batch_iterate"]+__all__ = ["NoLock", "Tee", "batch_iterate", "tee_peer"]diff --git a/libs/langchain/langchain/utils/json_schema.py b/libs/langchain/langchain/utils/json_schema.pyindex 0e61b7bee9..08bcc8e5e8 100644--- a/libs/langchain/langchain/utils/json_schema.py+++ b/libs/langchain/langchain/utils/json_schema.py@@ -6,8 +6,8 @@ from langchain_core.utils.json_schema import ()__all__ = [- "_retrieve_ref","_dereference_refs_helper","_infer_skip_keys",+ "_retrieve_ref","dereference_refs",]diff --git a/libs/langchain/langchain/utils/strings.py b/libs/langchain/langchain/utils/strings.pyindex f8e8856421..3c394c4694 100644--- a/libs/langchain/langchain/utils/strings.py+++ b/libs/langchain/langchain/utils/strings.py@@ -1,3 +1,3 @@from langchain_core.utils.strings import comma_list, stringify_dict, stringify_value-__all__ = ["stringify_value", "stringify_dict", "comma_list"]+__all__ = ["comma_list", "stringify_dict", "stringify_value"]diff --git a/libs/langchain/langchain/utils/utils.py b/libs/langchain/langchain/utils/utils.pyindex 5762943316..9856fa02b0 100644--- a/libs/langchain/langchain/utils/utils.py+++ b/libs/langchain/langchain/utils/utils.py@@ -10,12 +10,12 @@ from langchain_core.utils.utils import ()__all__ = [- "xor_args",- "raise_for_status_with_text",- "mock_now",- "guard_import",- "check_package_version",- "get_pydantic_field_names","build_extra_kwargs",+ "check_package_version","convert_to_secret_str",+ "get_pydantic_field_names",+ "guard_import",+ "mock_now",+ "raise_for_status_with_text",+ "xor_args",]diff --git a/libs/langchain/langchain/vectorstores/__init__.py b/libs/langchain/langchain/vectorstores/__init__.pyindex 603421aad0..ec9164fc3c 100644--- a/libs/langchain/langchain/vectorstores/__init__.py+++ b/libs/langchain/langchain/vectorstores/__init__.py@@ -187,6 +187,7 @@ def __getattr__(name: str) -> Any:__all__ = [+ "FAISS","AlibabaCloudOpenSearch","AlibabaCloudOpenSearchSettings","AnalyticDB",@@ -211,13 +212,12 @@ __all__ = ["DuckDB","EcloudESVectorStore","ElasticKnnSearch",- "ElasticsearchStore","ElasticVectorSearch",+ "ElasticsearchStore","Epsilla",- "FAISS","Hologres",- "LanceDB","LLMRails",+ "LanceDB","Marqo","MatchingEngine","Meilisearch",@@ -236,11 +236,11 @@ __all__ = ["Qdrant","Redis","Rockset",+ "SKLearnVectorStore",+ "SQLiteVSS","ScaNN","SemaDB","SingleStoreDB",- "SKLearnVectorStore",- "SQLiteVSS","StarRocks","SupabaseVectorStore","Tair",diff --git a/libs/langchain/langchain/vectorstores/alibabacloud_opensearch.py b/libs/langchain/langchain/vectorstores/alibabacloud_opensearch.pyindex 7777350794..549e19b8dc 100644--- a/libs/langchain/langchain/vectorstores/alibabacloud_opensearch.py+++ b/libs/langchain/langchain/vectorstores/alibabacloud_opensearch.py@@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "AlibabaCloudOpenSearchSettings","AlibabaCloudOpenSearch",+ "AlibabaCloudOpenSearchSettings",]diff --git a/libs/langchain/langchain/vectorstores/azure_cosmos_db.py b/libs/langchain/langchain/vectorstores/azure_cosmos_db.pyindex 3b6a8df574..41b757a0f4 100644--- a/libs/langchain/langchain/vectorstores/azure_cosmos_db.py+++ b/libs/langchain/langchain/vectorstores/azure_cosmos_db.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "CosmosDBSimilarityType","AzureCosmosDBVectorSearch",+ "CosmosDBSimilarityType",]diff --git a/libs/langchain/langchain/vectorstores/clickhouse.py b/libs/langchain/langchain/vectorstores/clickhouse.pyindex 09795a14a4..86b54d68ae 100644--- a/libs/langchain/langchain/vectorstores/clickhouse.py+++ b/libs/langchain/langchain/vectorstores/clickhouse.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ClickhouseSettings","Clickhouse",+ "ClickhouseSettings",]diff --git a/libs/langchain/langchain/vectorstores/elastic_vector_search.py b/libs/langchain/langchain/vectorstores/elastic_vector_search.pyindex cb75713ba2..89f244134e 100644--- a/libs/langchain/langchain/vectorstores/elastic_vector_search.py+++ b/libs/langchain/langchain/vectorstores/elastic_vector_search.py@@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "ElasticVectorSearch","ElasticKnnSearch",+ "ElasticVectorSearch",]diff --git a/libs/langchain/langchain/vectorstores/elasticsearch.py b/libs/langchain/langchain/vectorstores/elasticsearch.pyindex 616a8df3c5..95dea11f1d 100644--- a/libs/langchain/langchain/vectorstores/elasticsearch.py+++ b/libs/langchain/langchain/vectorstores/elasticsearch.py@@ -31,9 +31,9 @@ def __getattr__(name: str) -> Any:__all__ = [- "BaseRetrievalStrategy","ApproxRetrievalStrategy",+ "BaseRetrievalStrategy",+ "ElasticsearchStore","ExactRetrievalStrategy","SparseRetrievalStrategy",- "ElasticsearchStore",]diff --git a/libs/langchain/langchain/vectorstores/myscale.py b/libs/langchain/langchain/vectorstores/myscale.pyindex 69271ef084..ddbc536857 100644--- a/libs/langchain/langchain/vectorstores/myscale.py+++ b/libs/langchain/langchain/vectorstores/myscale.py@@ -24,7 +24,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "MyScaleSettings","MyScale",+ "MyScaleSettings","MyScaleWithoutJSON",]diff --git a/libs/langchain/langchain/vectorstores/neo4j_vector.py b/libs/langchain/langchain/vectorstores/neo4j_vector.pyindex 65f0f8f215..1c6ea76ea9 100644--- a/libs/langchain/langchain/vectorstores/neo4j_vector.py+++ b/libs/langchain/langchain/vectorstores/neo4j_vector.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "SearchType","Neo4jVector",+ "SearchType",]diff --git a/libs/langchain/langchain/vectorstores/pgembedding.py b/libs/langchain/langchain/vectorstores/pgembedding.pyindex ff1ab86545..77f10d010b 100644--- a/libs/langchain/langchain/vectorstores/pgembedding.py+++ b/libs/langchain/langchain/vectorstores/pgembedding.py@@ -31,6 +31,6 @@ def __getattr__(name: str) -> Any:__all__ = ["CollectionStore","EmbeddingStore",- "QueryResult","PGEmbedding",+ "QueryResult",]diff --git a/libs/langchain/langchain/vectorstores/qdrant.py b/libs/langchain/langchain/vectorstores/qdrant.pyindex 474424fd2a..4d4ef81110 100644--- a/libs/langchain/langchain/vectorstores/qdrant.py+++ b/libs/langchain/langchain/vectorstores/qdrant.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "QdrantException","Qdrant",+ "QdrantException",]diff --git a/libs/langchain/langchain/vectorstores/redis/__init__.py b/libs/langchain/langchain/vectorstores/redis/__init__.pyindex 35484442b3..3294baf091 100644--- a/libs/langchain/langchain/vectorstores/redis/__init__.py+++ b/libs/langchain/langchain/vectorstores/redis/__init__.py@@ -35,8 +35,8 @@ def __getattr__(name: str) -> Any:__all__ = ["Redis","RedisFilter",+ "RedisNum","RedisTag","RedisText",- "RedisNum","RedisVectorStoreRetriever",]diff --git a/libs/langchain/langchain/vectorstores/redis/base.py b/libs/langchain/langchain/vectorstores/redis/base.pyindex 3360858b80..86fd2a3886 100644--- a/libs/langchain/langchain/vectorstores/redis/base.py+++ b/libs/langchain/langchain/vectorstores/redis/base.py@@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:__all__ = [- "check_index_exists","Redis","RedisVectorStoreRetriever",+ "check_index_exists",]diff --git a/libs/langchain/langchain/vectorstores/redis/filters.py b/libs/langchain/langchain/vectorstores/redis/filters.pyindex 628f32c713..a72aaaac91 100644--- a/libs/langchain/langchain/vectorstores/redis/filters.py+++ b/libs/langchain/langchain/vectorstores/redis/filters.py@@ -37,12 +37,12 @@ def __getattr__(name: str) -> Any:__all__ = [- "RedisFilterOperator","RedisFilter",+ "RedisFilterExpression","RedisFilterField",- "check_operator_misuse",- "RedisTag",+ "RedisFilterOperator","RedisNum",+ "RedisTag","RedisText",- "RedisFilterExpression",+ "check_operator_misuse",]diff --git a/libs/langchain/langchain/vectorstores/redis/schema.py b/libs/langchain/langchain/vectorstores/redis/schema.pyindex 7b796cab46..24b19f6385 100644--- a/libs/langchain/langchain/vectorstores/redis/schema.py+++ b/libs/langchain/langchain/vectorstores/redis/schema.py@@ -41,14 +41,14 @@ def __getattr__(name: str) -> Any:__all__ = [- "RedisDistanceMetric",- "RedisField",- "TextFieldSchema",- "TagFieldSchema",- "NumericFieldSchema",- "RedisVectorField","FlatVectorField","HNSWVectorField",+ "NumericFieldSchema",+ "RedisDistanceMetric",+ "RedisField","RedisModel",+ "RedisVectorField",+ "TagFieldSchema",+ "TextFieldSchema","read_schema",]diff --git a/libs/langchain/langchain/vectorstores/sklearn.py b/libs/langchain/langchain/vectorstores/sklearn.pyindex f364698571..dca983b0ee 100644--- a/libs/langchain/langchain/vectorstores/sklearn.py+++ b/libs/langchain/langchain/vectorstores/sklearn.py@@ -34,9 +34,9 @@ def __getattr__(name: str) -> Any:__all__ = ["BaseSerializer",- "JsonSerializer","BsonSerializer",+ "JsonSerializer","ParquetSerializer",- "SKLearnVectorStoreException","SKLearnVectorStore",+ "SKLearnVectorStoreException",]diff --git a/libs/langchain/langchain/vectorstores/starrocks.py b/libs/langchain/langchain/vectorstores/starrocks.pyindex bbc3523f7a..b6eb075a8b 100644--- a/libs/langchain/langchain/vectorstores/starrocks.py+++ b/libs/langchain/langchain/vectorstores/starrocks.py@@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:__all__ = [- "StarRocksSettings","StarRocks",+ "StarRocksSettings",]diff --git a/libs/langchain/langchain/vectorstores/utils.py b/libs/langchain/langchain/vectorstores/utils.pyindex e657035a3e..91248ade24 100644--- a/libs/langchain/langchain/vectorstores/utils.py+++ b/libs/langchain/langchain/vectorstores/utils.py@@ -28,6 +28,6 @@ def __getattr__(name: str) -> Any:__all__ = ["DistanceStrategy",- "maximal_marginal_relevance","filter_complex_metadata",+ "maximal_marginal_relevance",]diff --git a/libs/langchain/pyproject.toml b/libs/langchain/pyproject.tomlindex 91d4b1ddf9..9827a2b058 100644--- a/libs/langchain/pyproject.toml+++ b/libs/langchain/pyproject.toml@@ -143,7 +143,8 @@ ignore-regex = ".*(Stati Uniti|Tense=Pres).*"ignore-words-list = "momento,collison,ned,foor,reworkd,parth,whats,aapply,mysogyny,unsecure,damon,crate,aadd,symbl,precesses,accademia,nin"[tool.ruff.lint]-select = ["A", "C4", "D", "E", "EM", "F", "FBT", "I", "PGH003", "PIE", "RET", "S", "SIM", "T201", "UP", "W"]+select = ["A", "C4", "D", "E", "EM", "F", "FBT", "I", "PGH003", "PIE", "RET", "RUF", "S", "SIM", "T201", "UP", "W"]+ignore = ["RUF012"]pydocstyle.convention = "google"pyupgrade.keep-runtime-typing = truediff --git a/libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.py b/libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.pyindex ae1ed24847..c251d2ea9c 100644--- a/libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.py+++ b/libs/langchain/tests/unit_tests/agents/output_parsers/test_openai_functions.py@@ -13,7 +13,7 @@ from langchain.agents.output_parsers.openai_functions import (def test_not_an_ai() -> None:parser = OpenAIFunctionsAgentOutputParser()- err = f"Expected an AI message got {str(SystemMessage)}"+ err = f"Expected an AI message got {SystemMessage!s}"with pytest.raises(TypeError, match=err):parser.invoke(SystemMessage(content="x"))diff --git a/libs/langchain/tests/unit_tests/agents/test_agent.py b/libs/langchain/tests/unit_tests/agents/test_agent.pyindex 53ada9bd70..3008d40a26 100644--- a/libs/langchain/tests/unit_tests/agents/test_agent.py+++ b/libs/langchain/tests/unit_tests/agents/test_agent.py@@ -1196,7 +1196,7 @@ async def test_openai_agent_tools_agent() -> None:action=OpenAIToolAgentAction(tool="find_pet",tool_input={"pet": "cat"},- log="\nInvoking: `find_pet` with `{'pet': 'cat'}`\n\n\n", # noqa: E501+ log="\nInvoking: `find_pet` with `{'pet': 'cat'}`\n\n\n",message_log=[_AnyIdAIMessageChunk(content="",diff --git a/libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.py b/libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.pyindex 30bbd47a0f..7d18fde122 100644--- a/libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.py+++ b/libs/langchain/tests/unit_tests/agents/test_openai_functions_multi.py@@ -15,7 +15,7 @@ from langchain.agents.openai_functions_multi_agent.base import (class TestParseAIMessage:# Test: Pass Non-AIMessage.def test_not_an_ai(self) -> None:- err = f"Expected an AI message got {str(SystemMessage)}"+ err = f"Expected an AI message got {SystemMessage!s}"with pytest.raises(TypeError, match=err):_parse_ai_message(SystemMessage(content="x"))diff --git a/libs/langchain/tests/unit_tests/indexes/test_api.py b/libs/langchain/tests/unit_tests/indexes/test_api.pyindex 0a60c2b536..0bcbee4b56 100644--- a/libs/langchain/tests/unit_tests/indexes/test_api.py+++ b/libs/langchain/tests/unit_tests/indexes/test_api.py@@ -11,4 +11,4 @@ def test_all() -> None:"SQLRecordManager","VectorstoreIndexCreator",]- assert __all__ == sorted(expected, key=lambda x: x.lower())+ assert sorted(__all__) == sorted(expected)diff --git a/libs/langchain/tests/unit_tests/load/test_load.py b/libs/langchain/tests/unit_tests/load/test_load.pyindex f36a2d24ba..d054115836 100644--- a/libs/langchain/tests/unit_tests/load/test_load.py+++ b/libs/langchain/tests/unit_tests/load/test_load.py@@ -10,7 +10,7 @@ from langchain.chains.llm import LLMChainpytest.importorskip("langchain_openai", reason="langchain_openai not installed")pytest.importorskip("langchain_community", reason="langchain_community not installed")-from langchain_community.llms.openai import ( # noqa: E402 # ignore: community-import+from langchain_community.llms.openai import ( # ignore: community-importOpenAI as CommunityOpenAI,)diff --git a/libs/langchain/tests/unit_tests/output_parsers/test_fix.py b/libs/langchain/tests/unit_tests/output_parsers/test_fix.pyindex ed266e495b..287d5ecf79 100644--- a/libs/langchain/tests/unit_tests/output_parsers/test_fix.py+++ b/libs/langchain/tests/unit_tests/output_parsers/test_fix.py@@ -18,9 +18,7 @@ T = TypeVar("T")class SuccessfulParseAfterRetries(BaseOutputParser[str]):parse_count: int = 0 # Number of times parse has been called- attemp_count_before_success: (- int # Number of times to fail before succeeding # noqa- )+ attemp_count_before_success: int # Number of times to fail before succeedingdef parse(self, *args: Any, **kwargs: Any) -> str:self.parse_count += 1@@ -41,16 +39,14 @@ class SuccessfulParseAfterRetriesWithGetFormatInstructions(SuccessfulParseAfterRSuccessfulParseAfterRetries(attemp_count_before_success=5),SuccessfulParseAfterRetriesWithGetFormatInstructions(attemp_count_before_success=5- ), # noqa: E501+ ),],)def test_output_fixing_parser_parse(base_parser: SuccessfulParseAfterRetries,) -> None:# preparation- n: int = (- base_parser.attemp_count_before_success- ) # Success on the (n+1)-th attempt # noqa+ n: int = base_parser.attemp_count_before_success # Success on the (n+1)-th attemptbase_parser = SuccessfulParseAfterRetries(attemp_count_before_success=n)parser = OutputFixingParser[str](parser=base_parser,@@ -86,15 +82,13 @@ def test_output_fixing_parser_from_llm() -> None:SuccessfulParseAfterRetries(attemp_count_before_success=5),SuccessfulParseAfterRetriesWithGetFormatInstructions(attemp_count_before_success=5- ), # noqa: E501+ ),],)async def test_output_fixing_parser_aparse(base_parser: SuccessfulParseAfterRetries,) -> None:- n: int = (- base_parser.attemp_count_before_success- ) # Success on the (n+1)-th attempt # noqa+ n: int = base_parser.attemp_count_before_success # Success on the (n+1)-th attemptbase_parser = SuccessfulParseAfterRetries(attemp_count_before_success=n)parser = OutputFixingParser[str](parser=base_parser,diff --git a/libs/langchain/tests/unit_tests/test_pytest_config.py b/libs/langchain/tests/unit_tests/test_pytest_config.pyindex 5d553813e2..c2b0af645f 100644--- a/libs/langchain/tests/unit_tests/test_pytest_config.py+++ b/libs/langchain/tests/unit_tests/test_pytest_config.py@@ -6,5 +6,6 @@ import requestsdef test_socket_disabled() -> None:"""This test should fail."""with pytest.raises(pytest_socket.SocketBlockedError):- # noqa since we don't need a timeout here as the request should fail immediately+ # Ignore S113 since we don't need a timeout here as the request+ # should fail immediatelyrequests.get("https://www.example.com") # noqa: S113