langchain: Add ruff rule RUF (#31874)

All auto-fixes
See https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf

---------

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet 2025-07-07 18:49:38 +02:00 committed by GitHub
parent ed35372580
commit ba144c9d7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
291 changed files with 821 additions and 830 deletions

View File

@ -1,4 +1,3 @@
# ruff: noqa: E402
"""Main entrypoint into package."""
import warnings
@ -391,50 +390,50 @@ def __getattr__(name: str) -> Any:
__all__ = [
"FAISS",
"Anthropic",
"ArxivAPIWrapper",
"Banana",
"BasePromptTemplate",
"CerebriumAI",
"Cohere",
"ConversationChain",
"ElasticVectorSearch",
"FewShotPromptTemplate",
"ForefrontAI",
"GoldenQueryAPIWrapper",
"GoogleSearchAPIWrapper",
"GoogleSerperAPIWrapper",
"GooseAI",
"HuggingFaceHub",
"HuggingFacePipeline",
"HuggingFaceTextGenInference",
"InMemoryDocstore",
"LLMChain",
"LLMCheckerChain",
"LLMMathChain",
"ArxivAPIWrapper",
"GoldenQueryAPIWrapper",
"SelfAskWithSearchChain",
"SerpAPIWrapper",
"SerpAPIChain",
"SearxSearchWrapper",
"GoogleSearchAPIWrapper",
"GoogleSerperAPIWrapper",
"WolframAlphaAPIWrapper",
"WikipediaAPIWrapper",
"Anthropic",
"Banana",
"CerebriumAI",
"Cohere",
"ForefrontAI",
"GooseAI",
"LlamaCpp",
"MRKLChain",
"Modal",
"OpenAI",
"Petals",
"PipelineAI",
"StochasticAI",
"Writer",
"BasePromptTemplate",
"Prompt",
"FewShotPromptTemplate",
"PromptTemplate",
"ReActChain",
"Wikipedia",
"HuggingFaceHub",
"SagemakerEndpoint",
"HuggingFacePipeline",
"SQLDatabase",
"PowerBIDataset",
"FAISS",
"MRKLChain",
"VectorDBQA",
"ElasticVectorSearch",
"InMemoryDocstore",
"ConversationChain",
"VectorDBQAWithSourcesChain",
"Prompt",
"PromptTemplate",
"QAWithSourcesChain",
"LlamaCpp",
"HuggingFaceTextGenInference",
"ReActChain",
"SQLDatabase",
"SagemakerEndpoint",
"SearxSearchWrapper",
"SelfAskWithSearchChain",
"SerpAPIChain",
"SerpAPIWrapper",
"StochasticAI",
"VectorDBQA",
"VectorDBQAWithSourcesChain",
"Wikipedia",
"WikipediaAPIWrapper",
"WolframAlphaAPIWrapper",
"Writer",
]

View File

@ -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",
]

View File

@ -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",
]

View File

@ -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"]

View File

@ -47,17 +47,17 @@ def __getattr__(name: str) -> Any:
__all__ = [
"IndexableBaseModel",
"Choice",
"ChatCompletions",
"ChoiceChunk",
"Chat",
"ChatCompletion",
"ChatCompletionChunk",
"ChatCompletions",
"Choice",
"ChoiceChunk",
"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",
]

View File

@ -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",
]

View File

@ -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_values
def 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)

View File

@ -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",
]

View File

@ -51,19 +51,19 @@ def __getattr__(name: str) -> Any:
__all__ = [
"NoInput",
"GetIssue",
"BranchName",
"CommentOnIssue",
"GetPR",
"CreatePR",
"CreateFile",
"ReadFile",
"UpdateFile",
"CreatePR",
"CreateReviewRequest",
"DeleteFile",
"DirectoryPath",
"BranchName",
"SearchCode",
"CreateReviewRequest",
"SearchIssuesAndPRs",
"GetIssue",
"GetPR",
"GitHubToolkit",
"NoInput",
"ReadFile",
"SearchCode",
"SearchIssuesAndPRs",
"UpdateFile",
]

View File

@ -43,10 +43,10 @@ def __getattr__(name: str) -> Any:
__all__ = [
"RequestsGetToolWithParsing",
"RequestsPostToolWithParsing",
"RequestsPatchToolWithParsing",
"RequestsPutToolWithParsing",
"RequestsDeleteToolWithParsing",
"RequestsGetToolWithParsing",
"RequestsPatchToolWithParsing",
"RequestsPostToolWithParsing",
"RequestsPutToolWithParsing",
"create_openapi_agent",
]

View File

@ -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",
]

View File

@ -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"]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"RequestsToolkit",
"OpenAPIToolkit",
"RequestsToolkit",
]

View File

@ -29,8 +29,8 @@ def __getattr__(name: str) -> Any:
__all__ = [
"POWERBI_PREFIX",
"POWERBI_SUFFIX",
"POWERBI_CHAT_PREFIX",
"POWERBI_CHAT_SUFFIX",
"POWERBI_PREFIX",
"POWERBI_SUFFIX",
]

View File

@ -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"]

View File

@ -16,10 +16,10 @@ from langchain.agents.format_scratchpad.tools import format_to_tool_messages
from 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",
]

View File

@ -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)]

View File

@ -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:

View File

@ -25,11 +25,11 @@ from langchain.agents.output_parsers.tools import ToolsAgentOutputParser
from langchain.agents.output_parsers.xml import XMLAgentOutputParser
__all__ = [
"JSONAgentOutputParser",
"OpenAIFunctionsAgentOutputParser",
"ReActJsonSingleInputOutputParser",
"ReActSingleInputOutputParser",
"SelfAskOutputParser",
"ToolsAgentOutputParser",
"ReActJsonSingleInputOutputParser",
"OpenAIFunctionsAgentOutputParser",
"XMLAgentOutputParser",
"JSONAgentOutputParser",
]

View File

@ -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)

View File

@ -53,20 +53,20 @@ def __getattr__(name: str) -> Any:
__all__ = [
"FullLLMCache",
"SQLAlchemyCache",
"SQLiteCache",
"UpstashRedisCache",
"RedisCache",
"RedisSemanticCache",
"GPTCache",
"MomentoCache",
"InMemoryCache",
"CassandraCache",
"CassandraSemanticCache",
"FullMd5LLMCache",
"SQLAlchemyMd5Cache",
"AstraDBCache",
"AstraDBSemanticCache",
"AzureCosmosDBSemanticCache",
"CassandraCache",
"CassandraSemanticCache",
"FullLLMCache",
"FullMd5LLMCache",
"GPTCache",
"InMemoryCache",
"MomentoCache",
"RedisCache",
"RedisSemanticCache",
"SQLAlchemyCache",
"SQLAlchemyMd5Cache",
"SQLiteCache",
"UpstashRedisCache",
]

View File

@ -107,33 +107,33 @@ __all__ = [
"AimCallbackHandler",
"ArgillaCallbackHandler",
"ArizeCallbackHandler",
"PromptLayerCallbackHandler",
"ArthurCallbackHandler",
"AsyncIteratorCallbackHandler",
"ClearMLCallbackHandler",
"CometCallbackHandler",
"ContextCallbackHandler",
"FileCallbackHandler",
"FinalStreamingStdOutCallbackHandler",
"FlyteCallbackHandler",
"HumanApprovalCallbackHandler",
"InfinoCallbackHandler",
"MlflowCallbackHandler",
"LLMonitorCallbackHandler",
"OpenAICallbackHandler",
"StdOutCallbackHandler",
"AsyncIteratorCallbackHandler",
"StreamingStdOutCallbackHandler",
"FinalStreamingStdOutCallbackHandler",
"LLMThoughtLabeler",
"LLMonitorCallbackHandler",
"LabelStudioCallbackHandler",
"LangChainTracer",
"MlflowCallbackHandler",
"OpenAICallbackHandler",
"PromptLayerCallbackHandler",
"SageMakerCallbackHandler",
"StdOutCallbackHandler",
"StreamingStdOutCallbackHandler",
"StreamlitCallbackHandler",
"TrubricsCallbackHandler",
"WandbCallbackHandler",
"WhyLabsCallbackHandler",
"collect_runs",
"get_openai_callback",
"tracing_enabled",
"tracing_v2_enabled",
"collect_runs",
"wandb_tracing_enabled",
"FlyteCallbackHandler",
"SageMakerCallbackHandler",
"LabelStudioCallbackHandler",
"TrubricsCallbackHandler",
]

View File

@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"import_aim",
"BaseMetadataCallbackHandler",
"AimCallbackHandler",
"BaseMetadataCallbackHandler",
"import_aim",
]

View File

@ -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",
]

View File

@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"HumanRejectedException",
"HumanApprovalCallbackHandler",
"AsyncHumanApprovalCallbackHandler",
"HumanApprovalCallbackHandler",
"HumanRejectedException",
]

View File

@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"LabelStudioCallbackHandler",
"LabelStudioMode",
"get_default_label_configs",
"LabelStudioCallbackHandler",
]

View File

@ -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",

View File

@ -31,8 +31,8 @@ def __getattr__(name: str) -> Any:
__all__ = [
"MlflowCallbackHandler",
"MlflowLogger",
"analyze_text",
"construct_html_from_prompt_and_generation",
"MlflowLogger",
"MlflowCallbackHandler",
]

View File

@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"ChildType",
"ChildRecord",
"ChildType",
"MutableExpander",
]

View File

@ -41,9 +41,9 @@ def __getattr__(name: str) -> Any:
__all__ = [
"LLMThoughtState",
"ToolRecord",
"LLMThoughtLabeler",
"LLMThought",
"LLMThoughtLabeler",
"LLMThoughtState",
"StreamlitCallbackHandler",
"ToolRecord",
]

View File

@ -31,8 +31,8 @@ def __getattr__(name: str) -> Any:
__all__ = [
"ConsoleCallbackHandler",
"FunctionCallbackHandler",
"LoggingCallbackHandler",
"LangChainTracer",
"LangChainTracerV1",
"LoggingCallbackHandler",
"WandbTracer",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"import_comet_llm_api",
"CometTracer",
"import_comet_llm_api",
]

View File

@ -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"]

View File

@ -6,4 +6,4 @@ from langchain_core.tracers.log_stream import (
RunState,
)
__all__ = ["LogEntry", "RunState", "RunLog", "RunLogPatch", "LogStreamCallbackHandler"]
__all__ = ["LogEntry", "LogStreamCallbackHandler", "RunLog", "RunLogPatch", "RunState"]

View File

@ -3,4 +3,4 @@ from langchain_core.tracers.stdout import (
FunctionCallbackHandler,
)
__all__ = ["FunctionCallbackHandler", "ConsoleCallbackHandler"]
__all__ = ["ConsoleCallbackHandler", "FunctionCallbackHandler"]

View File

@ -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",
]

View File

@ -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",
)

View File

@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:
return _import_attribute(name)
__all__ = ["APIRequesterChain", "APIRequesterOutputParser", "REQUEST_TEMPLATE"]
__all__ = ["REQUEST_TEMPLATE", "APIRequesterChain", "APIRequesterOutputParser"]

View File

@ -26,4 +26,4 @@ def __getattr__(name: str) -> Any:
return _import_attribute(name)
__all__ = ["APIResponderChain", "APIResponderOutputParser", "RESPONSE_TEMPLATE"]
__all__ = ["RESPONSE_TEMPLATE", "APIResponderChain", "APIResponderOutputParser"]

View File

@ -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)

View File

@ -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",
]

View File

@ -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",
)

View File

@ -133,7 +133,7 @@ class MapReduceDocumentsChain(BaseCombineDocumentsChain):
"""
_output_keys = super().output_keys
if self.return_intermediate_steps:
_output_keys = _output_keys + ["intermediate_steps"]
_output_keys = [*_output_keys, "intermediate_steps"]
return _output_keys
model_config = ConfigDict(
@ -161,8 +161,7 @@ class MapReduceDocumentsChain(BaseCombineDocumentsChain):
)
values["reduce_documents_chain"] = reduce_chain
del values["combine_document_chain"]
if "collapse_document_chain" in values:
del values["collapse_document_chain"]
values.pop("collapse_document_chain", None)
return values

View File

@ -24,7 +24,7 @@ from langchain.output_parsers.regex import RegexParser
message=(
"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_keys
if 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_keys
return _output_keys

View File

@ -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_keys
if self.return_intermediate_steps:
_output_keys = _output_keys + ["intermediate_steps"]
_output_keys = [*_output_keys, "intermediate_steps"]
return _output_keys
model_config = ConfigDict(

View File

@ -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):

View File

@ -19,7 +19,7 @@ from langchain.chains.llm import LLMChain
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.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",
)

View File

@ -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 "

View File

@ -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",
]

View File

@ -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
@abstractmethod

View File

@ -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",
]

View File

@ -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",
]

View File

@ -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"]

View File

@ -30,7 +30,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"GRAPHDB_SPARQL_FIX_TEMPLATE",
"GremlinQAChain",
"INTERMEDIATE_STEPS_KEY",
"GremlinQAChain",
"extract_gremlin",
]

View File

@ -30,7 +30,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"INTERMEDIATE_STEPS_KEY",
"NeptuneSparqlQAChain",
"SPARQL_GENERATION_TEMPLATE",
"NeptuneSparqlQAChain",
"extract_sparql",
]

View File

@ -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",
]

View File

@ -26,7 +26,7 @@ from langchain.chains.llm_math.prompt import PROMPT
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.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",
)

View File

@ -30,7 +30,7 @@ from langchain.chains.llm import LLMChain
removal="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/."
),

View File

@ -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_qa_with_sources_chain",
"create_structured_output_chain",
"create_extraction_chain",
"create_extraction_chain_pydantic",
"create_openai_fn_chain",
"create_structured_output_runnable", # backwards compatibility
"create_openai_fn_runnable", # backwards compatibility
"create_qa_with_sources_chain",
"create_qa_with_structure_chain",
"create_structured_output_chain",
"create_structured_output_runnable", # backwards compatibility
"create_tagging_chain",
"create_tagging_chain_pydantic",
"get_openai_output_parser", # backwards compatibility
]

View File

@ -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",
]

View File

@ -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_schema
schema = 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_dict
elif 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",
)

View File

@ -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(

View File

@ -19,7 +19,7 @@ from langchain.chains.qa_generation.prompt import PROMPT_SELECTOR
since="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",
)

View File

@ -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")

View File

@ -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(

View File

@ -12,12 +12,12 @@ from langchain_core.structured_query import (
)
__all__ = [
"Visitor",
"Expr",
"Operator",
"Comparator",
"FilterDirective",
"Comparison",
"Expr",
"FilterDirective",
"Operation",
"Operator",
"StructuredQuery",
"Visitor",
]

View File

@ -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"
),

View File

@ -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
@classmethod

View File

@ -4,9 +4,9 @@ from langchain.chains.router.multi_prompt import MultiPromptChain
from langchain.chains.router.multi_retrieval_qa import MultiRetrievalQAChain
__all__ = [
"RouterChain",
"MultiRouteChain",
"LLMRouterChain",
"MultiPromptChain",
"MultiRetrievalQAChain",
"LLMRouterChain",
"MultiRouteChain",
"RouterChain",
]

View File

@ -27,7 +27,7 @@ from langchain.chains.router.base import RouterChain
message=(
"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):

View File

@ -21,7 +21,7 @@ from langchain.chains.router.multi_prompt_prompt import MULTI_PROMPT_ROUTER_TEMP
removal="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):

View File

@ -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"]

View File

@ -29,4 +29,4 @@ def __getattr__(name: str) -> Any:
return import_lookup(name)
__all__ = ["SingleFileFacebookMessengerChatLoader", "FolderFacebookMessengerChatLoader"]
__all__ = ["FolderFacebookMessengerChatLoader", "SingleFileFacebookMessengerChatLoader"]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"LangSmithRunChatLoader",
"LangSmithDatasetChatLoader",
"LangSmithRunChatLoader",
]

View File

@ -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",
]

View File

@ -43,35 +43,35 @@ def __getattr__(name: str) -> None:
__all__ = [
"init_chat_model",
"ChatOpenAI",
"BedrockChat",
"AzureChatOpenAI",
"FakeListChatModel",
"PromptLayerChatOpenAI",
"BedrockChat",
"ChatAnthropic",
"ChatAnyscale",
"ChatBaichuan",
"ChatCohere",
"ChatDatabricks",
"ChatEverlyAI",
"ChatAnthropic",
"ChatCohere",
"ChatFireworks",
"ChatGooglePalm",
"ChatMlflow",
"ChatMLflowAIGateway",
"ChatOllama",
"ChatVertexAI",
"JinaChat",
"HumanInputChatModel",
"MiniMaxChat",
"ChatAnyscale",
"ChatLiteLLM",
"ErnieBotChat",
"ChatHunyuan",
"ChatJavelinAIGateway",
"ChatKonko",
"PaiEasChatEndpoint",
"QianfanChatEndpoint",
"ChatFireworks",
"ChatLiteLLM",
"ChatMLflowAIGateway",
"ChatMlflow",
"ChatOllama",
"ChatOpenAI",
"ChatVertexAI",
"ChatYandexGPT",
"ChatBaichuan",
"ChatHunyuan",
"ErnieBotChat",
"FakeListChatModel",
"GigaChat",
"HumanInputChatModel",
"JinaChat",
"MiniMaxChat",
"PaiEasChatEndpoint",
"PromptLayerChatOpenAI",
"QianfanChatEndpoint",
"VolcEngineMaasChat",
"init_chat_model",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"convert_messages_to_prompt_anthropic",
"ChatAnthropic",
"convert_messages_to_prompt_anthropic",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"LlamaContentFormatter",
"AzureMLChatOnlineEndpoint",
"LlamaContentFormatter",
]

View File

@ -31,12 +31,12 @@ from pydantic import BaseModel
from 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",
]

View File

@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"ChatPromptAdapter",
"BedrockChat",
"ChatPromptAdapter",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"FakeMessagesListChatModel",
"FakeListChatModel",
"FakeMessagesListChatModel",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"convert_dict_to_message",
"VolcEngineMaasChat",
"convert_dict_to_message",
]

View File

@ -22,6 +22,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"Docstore",
"AddableMixin",
"Docstore",
]

View File

@ -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",

View File

@ -38,11 +38,11 @@ def __getattr__(name: str) -> Any:
__all__ = [
"AirbyteCDKLoader",
"AirbyteGongLoader",
"AirbyteHubspotLoader",
"AirbyteSalesforceLoader",
"AirbyteShopifyLoader",
"AirbyteStripeLoader",
"AirbyteTypeformLoader",
"AirbyteZendeskSupportLoader",
"AirbyteShopifyLoader",
"AirbyteSalesforceLoader",
"AirbyteGongLoader",
]

View File

@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"TranscriptFormat",
"AssemblyAIAudioTranscriptLoader",
"TranscriptFormat",
]

View File

@ -1,3 +1,3 @@
from langchain_core.document_loaders import BaseBlobParser, BaseLoader
__all__ = ["BaseLoader", "BaseBlobParser"]
__all__ = ["BaseBlobParser", "BaseLoader"]

View File

@ -29,8 +29,8 @@ def __getattr__(name: str) -> Any:
__all__ = [
"BlobLoader",
"Blob",
"BlobLoader",
"FileSystemBlobLoader",
"YoutubeAudioLoader",
]

View File

@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"BlockchainType",
"BlockchainDocumentLoader",
"BlockchainType",
]

View File

@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"concatenate_rows",
"ChatGPTLoader",
"concatenate_rows",
]

View File

@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"ContentFormat",
"ConfluenceLoader",
"ContentFormat",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"UnstructuredEmailLoader",
"OutlookMessageLoader",
"UnstructuredEmailLoader",
]

View File

@ -23,6 +23,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"concatenate_rows",
"FacebookChatLoader",
"concatenate_rows",
]

View File

@ -27,7 +27,7 @@ def __getattr__(name: str) -> Any:
__all__ = [
"NotebookLoader",
"concatenate_cells",
"remove_newlines",
"NotebookLoader",
]

View File

@ -53,6 +53,6 @@ __all__ = [
"PDFMinerParser",
"PDFPlumberParser",
"PyMuPDFParser",
"PyPDFium2Parser",
"PyPDFParser",
"PyPDFium2Parser",
]

View File

@ -25,6 +25,6 @@ def __getattr__(name: str) -> Any:
__all__ = [
"DocAIParsingResults",
"DocAIParser",
"DocAIParsingResults",
]

View File

@ -39,12 +39,12 @@ def __getattr__(name: str) -> Any:
__all__ = [
"extract_from_images_with_rapidocr",
"PyPDFParser",
"PDFMinerParser",
"PyMuPDFParser",
"PyPDFium2Parser",
"PDFPlumberParser",
"AmazonTextractPDFParser",
"DocumentIntelligenceParser",
"PDFMinerParser",
"PDFPlumberParser",
"PyMuPDFParser",
"PyPDFParser",
"PyPDFium2Parser",
"extract_from_images_with_rapidocr",
]

View File

@ -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",
]

View File

@ -31,8 +31,8 @@ def __getattr__(name: str) -> Any:
__all__ = [
"concatenate_rows",
"TelegramChatFileLoader",
"text_to_docs",
"TelegramChatApiLoader",
"TelegramChatFileLoader",
"concatenate_rows",
"text_to_docs",
]

View File

@ -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",
]

Some files were not shown because too many files have changed in this diff Show More