The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community: add mypy warn_unused_ignores rule (#30816)
Christophe Bornetaee7988a947a
diff --git a/libs/community/langchain_community/adapters/openai.py b/libs/community/langchain_community/adapters/openai.pyindex cc40b58112..09b0f5d1d5 100644--- a/libs/community/langchain_community/adapters/openai.py+++ b/libs/community/langchain_community/adapters/openai.py@@ -104,7 +104,7 @@ def convert_dict_to_message(_dict: Mapping[str, Any]) -> BaseMessage:additional_kwargs["name"] = _dict["name"]return ToolMessage(content=_dict.get("content", ""),- tool_call_id=_dict.get("tool_call_id"), # type: ignore[arg-type]+ tool_call_id=_dict.get("tool_call_id"),additional_kwargs=additional_kwargs,)else:diff --git a/libs/community/langchain_community/agent_toolkits/azure_ai_services.py b/libs/community/langchain_community/agent_toolkits/azure_ai_services.pyindex 4b3b529c37..1a69fa7c5b 100644--- a/libs/community/langchain_community/agent_toolkits/azure_ai_services.py+++ b/libs/community/langchain_community/agent_toolkits/azure_ai_services.py@@ -22,7 +22,7 @@ class AzureAiServicesToolkit(BaseToolkit):tools: List[BaseTool] = [AzureAiServicesDocumentIntelligenceTool(), # type: ignore[call-arg]- AzureAiServicesImageAnalysisTool(), # type: ignore[call-arg]+ AzureAiServicesImageAnalysisTool(),AzureAiServicesSpeechToTextTool(), # type: ignore[call-arg]AzureAiServicesTextToSpeechTool(), # type: ignore[call-arg]AzureAiServicesTextAnalyticsForHealthTool(), # type: ignore[call-arg]diff --git a/libs/community/langchain_community/agent_toolkits/file_management/toolkit.py b/libs/community/langchain_community/agent_toolkits/file_management/toolkit.pyindex 90b1f618ec..82c4f3d5cc 100644--- a/libs/community/langchain_community/agent_toolkits/file_management/toolkit.py+++ b/libs/community/langchain_community/agent_toolkits/file_management/toolkit.py@@ -81,7 +81,7 @@ class FileManagementToolkit(BaseToolkit):tools: List[BaseTool] = []for tool in allowed_tools:tool_cls = _FILE_TOOLS_MAP[tool]- tools.append(tool_cls(root_dir=self.root_dir)) # type: ignore[call-arg]+ tools.append(tool_cls(root_dir=self.root_dir))return toolsdiff --git a/libs/community/langchain_community/agent_toolkits/nla/tool.py b/libs/community/langchain_community/agent_toolkits/nla/tool.pyindex f097edaa11..c1206d9475 100644--- a/libs/community/langchain_community/agent_toolkits/nla/tool.py+++ b/libs/community/langchain_community/agent_toolkits/nla/tool.py@@ -13,7 +13,7 @@ from langchain_community.tools.openapi.utils.openapi_utils import OpenAPISpecfrom langchain_community.utilities.requests import Requests-class NLATool(Tool): # type: ignore[override]+class NLATool(Tool):"""Natural Language API Tool."""@classmethoddiff --git a/libs/community/langchain_community/agent_toolkits/openapi/planner.py b/libs/community/langchain_community/agent_toolkits/openapi/planner.pyindex 3d49a22537..978d5d3ce3 100644--- a/libs/community/langchain_community/agent_toolkits/openapi/planner.py+++ b/libs/community/langchain_community/agent_toolkits/openapi/planner.py@@ -64,7 +64,7 @@ def _get_default_llm_chain_factory(return partial(_get_default_llm_chain, prompt)-class RequestsGetToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsGetToolWithParsing(BaseRequestsTool, BaseTool):"""Requests GET tool with LLM-instructed extraction of truncated responses."""name: str = "requests_get"@@ -98,7 +98,7 @@ class RequestsGetToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[ovraise NotImplementedError()-class RequestsPostToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsPostToolWithParsing(BaseRequestsTool, BaseTool):"""Requests POST tool with LLM-instructed extraction of truncated responses."""name: str = "requests_post"@@ -129,7 +129,7 @@ class RequestsPostToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[oraise NotImplementedError()-class RequestsPatchToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsPatchToolWithParsing(BaseRequestsTool, BaseTool):"""Requests PATCH tool with LLM-instructed extraction of truncated responses."""name: str = "requests_patch"@@ -162,7 +162,7 @@ class RequestsPatchToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[raise NotImplementedError()-class RequestsPutToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsPutToolWithParsing(BaseRequestsTool, BaseTool):"""Requests PUT tool with LLM-instructed extraction of truncated responses."""name: str = "requests_put"@@ -193,7 +193,7 @@ class RequestsPutToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[ovraise NotImplementedError()-class RequestsDeleteToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsDeleteToolWithParsing(BaseRequestsTool, BaseTool):"""Tool that sends a DELETE request and parses the response."""name: str = "requests_delete"@@ -266,7 +266,7 @@ def _create_api_controller_agent(if "GET" in allowed_operations:get_llm_chain = LLMChain(llm=llm, prompt=PARSING_GET_PROMPT)tools.append(- RequestsGetToolWithParsing( # type: ignore[call-arg]+ RequestsGetToolWithParsing(requests_wrapper=requests_wrapper,llm_chain=get_llm_chain,allow_dangerous_requests=allow_dangerous_requests,@@ -275,7 +275,7 @@ def _create_api_controller_agent(if "POST" in allowed_operations:post_llm_chain = LLMChain(llm=llm, prompt=PARSING_POST_PROMPT)tools.append(- RequestsPostToolWithParsing( # type: ignore[call-arg]+ RequestsPostToolWithParsing(requests_wrapper=requests_wrapper,llm_chain=post_llm_chain,allow_dangerous_requests=allow_dangerous_requests,@@ -284,7 +284,7 @@ def _create_api_controller_agent(if "PUT" in allowed_operations:put_llm_chain = LLMChain(llm=llm, prompt=PARSING_PUT_PROMPT)tools.append(- RequestsPutToolWithParsing( # type: ignore[call-arg]+ RequestsPutToolWithParsing(requests_wrapper=requests_wrapper,llm_chain=put_llm_chain,allow_dangerous_requests=allow_dangerous_requests,@@ -293,7 +293,7 @@ def _create_api_controller_agent(if "DELETE" in allowed_operations:delete_llm_chain = LLMChain(llm=llm, prompt=PARSING_DELETE_PROMPT)tools.append(- RequestsDeleteToolWithParsing( # type: ignore[call-arg]+ RequestsDeleteToolWithParsing(requests_wrapper=requests_wrapper,llm_chain=delete_llm_chain,allow_dangerous_requests=allow_dangerous_requests,@@ -302,7 +302,7 @@ def _create_api_controller_agent(if "PATCH" in allowed_operations:patch_llm_chain = LLMChain(llm=llm, prompt=PARSING_PATCH_PROMPT)tools.append(- RequestsPatchToolWithParsing( # type: ignore[call-arg]+ RequestsPatchToolWithParsing(requests_wrapper=requests_wrapper,llm_chain=patch_llm_chain,allow_dangerous_requests=allow_dangerous_requests,diff --git a/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py b/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.pyindex 113ff9be53..1d702f5423 100644--- a/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py+++ b/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py@@ -75,7 +75,7 @@ class PowerBIToolkit(BaseToolkit):powerbi=self.powerbi,examples=self.examples,max_iterations=self.max_iterations,- output_token_limit=self.output_token_limit, # type: ignore[arg-type]+ output_token_limit=self.output_token_limit,tiktoken_model_name=self.tiktoken_model_name,),InfoPowerBITool(powerbi=self.powerbi),diff --git a/libs/community/langchain_community/agents/openai_assistant/base.py b/libs/community/langchain_community/agents/openai_assistant/base.pyindex 25ad90f17f..39559aabe9 100644--- a/libs/community/langchain_community/agents/openai_assistant/base.py+++ b/libs/community/langchain_community/agents/openai_assistant/base.py@@ -289,7 +289,7 @@ class OpenAIAssistantV2Runnable(OpenAIAssistantRunnable):name=name,instructions=instructions,tools=[_get_assistants_tool(tool) for tool in tools],- tool_resources=tool_resources, # type: ignore[arg-type]+ tool_resources=tool_resources,model=model,extra_body=extra_body,**model_kwargs,@@ -431,7 +431,7 @@ class OpenAIAssistantV2Runnable(OpenAIAssistantRunnable):name=name,instructions=instructions,tools=openai_tools,- tool_resources=tool_resources, # type: ignore[arg-type]+ tool_resources=tool_resources,model=model,)return cls(assistant_id=assistant.id, async_client=async_client, **kwargs)diff --git a/libs/community/langchain_community/cache.py b/libs/community/langchain_community/cache.pyindex f8b7f0323e..4d38015d19 100644--- a/libs/community/langchain_community/cache.py+++ b/libs/community/langchain_community/cache.py@@ -579,7 +579,7 @@ class AsyncRedisCache(_RedisCacheBase):try:async with self.redis.pipeline() as pipe:self._configure_pipeline_for_update(key, pipe, return_val, self.ttl)- await pipe.execute() # type: ignore[attr-defined]+ await pipe.execute()except Exception as e:logger.error(f"Redis async update failed: {e}")diff --git a/libs/community/langchain_community/chains/ernie_functions/base.py b/libs/community/langchain_community/chains/ernie_functions/base.pyindex e2a58548f3..efe9b9b357 100644--- a/libs/community/langchain_community/chains/ernie_functions/base.py+++ b/libs/community/langchain_community/chains/ernie_functions/base.py@@ -378,7 +378,7 @@ def create_ernie_fn_chain(output_key: str = "function",output_parser: Optional[BaseLLMOutputParser] = None,**kwargs: Any,-) -> LLMChain: # type: ignore[valid-type]+) -> LLMChain:"""[Legacy] Create an LLM chain that uses Ernie functions.Args:@@ -455,7 +455,7 @@ def create_ernie_fn_chain(}if len(ernie_functions) == 1:llm_kwargs["function_call"] = {"name": ernie_functions[0]["name"]}- llm_chain = LLMChain( # type: ignore[misc]+ llm_chain = LLMChain(llm=llm,prompt=prompt,output_parser=output_parser,@@ -474,7 +474,7 @@ def create_structured_output_chain(output_key: str = "function",output_parser: Optional[BaseLLMOutputParser] = None,**kwargs: Any,-) -> LLMChain: # type: ignore[valid-type]+) -> LLMChain:"""[Legacy] Create an LLMChain that uses an Ernie function to get a structured output.Args:diff --git a/libs/community/langchain_community/chains/graph_qa/cypher.py b/libs/community/langchain_community/chains/graph_qa/cypher.pyindex dbfde8d289..719ff3aad0 100644--- a/libs/community/langchain_community/chains/graph_qa/cypher.py+++ b/libs/community/langchain_community/chains/graph_qa/cypher.py@@ -324,7 +324,7 @@ class GraphCypherQAChain(Chain):cypher_generation_chain = LLMChain(llm=cypher_llm or llm, # type: ignore[arg-type]- **use_cypher_llm_kwargs, # type: ignore[arg-type]+ **use_cypher_llm_kwargs,)if exclude_types and include_types:diff --git a/libs/community/langchain_community/chains/graph_qa/memgraph.py b/libs/community/langchain_community/chains/graph_qa/memgraph.pyindex e82c0b7c5d..ebbc220a8f 100644--- a/libs/community/langchain_community/chains/graph_qa/memgraph.py+++ b/libs/community/langchain_community/chains/graph_qa/memgraph.py@@ -235,7 +235,7 @@ class MemgraphQAChain(Chain):llm_to_use = cypher_llm if cypher_llm is not None else llmif prompt is not None and llm_to_use is not None:- cypher_generation_chain = prompt | llm_to_use | StrOutputParser() # type: ignore[arg-type]+ cypher_generation_chain = prompt | llm_to_use | StrOutputParser()else:raise ValueError("Missing required components for the cypher generation chain: "diff --git a/libs/community/langchain_community/chains/graph_qa/neptune_sparql.py b/libs/community/langchain_community/chains/graph_qa/neptune_sparql.pyindex 9155fae090..efc57a5efd 100644--- a/libs/community/langchain_community/chains/graph_qa/neptune_sparql.py+++ b/libs/community/langchain_community/chains/graph_qa/neptune_sparql.py@@ -181,7 +181,7 @@ class NeptuneSparqlQAChain(Chain):)sparql_generation_chain = LLMChain(llm=llm, prompt=sparql_prompt)- return cls( # type: ignore[call-arg]+ return cls(qa_chain=qa_chain,sparql_generation_chain=sparql_generation_chain,examples=examples,diff --git a/libs/community/langchain_community/chains/llm_requests.py b/libs/community/langchain_community/chains/llm_requests.pyindex 6fc23683d2..e781c20d2f 100644--- a/libs/community/langchain_community/chains/llm_requests.py+++ b/libs/community/langchain_community/chains/llm_requests.py@@ -28,7 +28,7 @@ class LLMRequestsChain(Chain):See https://python.langchain.com/docs/security for more information."""- llm_chain: LLMChain # type: ignore[valid-type]+ llm_chain: LLMChainrequests_wrapper: TextRequestsWrapper = Field(default_factory=lambda: TextRequestsWrapper(headers=DEFAULT_HEADERS),exclude=True,@@ -88,7 +88,7 @@ class LLMRequestsChain(Chain):# extract the text from the htmlsoup = BeautifulSoup(res, "html.parser")other_keys[self.requests_key] = soup.get_text()[: self.text_length]- result = self.llm_chain.predict( # type: ignore[attr-defined]+ result = self.llm_chain.predict(callbacks=_run_manager.get_child(), **other_keys)return {self.output_key: result}diff --git a/libs/community/langchain_community/chat_loaders/imessage.py b/libs/community/langchain_community/chat_loaders/imessage.pyindex 4141111355..b6a1dd00d5 100644--- a/libs/community/langchain_community/chat_loaders/imessage.py+++ b/libs/community/langchain_community/chat_loaders/imessage.py@@ -158,7 +158,7 @@ class IMessageChatLoader(BaseChatLoader):continueresults.append(- HumanMessage( # type: ignore[call-arg]+ HumanMessage(role=sender,content=content,additional_kwargs={diff --git a/libs/community/langchain_community/chat_loaders/slack.py b/libs/community/langchain_community/chat_loaders/slack.pyindex 4a11e14445..7ce31f4e54 100644--- a/libs/community/langchain_community/chat_loaders/slack.py+++ b/libs/community/langchain_community/chat_loaders/slack.py@@ -52,7 +52,7 @@ class SlackChatLoader(BaseChatLoader):)else:results.append(- HumanMessage( # type: ignore[call-arg]+ HumanMessage(role=sender,content=text,additional_kwargs={diff --git a/libs/community/langchain_community/chat_loaders/utils.py b/libs/community/langchain_community/chat_loaders/utils.pyindex c82e2e6cb5..f9d1310a1a 100644--- a/libs/community/langchain_community/chat_loaders/utils.py+++ b/libs/community/langchain_community/chat_loaders/utils.py@@ -78,7 +78,7 @@ def map_ai_messages_in_session(chat_sessions: ChatSession, sender: str) -> ChatSmessage = AIMessage(content=message.content,additional_kwargs=message.additional_kwargs.copy(),- example=getattr(message, "example", None), # type: ignore[arg-type]+ example=getattr(message, "example", None),)num_converted += 1messages.append(message)diff --git a/libs/community/langchain_community/chat_loaders/whatsapp.py b/libs/community/langchain_community/chat_loaders/whatsapp.pyindex 4856da0ead..3e678b1063 100644--- a/libs/community/langchain_community/chat_loaders/whatsapp.py+++ b/libs/community/langchain_community/chat_loaders/whatsapp.py@@ -73,7 +73,7 @@ class WhatsAppChatLoader(BaseChatLoader):timestamp, sender, text = result.groups()if not self._ignore_lines.match(text.strip()):results.append(- HumanMessage( # type: ignore[call-arg]+ HumanMessage(role=sender,content=text,additional_kwargs={diff --git a/libs/community/langchain_community/chat_message_histories/sql.py b/libs/community/langchain_community/chat_message_histories/sql.pyindex 08ba11d1fe..d26804ec73 100644--- a/libs/community/langchain_community/chat_message_histories/sql.py+++ b/libs/community/langchain_community/chat_message_histories/sql.py@@ -85,7 +85,7 @@ def create_message_model(table_name: str, DynamicBase: Any) -> Any:"""# Model declared inside a function to have a dynamic table name.- class Message(DynamicBase): # type: ignore[valid-type, misc]+ class Message(DynamicBase):__tablename__ = table_nameid = Column(Integer, primary_key=True)session_id = Column(Text)diff --git a/libs/community/langchain_community/chat_models/anyscale.py b/libs/community/langchain_community/chat_models/anyscale.pyindex b5db8bbeb0..1e1a12e6d9 100644--- a/libs/community/langchain_community/chat_models/anyscale.py+++ b/libs/community/langchain_community/chat_models/anyscale.py@@ -167,7 +167,7 @@ class ChatAnyscale(ChatOpenAI):else:values["openai_api_base"] = values["anyscale_api_base"]values["openai_api_key"] = values["anyscale_api_key"].get_secret_value()- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionexcept AttributeError as exc:raise ValueError("`openai` has no `ChatCompletion` attribute, this is likely "diff --git a/libs/community/langchain_community/chat_models/azure_openai.py b/libs/community/langchain_community/chat_models/azure_openai.pyindex 6825b3d85e..4f52d4e563 100644--- a/libs/community/langchain_community/chat_models/azure_openai.py+++ b/libs/community/langchain_community/chat_models/azure_openai.py@@ -227,7 +227,7 @@ class AzureChatOpenAI(ChatOpenAI):**client_params).chat.completionselse:- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionreturn values@propertydiff --git a/libs/community/langchain_community/chat_models/azureml_endpoint.py b/libs/community/langchain_community/chat_models/azureml_endpoint.pyindex a02919d760..ca7a50793e 100644--- a/libs/community/langchain_community/chat_models/azureml_endpoint.py+++ b/libs/community/langchain_community/chat_models/azureml_endpoint.py@@ -304,7 +304,7 @@ class AzureMLChatOnlineEndpoint(BaseChatModel, AzureMLBaseEndpoint):"http_client": None,}- client = openai.OpenAI(**client_params) # type: ignore[arg-type, arg-type, arg-type, arg-type, arg-type, arg-type]+ client = openai.OpenAI(**client_params)message_dicts = [CustomOpenAIChatContentFormatter._convert_message_to_dict(m)for m in messages@@ -312,30 +312,30 @@ class AzureMLChatOnlineEndpoint(BaseChatModel, AzureMLBaseEndpoint):params = {"stream": True, "stop": stop, "model": None, **kwargs}default_chunk_class = AIMessageChunk- for chunk in client.chat.completions.create(messages=message_dicts, **params): # type: ignore[arg-type]+ for chunk in client.chat.completions.create(messages=message_dicts, **params):if not isinstance(chunk, dict):- chunk = chunk.dict() # type: ignore[attr-defined]- if len(chunk["choices"]) == 0: # type: ignore[call-overload]+ chunk = chunk.dict()+ if len(chunk["choices"]) == 0:continue- choice = chunk["choices"][0] # type: ignore[call-overload]- chunk = _convert_delta_to_message_chunk( # type: ignore[assignment]- choice["delta"], # type: ignore[arg-type, index]- default_chunk_class, # type: ignore[arg-type, index]+ choice = chunk["choices"][0]+ chunk = _convert_delta_to_message_chunk(+ choice["delta"],+ default_chunk_class,)generation_info = {}- if finish_reason := choice.get("finish_reason"): # type: ignore[union-attr]+ if finish_reason := choice.get("finish_reason"):generation_info["finish_reason"] = finish_reason- logprobs = choice.get("logprobs") # type: ignore[union-attr]+ logprobs = choice.get("logprobs")if logprobs:generation_info["logprobs"] = logprobs- default_chunk_class = chunk.__class__ # type: ignore[assignment]- chunk = ChatGenerationChunk( # type: ignore[assignment]- message=chunk, # type: ignore[arg-type]- generation_info=generation_info or None, # type: ignore[arg-type]+ default_chunk_class = chunk.__class__+ chunk = ChatGenerationChunk(+ message=chunk,+ generation_info=generation_info or None,)if run_manager:- run_manager.on_llm_new_token(chunk.text, chunk=chunk, logprobs=logprobs) # type: ignore[attr-defined, arg-type]- yield chunk # type: ignore[misc]+ run_manager.on_llm_new_token(chunk.text, chunk=chunk, logprobs=logprobs)+ yield chunkasync def _astream(self,@@ -359,7 +359,7 @@ class AzureMLChatOnlineEndpoint(BaseChatModel, AzureMLBaseEndpoint):"http_client": None,}- async_client = openai.AsyncOpenAI(**client_params) # type: ignore[arg-type, arg-type, arg-type, arg-type, arg-type, arg-type]+ async_client = openai.AsyncOpenAI(**client_params)message_dicts = [CustomOpenAIChatContentFormatter._convert_message_to_dict(m)for m in messages@@ -367,9 +367,9 @@ class AzureMLChatOnlineEndpoint(BaseChatModel, AzureMLBaseEndpoint):params = {"stream": True, "stop": stop, "model": None, **kwargs}default_chunk_class = AIMessageChunk- async for chunk in await async_client.chat.completions.create( # type: ignore[attr-defined]- messages=message_dicts, # type: ignore[arg-type]- **params, # type: ignore[arg-type]+ async for chunk in await async_client.chat.completions.create(+ messages=message_dicts,+ **params,):if not isinstance(chunk, dict):chunk = chunk.dict()diff --git a/libs/community/langchain_community/chat_models/baichuan.py b/libs/community/langchain_community/chat_models/baichuan.pyindex 73f1a671fa..66c7b27679 100644--- a/libs/community/langchain_community/chat_models/baichuan.py+++ b/libs/community/langchain_community/chat_models/baichuan.py@@ -128,7 +128,7 @@ def _convert_dict_to_message(_dict: Mapping[str, Any]) -> BaseMessage:return AIMessage(content=content,additional_kwargs=additional_kwargs,- tool_calls=tool_calls, # type: ignore[arg-type]+ tool_calls=tool_calls,invalid_tool_calls=invalid_tool_calls,)elif role == "tool":@@ -137,7 +137,7 @@ def _convert_dict_to_message(_dict: Mapping[str, Any]) -> BaseMessage:additional_kwargs["name"] = _dict["name"]return ToolMessage(content=content,- tool_call_id=_dict.get("tool_call_id"), # type: ignore[arg-type]+ tool_call_id=_dict.get("tool_call_id"),additional_kwargs=additional_kwargs,)elif role == "system":diff --git a/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py b/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.pyindex 243ac084d3..5020f6e728 100644--- a/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py+++ b/libs/community/langchain_community/chat_models/baidu_qianfan_endpoint.py@@ -821,7 +821,7 @@ class QianfanChatEndpoint(BaseChatModel):if is_pydantic_schema:output_parser: OutputParserLike = PydanticToolsParser(tools=[schema], # type: ignore[list-item]- first_tool_only=True, # type: ignore[list-item]+ first_tool_only=True,)else:key_name = convert_to_openai_tool(schema)["function"]["name"]diff --git a/libs/community/langchain_community/chat_models/cloudflare_workersai.py b/libs/community/langchain_community/chat_models/cloudflare_workersai.pyindex 4ea9d2d0bf..6d3e0d67c7 100644--- a/libs/community/langchain_community/chat_models/cloudflare_workersai.py+++ b/libs/community/langchain_community/chat_models/cloudflare_workersai.py@@ -213,7 +213,7 @@ class ChatCloudflareWorkersAI(BaseChatModel):if is_pydantic_schema:output_parser: OutputParserLike = PydanticToolsParser(tools=[schema], # type: ignore[list-item]- first_tool_only=True, # type: ignore[list-item]+ first_tool_only=True,)else:output_parser = JsonOutputKeyToolsParser(@@ -222,7 +222,7 @@ class ChatCloudflareWorkersAI(BaseChatModel):elif method == "json_mode":llm = self.bind(response_format={"type": "json_object"})output_parser = (- PydanticOutputParser(pydantic_object=schema) # type: ignore[type-var, arg-type]+ PydanticOutputParser(pydantic_object=schema) # type: ignore[arg-type]if is_pydantic_schemaelse JsonOutputParser())diff --git a/libs/community/langchain_community/chat_models/everlyai.py b/libs/community/langchain_community/chat_models/everlyai.pyindex 52dd4f6c59..b45b40a80e 100644--- a/libs/community/langchain_community/chat_models/everlyai.py+++ b/libs/community/langchain_community/chat_models/everlyai.py@@ -110,7 +110,7 @@ class ChatEverlyAI(ChatOpenAI):"Please install it with `pip install openai`.",) from etry:- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionexcept AttributeError as exc:raise ValueError("`openai` has no `ChatCompletion` attribute, this is likely "diff --git a/libs/community/langchain_community/chat_models/jinachat.py b/libs/community/langchain_community/chat_models/jinachat.pyindex 9a3c8f8c03..72c962d935 100644--- a/libs/community/langchain_community/chat_models/jinachat.py+++ b/libs/community/langchain_community/chat_models/jinachat.py@@ -70,11 +70,11 @@ def _create_retry_decorator(llm: JinaChat) -> Callable[[Any], Any]:stop=stop_after_attempt(llm.max_retries),wait=wait_exponential(multiplier=1, min=min_seconds, max=max_seconds),retry=(- retry_if_exception_type(openai.error.Timeout) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIConnectionError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.RateLimitError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.ServiceUnavailableError) # type: ignore[attr-defined]+ retry_if_exception_type(openai.error.Timeout)+ | retry_if_exception_type(openai.error.APIError)+ | retry_if_exception_type(openai.error.APIConnectionError)+ | retry_if_exception_type(openai.error.RateLimitError)+ | retry_if_exception_type(openai.error.ServiceUnavailableError)),before_sleep=before_sleep_log(logger, logging.WARNING),)@@ -234,7 +234,7 @@ class JinaChat(BaseChatModel):"Please install it with `pip install openai`.")try:- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionexcept AttributeError:raise ValueError("`openai` has no `ChatCompletion` attribute, this is likely "@@ -266,11 +266,11 @@ class JinaChat(BaseChatModel):stop=stop_after_attempt(self.max_retries),wait=wait_exponential(multiplier=1, min=min_seconds, max=max_seconds),retry=(- retry_if_exception_type(openai.error.Timeout) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIConnectionError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.RateLimitError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.ServiceUnavailableError) # type: ignore[attr-defined]+ retry_if_exception_type(openai.error.Timeout)+ | retry_if_exception_type(openai.error.APIError)+ | retry_if_exception_type(openai.error.APIConnectionError)+ | retry_if_exception_type(openai.error.RateLimitError)+ | retry_if_exception_type(openai.error.ServiceUnavailableError)),before_sleep=before_sleep_log(logger, logging.WARNING),)diff --git a/libs/community/langchain_community/chat_models/konko.py b/libs/community/langchain_community/chat_models/konko.pyindex a1164d6d17..af9738f12e 100644--- a/libs/community/langchain_community/chat_models/konko.py+++ b/libs/community/langchain_community/chat_models/konko.py@@ -42,7 +42,7 @@ DEFAULT_MODEL = "meta-llama/Llama-2-13b-chat-hf"logger = logging.getLogger(__name__)-class ChatKonko(ChatOpenAI): # type: ignore[override]+class ChatKonko(ChatOpenAI):"""`ChatKonko` Chat large language models API.To use, you should have the ``konko`` python package installed, and thediff --git a/libs/community/langchain_community/chat_models/llamacpp.py b/libs/community/langchain_community/chat_models/llamacpp.pyindex 9714e76625..46caf5f58d 100644--- a/libs/community/langchain_community/chat_models/llamacpp.py+++ b/libs/community/langchain_community/chat_models/llamacpp.py@@ -664,7 +664,7 @@ def _convert_dict_to_message(_dict: Mapping[str, Any]) -> BaseMessage:additional_kwargs=additional_kwargs,name=name,id=id_,- tool_calls=tool_calls, # type: ignore[arg-type]+ tool_calls=tool_calls,invalid_tool_calls=invalid_tool_calls,)elif role == "system":diff --git a/libs/community/langchain_community/chat_models/minimax.py b/libs/community/langchain_community/chat_models/minimax.pyindex 8329a7d465..8320c8fafc 100644--- a/libs/community/langchain_community/chat_models/minimax.py+++ b/libs/community/langchain_community/chat_models/minimax.py@@ -777,7 +777,7 @@ class MiniMaxChat(BaseChatModel):if is_pydantic_schema:output_parser: OutputParserLike = PydanticToolsParser(tools=[schema], # type: ignore[list-item]- first_tool_only=True, # type: ignore[list-item]+ first_tool_only=True,)else:key_name = convert_to_openai_tool(schema)["function"]["name"]diff --git a/libs/community/langchain_community/chat_models/moonshot.py b/libs/community/langchain_community/chat_models/moonshot.pyindex 68f8fdc5a5..6d31426fda 100644--- a/libs/community/langchain_community/chat_models/moonshot.py+++ b/libs/community/langchain_community/chat_models/moonshot.py@@ -12,7 +12,7 @@ from langchain_community.chat_models import ChatOpenAIfrom langchain_community.llms.moonshot import MOONSHOT_SERVICE_URL_BASE, MoonshotCommon-class MoonshotChat(MoonshotCommon, ChatOpenAI): # type: ignore[misc, override, override]+class MoonshotChat(MoonshotCommon, ChatOpenAI): # type: ignore[misc]"""Moonshot chat model integration.Setup:diff --git a/libs/community/langchain_community/chat_models/oci_data_science.py b/libs/community/langchain_community/chat_models/oci_data_science.pyindex 8ac571adbd..bc5f4c4a76 100644--- a/libs/community/langchain_community/chat_models/oci_data_science.py+++ b/libs/community/langchain_community/chat_models/oci_data_science.py@@ -587,7 +587,7 @@ class ChatOCIModelDeployment(BaseChatModel, BaseOCIModelDeployment):if method == "json_mode":llm = self.bind(response_format={"type": "json_object"})output_parser = (- PydanticOutputParser(pydantic_object=schema) # type: ignore[type-var, arg-type]+ PydanticOutputParser(pydantic_object=schema) # type: ignore[arg-type]if is_pydantic_schemaelse JsonOutputParser())diff --git a/libs/community/langchain_community/chat_models/oci_generative_ai.py b/libs/community/langchain_community/chat_models/oci_generative_ai.pyindex 71ccb600ce..2be677d81f 100644--- a/libs/community/langchain_community/chat_models/oci_generative_ai.py+++ b/libs/community/langchain_community/chat_models/oci_generative_ai.py@@ -725,7 +725,7 @@ class ChatOCIGenAI(BaseChatModel, OCIGenAIBase):elif method == "json_mode":llm = self.bind(response_format={"type": "json_object"})output_parser = (- PydanticOutputParser(pydantic_object=schema) # type: ignore[type-var, arg-type]+ PydanticOutputParser(pydantic_object=schema) # type: ignore[arg-type]if is_pydantic_schemaelse JsonOutputParser())diff --git a/libs/community/langchain_community/chat_models/octoai.py b/libs/community/langchain_community/chat_models/octoai.pyindex 7087748729..cf77bebd4c 100644--- a/libs/community/langchain_community/chat_models/octoai.py+++ b/libs/community/langchain_community/chat_models/octoai.py@@ -98,7 +98,7 @@ class ChatOctoAI(ChatOpenAI):else:values["openai_api_base"] = values["octoai_api_base"]values["openai_api_key"] = values["octoai_api_token"].get_secret_value()- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionexcept ImportError:raise ImportError("Could not import openai python package. "diff --git a/libs/community/langchain_community/chat_models/openai.py b/libs/community/langchain_community/chat_models/openai.pyindex 4d1666b626..164ac03cd5 100644--- a/libs/community/langchain_community/chat_models/openai.py+++ b/libs/community/langchain_community/chat_models/openai.py@@ -88,11 +88,11 @@ def _create_retry_decorator(import openaierrors = [- openai.error.Timeout, # type: ignore[attr-defined]- openai.error.APIError, # type: ignore[attr-defined]- openai.error.APIConnectionError, # type: ignore[attr-defined]- openai.error.RateLimitError, # type: ignore[attr-defined]- openai.error.ServiceUnavailableError, # type: ignore[attr-defined]+ openai.error.Timeout,+ openai.error.APIError,+ openai.error.APIConnectionError,+ openai.error.RateLimitError,+ openai.error.ServiceUnavailableError,]return create_base_retry_decorator(error_types=errors, max_retries=llm.max_retries, run_manager=run_manager@@ -358,7 +358,7 @@ class ChatOpenAI(BaseChatModel):**client_params).chat.completionselif not values.get("client"):- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionelse:passreturn values@@ -595,7 +595,7 @@ class ChatOpenAI(BaseChatModel):if self.openai_proxy:import openai- openai.proxy = {"http": self.openai_proxy, "https": self.openai_proxy} # type: ignore[attr-defined]+ openai.proxy = {"http": self.openai_proxy, "https": self.openai_proxy}return {**self._default_params, **openai_creds}def _get_invocation_params(diff --git a/libs/community/langchain_community/chat_models/perplexity.py b/libs/community/langchain_community/chat_models/perplexity.pyindex 8f054e7b90..e7d57ea04e 100644--- a/libs/community/langchain_community/chat_models/perplexity.py+++ b/libs/community/langchain_community/chat_models/perplexity.py@@ -486,7 +486,7 @@ class ChatPerplexity(BaseChatModel):if is_pydantic_schema and hasattr(schema, "model_json_schema"): # accounting for pydantic v1 and v2- response_format = schema.model_json_schema() # type: ignore[union-attr]+ response_format = schema.model_json_schema()elif is_pydantic_schema:response_format = schema.schema() # type: ignore[union-attr]elif isinstance(schema, dict):diff --git a/libs/community/langchain_community/chat_models/sambanova.py b/libs/community/langchain_community/chat_models/sambanova.pyindex 0e21395f4f..7d58a530f3 100644--- a/libs/community/langchain_community/chat_models/sambanova.py+++ b/libs/community/langchain_community/chat_models/sambanova.py@@ -636,7 +636,7 @@ class ChatSambaNovaCloud(BaseChatModel):if is_pydantic_schema:output_parser: OutputParserLike[Any] = PydanticToolsParser(tools=[schema], # type: ignore[list-item]- first_tool_only=True, # type: ignore[list-item]+ first_tool_only=True,)else:output_parser = JsonOutputKeyToolsParser(@@ -648,7 +648,7 @@ class ChatSambaNovaCloud(BaseChatModel):# llm = self.bind(response_format={"type": "json_object"})if is_pydantic_schema:schema = cast(Type[BaseModel], schema)- output_parser = PydanticOutputParser(pydantic_object=schema) # type: ignore[type-var, arg-type]+ output_parser = PydanticOutputParser(pydantic_object=schema)else:output_parser = JsonOutputParser()@@ -666,7 +666,7 @@ class ChatSambaNovaCloud(BaseChatModel):# )if is_pydantic_schema:schema = cast(Type[BaseModel], schema)- output_parser = PydanticOutputParser(pydantic_object=schema) # type: ignore[type-var, arg-type]+ output_parser = PydanticOutputParser(pydantic_object=schema)else:output_parser = JsonOutputParser()else:diff --git a/libs/community/langchain_community/chat_models/solar.py b/libs/community/langchain_community/chat_models/solar.pyindex 4bcdc0952a..16f3c4d3ed 100644--- a/libs/community/langchain_community/chat_models/solar.py+++ b/libs/community/langchain_community/chat_models/solar.py@@ -13,7 +13,7 @@ from langchain_community.llms.solar import SOLAR_SERVICE_URL_BASE, SolarCommon@deprecated( # type: ignore[arg-type]since="0.0.34", removal="1.0", alternative_import="langchain_upstage.ChatUpstage")-class SolarChat(SolarCommon, ChatOpenAI): # type: ignore[override, override]+class SolarChat(SolarCommon, ChatOpenAI):"""Wrapper around Solar large language models.To use, you should have the ``openai`` python package installed, and theenvironment variable ``SOLAR_API_KEY`` set with your API key.diff --git a/libs/community/langchain_community/chat_models/symblai_nebula.py b/libs/community/langchain_community/chat_models/symblai_nebula.pyindex adacc508ca..9eb9d5f08d 100644--- a/libs/community/langchain_community/chat_models/symblai_nebula.py+++ b/libs/community/langchain_community/chat_models/symblai_nebula.py@@ -176,7 +176,7 @@ class ChatNebula(BaseChatModel):json_payload = json.dumps(payload)async with ClientSession() as session:- async with session.post( # type: ignore[call-arg]+ async with session.post( # type: ignore[call-arg,unused-ignore]url, data=json_payload, headers=headers, stream=True) as response:response.raise_for_status()diff --git a/libs/community/langchain_community/chat_models/tongyi.py b/libs/community/langchain_community/chat_models/tongyi.pyindex c28a727d8e..fce974da69 100644--- a/libs/community/langchain_community/chat_models/tongyi.py+++ b/libs/community/langchain_community/chat_models/tongyi.py@@ -140,7 +140,7 @@ def convert_dict_to_message(else AIMessage(content=content,additional_kwargs=additional_kwargs,- tool_calls=tool_calls, # type: ignore[arg-type]+ tool_calls=tool_calls,invalid_tool_calls=invalid_tool_calls,))@@ -163,7 +163,7 @@ def convert_dict_to_message(if is_chunkelse ToolMessage(content=_dict.get("content", ""),- tool_call_id=_dict.get("tool_call_id"), # type: ignore[arg-type]+ tool_call_id=_dict.get("tool_call_id"),additional_kwargs=additional_kwargs,))@@ -894,7 +894,7 @@ class ChatTongyi(BaseChatModel):if is_pydantic_schema:output_parser: OutputParserLike = PydanticToolsParser(tools=[schema], # type: ignore[list-item]- first_tool_only=True, # type: ignore[list-item]+ first_tool_only=True,)else:key_name = convert_to_openai_tool(schema)["function"]["name"]diff --git a/libs/community/langchain_community/chat_models/vertexai.py b/libs/community/langchain_community/chat_models/vertexai.pyindex 6fae0513f9..eeb638e2dc 100644--- a/libs/community/langchain_community/chat_models/vertexai.py+++ b/libs/community/langchain_community/chat_models/vertexai.py@@ -209,7 +209,7 @@ def _get_question(messages: List[BaseMessage]) -> HumanMessage:removal="1.0",alternative_import="langchain_google_vertexai.ChatVertexAI",)-class ChatVertexAI(_VertexAICommon, BaseChatModel): # type: ignore[override]+class ChatVertexAI(_VertexAICommon, BaseChatModel):"""`Vertex AI` Chat large language models API."""model_name: str = "chat-bison"diff --git a/libs/community/langchain_community/chat_models/zhipuai.py b/libs/community/langchain_community/chat_models/zhipuai.pyindex 18dc9dd196..d3cd1e16d5 100644--- a/libs/community/langchain_community/chat_models/zhipuai.py+++ b/libs/community/langchain_community/chat_models/zhipuai.py@@ -162,7 +162,7 @@ def _convert_dict_to_message(dct: Dict[str, Any]) -> BaseMessage:additional_kwargs["name"] = dct["name"]return ToolMessage(content=content,- tool_call_id=dct.get("tool_call_id"), # type: ignore[arg-type]+ tool_call_id=dct.get("tool_call_id"),additional_kwargs=additional_kwargs,)return ChatMessage(role=role, content=content) # type: ignore[arg-type]@@ -861,7 +861,7 @@ class ChatZhipuAI(BaseChatModel):if is_pydantic_schema:output_parser: OutputParserLike = PydanticToolsParser(tools=[schema], # type: ignore[list-item]- first_tool_only=True, # type: ignore[list-item]+ first_tool_only=True,)else:output_parser = JsonOutputKeyToolsParser(diff --git a/libs/community/langchain_community/document_loaders/async_html.py b/libs/community/langchain_community/document_loaders/async_html.pyindex ddef7385f1..20b3c7ae1e 100644--- a/libs/community/langchain_community/document_loaders/async_html.py+++ b/libs/community/langchain_community/document_loaders/async_html.py@@ -226,8 +226,8 @@ class AsyncHtmlLoader(BaseLoader):# in a separate loop, in a separate thread.with ThreadPoolExecutor(max_workers=1) as executor:future: Future[List[str]] = executor.submit(- asyncio.run, # type: ignore[arg-type]- self.fetch_all(self.web_paths), # type: ignore[arg-type]+ asyncio.run,+ self.fetch_all(self.web_paths),)results = future.result()except RuntimeError:diff --git a/libs/community/langchain_community/document_loaders/blob_loaders/cloud_blob_loader.py b/libs/community/langchain_community/document_loaders/blob_loaders/cloud_blob_loader.pyindex 65621a67af..8413c3108c 100644--- a/libs/community/langchain_community/document_loaders/blob_loaders/cloud_blob_loader.py+++ b/libs/community/langchain_community/document_loaders/blob_loaders/cloud_blob_loader.py@@ -224,7 +224,7 @@ class CloudBlobLoader(BlobLoader):yield self.pathreturn- paths = self.path.glob(self.glob) # type: ignore[attr-defined]+ paths = self.path.glob(self.glob)for path in paths:if self.exclude:if any(path.match(glob) for glob in self.exclude):diff --git a/libs/community/langchain_community/document_loaders/concurrent.py b/libs/community/langchain_community/document_loaders/concurrent.pyindex 8b40924b8e..8a76ef4962 100644--- a/libs/community/langchain_community/document_loaders/concurrent.py+++ b/libs/community/langchain_community/document_loaders/concurrent.py@@ -24,9 +24,9 @@ class ConcurrentLoader(GenericLoader):def __init__(self,- blob_loader: BlobLoader, # type: ignore[valid-type]+ blob_loader: BlobLoader,blob_parser: BaseBlobParser,- num_workers: int = 4, # type: ignore[valid-type]+ num_workers: int = 4,) -> None:super().__init__(blob_loader, blob_parser)self.num_workers = num_workers@@ -40,7 +40,7 @@ class ConcurrentLoader(GenericLoader):) as executor:futures = {executor.submit(self.blob_parser.lazy_parse, blob)- for blob in self.blob_loader.yield_blobs() # type: ignore[attr-defined]+ for blob in self.blob_loader.yield_blobs()}for future in concurrent.futures.as_completed(futures):yield from future.result()@@ -72,7 +72,7 @@ class ConcurrentLoader(GenericLoader):num_workers: Max number of concurrent workers to use.parser_kwargs: Keyword arguments to pass to the parser."""- blob_loader = FileSystemBlobLoader( # type: ignore[attr-defined, misc]+ blob_loader = FileSystemBlobLoader(path,glob=glob,exclude=exclude,diff --git a/libs/community/langchain_community/document_loaders/confluence.py b/libs/community/langchain_community/document_loaders/confluence.pyindex 550da93075..ec1de22507 100644--- a/libs/community/langchain_community/document_loaders/confluence.py+++ b/libs/community/langchain_community/document_loaders/confluence.py@@ -428,7 +428,7 @@ class ConfluenceLoader(BaseLoader):self.number_of_retries # type: ignore[arg-type]),wait=wait_exponential(- multiplier=1, # type: ignore[arg-type]+ multiplier=1,min=self.min_retry_seconds, # type: ignore[arg-type]max=self.max_retry_seconds, # type: ignore[arg-type]),diff --git a/libs/community/langchain_community/document_loaders/csv_loader.py b/libs/community/langchain_community/document_loaders/csv_loader.pyindex 5992792056..e6f3ab16aa 100644--- a/libs/community/langchain_community/document_loaders/csv_loader.py+++ b/libs/community/langchain_community/document_loaders/csv_loader.py@@ -223,4 +223,4 @@ class UnstructuredCSVLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.csv import partition_csv- return partition_csv(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_csv(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/doc_intelligence.py b/libs/community/langchain_community/document_loaders/doc_intelligence.pyindex 4f01e32ff7..10369e5d70 100644--- a/libs/community/langchain_community/document_loaders/doc_intelligence.py+++ b/libs/community/langchain_community/document_loaders/doc_intelligence.py@@ -101,7 +101,7 @@ class AzureAIDocumentIntelligenceLoader(BaseLoader):self.url_path = url_pathself.bytes_source = bytes_source- self.parser = AzureAIDocumentIntelligenceParser( # type: ignore[misc]+ self.parser = AzureAIDocumentIntelligenceParser(api_endpoint=api_endpoint,api_key=api_key,api_version=api_version,@@ -116,10 +116,10 @@ class AzureAIDocumentIntelligenceLoader(BaseLoader):) -> Iterator[Document]:"""Lazy load the document as pages."""if self.file_path is not None:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)yield from self.parser.parse(blob)elif self.url_path is not None:- yield from self.parser.parse_url(self.url_path) # type: ignore[arg-type]+ yield from self.parser.parse_url(self.url_path)elif self.bytes_source is not None:yield from self.parser.parse_bytes(self.bytes_source)else:diff --git a/libs/community/langchain_community/document_loaders/email.py b/libs/community/langchain_community/document_loaders/email.pyindex c7e7cee54b..24716c55a9 100644--- a/libs/community/langchain_community/document_loaders/email.py+++ b/libs/community/langchain_community/document_loaders/email.py@@ -60,16 +60,16 @@ class UnstructuredEmailLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.file_utils.filetype import FileType, detect_filetype- filetype = detect_filetype(self.file_path) # type: ignore[arg-type]+ filetype = detect_filetype(self.file_path)if filetype == FileType.EML:from unstructured.partition.email import partition_email- return partition_email(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_email(filename=self.file_path, **self.unstructured_kwargs)elif satisfies_min_unstructured_version("0.5.8") and filetype == FileType.MSG:from unstructured.partition.msg import partition_msg- return partition_msg(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_msg(filename=self.file_path, **self.unstructured_kwargs)else:raise ValueError(f"Filetype {filetype} is not supported in UnstructuredEmailLoader."diff --git a/libs/community/langchain_community/document_loaders/epub.py b/libs/community/langchain_community/document_loaders/epub.pyindex d72fe0661e..806737b62a 100644--- a/libs/community/langchain_community/document_loaders/epub.py+++ b/libs/community/langchain_community/document_loaders/epub.py@@ -52,4 +52,4 @@ class UnstructuredEPubLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.epub import partition_epub- return partition_epub(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_epub(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/excel.py b/libs/community/langchain_community/document_loaders/excel.pyindex aa28d89110..eeb08c1873 100644--- a/libs/community/langchain_community/document_loaders/excel.py+++ b/libs/community/langchain_community/document_loaders/excel.py@@ -49,4 +49,4 @@ class UnstructuredExcelLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.xlsx import partition_xlsx- return partition_xlsx(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_xlsx(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/generic.py b/libs/community/langchain_community/document_loaders/generic.pyindex 49b0c9eb2e..191149618b 100644--- a/libs/community/langchain_community/document_loaders/generic.py+++ b/libs/community/langchain_community/document_loaders/generic.py@@ -96,7 +96,7 @@ class GenericLoader(BaseLoader):def __init__(self,- blob_loader: BlobLoader, # type: ignore[valid-type]+ blob_loader: BlobLoader,blob_parser: BaseBlobParser,) -> None:"""A generic document loader.@@ -112,7 +112,7 @@ class GenericLoader(BaseLoader):self,) -> Iterator[Document]:"""Load documents lazily. Use this when working at a large scale."""- for blob in self.blob_loader.yield_blobs(): # type: ignore[attr-defined]+ for blob in self.blob_loader.yield_blobs():yield from self.blob_parser.lazy_parse(blob)def load_and_split(@@ -159,7 +159,7 @@ class GenericLoader(BaseLoader):Returns:A generic document loader."""- blob_loader = FileSystemBlobLoader( # type: ignore[attr-defined, misc]+ blob_loader = FileSystemBlobLoader(path,glob=glob,exclude=exclude,diff --git a/libs/community/langchain_community/document_loaders/git.py b/libs/community/langchain_community/document_loaders/git.pyindex 3b380b275f..b37f575eac 100644--- a/libs/community/langchain_community/document_loaders/git.py+++ b/libs/community/langchain_community/document_loaders/git.py@@ -74,7 +74,7 @@ class GitLoader(BaseLoader):file_path = os.path.join(self.repo_path, item.path)- ignored_files = repo.ignored([file_path]) # type: ignore[arg-type]+ ignored_files = repo.ignored([file_path])if len(ignored_files):continuediff --git a/libs/community/langchain_community/document_loaders/html.py b/libs/community/langchain_community/document_loaders/html.pyindex 9ea781a7e9..2ec3224e66 100644--- a/libs/community/langchain_community/document_loaders/html.py+++ b/libs/community/langchain_community/document_loaders/html.py@@ -48,4 +48,4 @@ class UnstructuredHTMLLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.html import partition_html- return partition_html(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_html(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/image.py b/libs/community/langchain_community/document_loaders/image.pyindex 63a89e71cc..acec0f360d 100644--- a/libs/community/langchain_community/document_loaders/image.py+++ b/libs/community/langchain_community/document_loaders/image.py@@ -48,4 +48,4 @@ class UnstructuredImageLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.image import partition_image- return partition_image(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_image(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/image_captions.py b/libs/community/langchain_community/document_loaders/image_captions.pyindex aeb1580cb3..568fa0a25a 100644--- a/libs/community/langchain_community/document_loaders/image_captions.py+++ b/libs/community/langchain_community/document_loaders/image_captions.py@@ -76,13 +76,13 @@ class ImageCaptionLoader(BaseLoader):try:if isinstance(image, bytes):- image = Image.open(BytesIO(image)).convert("RGB") # type: ignore[assignment]+ image = Image.open(BytesIO(image)).convert("RGB")elif isinstance(image, str) and (image.startswith("http://") or image.startswith("https://")):- image = Image.open(requests.get(image, stream=True).raw).convert("RGB") # type: ignore[assignment, arg-type]+ image = Image.open(requests.get(image, stream=True).raw).convert("RGB")else:- image = Image.open(image).convert("RGB") # type: ignore[assignment]+ image = Image.open(image).convert("RGB")except Exception:if isinstance(image_source, bytes):msg = "Could not get image data from bytes"diff --git a/libs/community/langchain_community/document_loaders/markdown.py b/libs/community/langchain_community/document_loaders/markdown.pyindex 3c3196c2cb..e940bff593 100644--- a/libs/community/langchain_community/document_loaders/markdown.py+++ b/libs/community/langchain_community/document_loaders/markdown.py@@ -93,4 +93,4 @@ class UnstructuredMarkdownLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.md import partition_md- return partition_md(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_md(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/odt.py b/libs/community/langchain_community/document_loaders/odt.pyindex 7d1236ff88..d1598d068d 100644--- a/libs/community/langchain_community/document_loaders/odt.py+++ b/libs/community/langchain_community/document_loaders/odt.py@@ -52,4 +52,4 @@ class UnstructuredODTLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.odt import partition_odt- return partition_odt(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_odt(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/org_mode.py b/libs/community/langchain_community/document_loaders/org_mode.pyindex b8ba182843..614ad70b72 100644--- a/libs/community/langchain_community/document_loaders/org_mode.py+++ b/libs/community/langchain_community/document_loaders/org_mode.py@@ -52,4 +52,4 @@ class UnstructuredOrgModeLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.org import partition_org- return partition_org(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_org(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/parsers/audio.py b/libs/community/langchain_community/document_loaders/parsers/audio.pyindex 4e1ac1bba6..5da288d473 100644--- a/libs/community/langchain_community/document_loaders/parsers/audio.py+++ b/libs/community/langchain_community/document_loaders/parsers/audio.py@@ -322,7 +322,7 @@ class OpenAIWhisperParser(BaseBlobParser):model=self.model, file=file_obj, **self._create_params)else:- transcript = openai.Audio.transcribe(self.model, file_obj) # type: ignore[attr-defined]+ transcript = openai.Audio.transcribe(self.model, file_obj)breakexcept Exception as e:attempts += 1diff --git a/libs/community/langchain_community/document_loaders/parsers/msword.py b/libs/community/langchain_community/document_loaders/parsers/msword.pyindex c366a8ce1a..f2a03cc37d 100644--- a/libs/community/langchain_community/document_loaders/parsers/msword.py+++ b/libs/community/langchain_community/document_loaders/parsers/msword.py@@ -9,7 +9,7 @@ from langchain_community.document_loaders.blob_loaders import Blobclass MsWordParser(BaseBlobParser):"""Parse the Microsoft Word documents from a blob."""- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Parse a Microsoft Word document into the Document iterator.Args:@@ -33,13 +33,13 @@ class MsWordParser(BaseBlobParser):partition_docx),}- if blob.mimetype not in ( # type: ignore[attr-defined]+ if blob.mimetype not in ("application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document",):raise ValueError("This blob type is not supported for this parser.")- with blob.as_bytes_io() as word_document: # type: ignore[attr-defined]- elements = mime_type_parser[blob.mimetype](file=word_document) # type: ignore[attr-defined] # type: ignore[operator] # type: ignore[operator] # type: ignore[operator] # type: ignore[operator] # type: ignore[operator] # type: ignore[operator]+ with blob.as_bytes_io() as word_document:+ elements = mime_type_parser[blob.mimetype](file=word_document)text = "\n\n".join([str(el) for el in elements])- metadata = {"source": blob.source} # type: ignore[attr-defined]+ metadata = {"source": blob.source}yield Document(page_content=text, metadata=metadata)diff --git a/libs/community/langchain_community/document_loaders/parsers/pdf.py b/libs/community/langchain_community/document_loaders/parsers/pdf.pyindex 46ad300be9..6b3a0a065a 100644--- a/libs/community/langchain_community/document_loaders/parsers/pdf.py+++ b/libs/community/langchain_community/document_loaders/parsers/pdf.py@@ -340,7 +340,7 @@ class PyPDFParser(BaseBlobParser):self.extraction_mode = extraction_modeself.extraction_kwargs = extraction_kwargs or {}- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Lazily parse the blob.Insert image, if possible, between two paragraphs.@@ -380,7 +380,7 @@ class PyPDFParser(BaseBlobParser):**self.extraction_kwargs,)- with blob.as_bytes_io() as pdf_file_obj: # type: ignore[attr-defined]+ with blob.as_bytes_io() as pdf_file_obj:pdf_reader = pypdf.PdfReader(pdf_file_obj, password=self.password)doc_metadata = _purge_metadata(@@ -434,7 +434,7 @@ class PyPDFParser(BaseBlobParser):if "/XObject" not in cast(dict, page["/Resources"]).keys():return ""- xObject = page["/Resources"]["/XObject"].get_object() # type: ignore[index]+ xObject = page["/Resources"]["/XObject"].get_object()images = []for obj in xObject:np_image: Any = None@@ -677,7 +677,7 @@ class PDFMinerParser(BaseBlobParser):return metadata- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Lazily parse the blob.Insert image, if possible, between two paragraphs.@@ -919,7 +919,7 @@ class PyMuPDFParser(BaseBlobParser):self.extract_tables = extract_tablesself.extract_tables_settings = extract_tables_settings- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:return self._lazy_parse(blob,)@@ -930,7 +930,7 @@ class PyMuPDFParser(BaseBlobParser):# text-kwargs is present for backwards compatibility.# Users should not use it directly.text_kwargs: Optional[dict[str, Any]] = None,- ) -> Iterator[Document]: # type: ignore[valid-type]+ ) -> Iterator[Document]:"""Lazily parse the blob.Insert image, if possible, between two paragraphs.In this way, a paragraph can be continued on the next page.@@ -990,8 +990,8 @@ class PyMuPDFParser(BaseBlobParser):)with PyMuPDFParser._lock:- with blob.as_bytes_io() as file_path: # type: ignore[attr-defined]- if blob.data is None: # type: ignore[attr-defined]+ with blob.as_bytes_io() as file_path:+ if blob.data is None:doc = pymupdf.open(file_path)else:doc = pymupdf.open(stream=file_path, filetype="pdf")@@ -1066,8 +1066,8 @@ class PyMuPDFParser(BaseBlobParser):"producer": "PyMuPDF","creator": "PyMuPDF","creationdate": "",- "source": blob.source, # type: ignore[attr-defined]- "file_path": blob.source, # type: ignore[attr-defined]+ "source": blob.source,+ "file_path": blob.source,"total_pages": len(doc),},**{@@ -1273,7 +1273,7 @@ class PyPDFium2Parser(BaseBlobParser):self.mode = modeself.pages_delimiter = pages_delimiter- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Lazily parse the blob.Insert image, if possible, between two paragraphs.@@ -1299,7 +1299,7 @@ class PyPDFium2Parser(BaseBlobParser):# pypdfium2 is really finicky with respect to closing things,# if done incorrectly creates seg faults.with PyPDFium2Parser._lock:- with blob.as_bytes_io() as file_path: # type: ignore[attr-defined]+ with blob.as_bytes_io() as file_path:pdf_reader = Nonetry:pdf_reader = pypdfium2.PdfDocument(@@ -1410,11 +1410,11 @@ class PDFPlumberParser(BaseBlobParser):self.dedupe = dedupeself.extract_images = extract_images- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Lazily parse the blob."""import pdfplumber- with blob.as_bytes_io() as file_path: # type: ignore[attr-defined]+ with blob.as_bytes_io() as file_path:doc = pdfplumber.open(file_path) # open documentyield from [@@ -1424,8 +1424,8 @@ class PDFPlumberParser(BaseBlobParser):+ self._extract_images_from_page(page),metadata=dict({- "source": blob.source, # type: ignore[attr-defined]- "file_path": blob.source, # type: ignore[attr-defined]+ "source": blob.source,+ "file_path": blob.source,"page": page.page_number - 1,"total_pages": len(doc.pages),},@@ -1593,14 +1593,14 @@ class AmazonTextractPDFParser(BaseBlobParser):else:self.boto3_textract_client = client- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Iterates over the Blob pages and returns an Iterator with a Documentfor each page, like the other parsers If multi-page document, blob.pathhas to be set to the S3 URI and for single page docsthe blob.data is taken"""- url_parse_result = urlparse(str(blob.path)) if blob.path else None # type: ignore[attr-defined]+ url_parse_result = urlparse(str(blob.path)) if blob.path else None# Either call with S3 path (multi-page) or with bytes (single-page)if (url_parse_result@@ -1608,13 +1608,13 @@ class AmazonTextractPDFParser(BaseBlobParser):and url_parse_result.netloc):textract_response_json = self.tc.call_textract(- input_document=str(blob.path), # type: ignore[attr-defined]+ input_document=str(blob.path),features=self.textract_features,boto3_textract_client=self.boto3_textract_client,)else:textract_response_json = self.tc.call_textract(- input_document=blob.as_bytes(), # type: ignore[attr-defined]+ input_document=blob.as_bytes(),features=self.textract_features,call_mode=self.tc.Textract_Call_Mode.FORCE_SYNC,boto3_textract_client=self.boto3_textract_client,@@ -1625,7 +1625,7 @@ class AmazonTextractPDFParser(BaseBlobParser):for idx, page in enumerate(document.pages):yield Document(page_content=page.get_text(config=self.linearization_config),- metadata={"source": blob.source, "page": idx + 1}, # type: ignore[attr-defined]+ metadata={"source": blob.source, "page": idx + 1},)@@ -1645,23 +1645,23 @@ class DocumentIntelligenceParser(BaseBlobParser):self.client = clientself.model = model- def _generate_docs(self, blob: Blob, result: Any) -> Iterator[Document]: # type: ignore[valid-type]+ def _generate_docs(self, blob: Blob, result: Any) -> Iterator[Document]:for p in result.pages:content = " ".join([line.content for line in p.lines])d = Document(page_content=content,metadata={- "source": blob.source, # type: ignore[attr-defined]+ "source": blob.source,"page": p.page_number,},)yield d- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Lazily parse the blob."""- with blob.as_bytes_io() as file_obj: # type: ignore[attr-defined]+ with blob.as_bytes_io() as file_obj:poller = self.client.begin_analyze_document(self.model, file_obj)result = poller.result()diff --git a/libs/community/langchain_community/document_loaders/parsers/txt.py b/libs/community/langchain_community/document_loaders/parsers/txt.pyindex ae46f68ab2..5b2da30743 100644--- a/libs/community/langchain_community/document_loaders/parsers/txt.py+++ b/libs/community/langchain_community/document_loaders/parsers/txt.py@@ -11,6 +11,6 @@ from langchain_community.document_loaders.blob_loaders import Blobclass TextParser(BaseBlobParser):"""Parser for text blobs."""- def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignore[valid-type]+ def lazy_parse(self, blob: Blob) -> Iterator[Document]:"""Lazily parse the blob."""- yield Document(page_content=blob.as_string(), metadata={"source": blob.source}) # type: ignore[attr-defined]+ yield Document(page_content=blob.as_string(), metadata={"source": blob.source})diff --git a/libs/community/langchain_community/document_loaders/pdf.py b/libs/community/langchain_community/document_loaders/pdf.pyindex b9e57b19ff..6b51e481eb 100644--- a/libs/community/langchain_community/document_loaders/pdf.py+++ b/libs/community/langchain_community/document_loaders/pdf.py@@ -91,7 +91,7 @@ class UnstructuredPDFLoader(UnstructuredFileLoader):def _get_elements(self) -> list:from unstructured.partition.pdf import partition_pdf- return partition_pdf(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_pdf(filename=self.file_path, **self.unstructured_kwargs)class BasePDFLoader(BaseLoader, ABC):@@ -299,11 +299,9 @@ class PyPDFLoader(BasePDFLoader):In this way, a paragraph can be continued on the next page."""if self.web_path:- blob = Blob.from_data( # type: ignore[attr-defined]- open(self.file_path, "rb").read(), path=self.web_path- )+ blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path)else:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)yield from self.parser.lazy_parse(blob)@@ -415,11 +413,9 @@ class PyPDFium2Loader(BasePDFLoader):In this way, a paragraph can be continued on the next page."""if self.web_path:- blob = Blob.from_data( # type: ignore[attr-defined]- open(self.file_path, "rb").read(), path=self.web_path- )+ blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path)else:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)yield from self.parser.parse(blob)@@ -674,11 +670,9 @@ class PDFMinerLoader(BasePDFLoader):In this way, a paragraph can be continued on the next page."""if self.web_path:- blob = Blob.from_data( # type: ignore[attr-defined]- open(self.file_path, "rb").read(), path=self.web_path- )+ blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path)else:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)yield from self.parser.lazy_parse(blob)@@ -850,9 +844,9 @@ class PyMuPDFLoader(BasePDFLoader):)parser = self.parserif self.web_path:- blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path) # type: ignore[attr-defined]+ blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path)else:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)yield from parser._lazy_parse(blob, text_kwargs=kwargs)def load(self, **kwargs: Any) -> list[Document]:@@ -1046,9 +1040,9 @@ class PDFPlumberLoader(BasePDFLoader):extract_images=self.extract_images,)if self.web_path:- blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path) # type: ignore[attr-defined]+ blob = Blob.from_data(open(self.file_path, "rb").read(), path=self.web_path)else:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)return parser.parse(blob)@@ -1163,7 +1157,7 @@ class AmazonTextractPDFLoader(BasePDFLoader):# raises ValueError when multipage and not on S3"""if self.web_path and self._is_s3_url(self.web_path):- blob = Blob(path=self.web_path) # type: ignore[call-arg] # type: ignore[misc]+ blob = Blob(path=self.web_path)else:blob = Blob.from_path(self.file_path)if AmazonTextractPDFLoader._get_number_of_pages(blob) > 1:@@ -1176,7 +1170,7 @@ class AmazonTextractPDFLoader(BasePDFLoader):yield from self.parser.parse(blob)@staticmethod- def _get_number_of_pages(blob: Blob) -> int: # type: ignore[valid-type]+ def _get_number_of_pages(blob: Blob) -> int:try:import pypdffrom PIL import Image, ImageSequence@@ -1186,22 +1180,20 @@ class AmazonTextractPDFLoader(BasePDFLoader):"Could not import pypdf or Pilloe python package. ""Please install it with `pip install pypdf Pillow`.")- if blob.mimetype == "application/pdf": # type: ignore[attr-defined]- with blob.as_bytes_io() as input_pdf_file: # type: ignore[attr-defined]+ if blob.mimetype == "application/pdf":+ with blob.as_bytes_io() as input_pdf_file:pdf_reader = pypdf.PdfReader(input_pdf_file)return len(pdf_reader.pages)- elif blob.mimetype == "image/tiff": # type: ignore[attr-defined]+ elif blob.mimetype == "image/tiff":num_pages = 0- img = Image.open(blob.as_bytes()) # type: ignore[attr-defined]+ img = Image.open(blob.as_bytes())for _, _ in enumerate(ImageSequence.Iterator(img)):num_pages += 1return num_pages- elif blob.mimetype in ["image/png", "image/jpeg"]: # type: ignore[attr-defined]+ elif blob.mimetype in ["image/png", "image/jpeg"]:return 1else:- raise ValueError( # type: ignore[attr-defined]- f"unsupported mime type: {blob.mimetype}"- )+ raise ValueError(f"unsupported mime type: {blob.mimetype}")class DedocPDFLoader(DedocBaseLoader):@@ -1348,7 +1340,7 @@ class DocumentIntelligenceLoader(BasePDFLoader):self,) -> Iterator[Document]:"""Lazy load given path as pages."""- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)yield from self.parser.parse(blob)diff --git a/libs/community/langchain_community/document_loaders/powerpoint.py b/libs/community/langchain_community/document_loaders/powerpoint.pyindex 0fecbe4b67..d075402647 100644--- a/libs/community/langchain_community/document_loaders/powerpoint.py+++ b/libs/community/langchain_community/document_loaders/powerpoint.py@@ -59,7 +59,7 @@ class UnstructuredPowerPointLoader(UnstructuredFileLoader):try:import magic # noqa: F401- is_ppt = detect_filetype(self.file_path) == FileType.PPT # type: ignore[arg-type]+ is_ppt = detect_filetype(self.file_path) == FileType.PPTexcept ImportError:_, extension = os.path.splitext(str(self.file_path))is_ppt = extension == ".ppt"@@ -70,8 +70,8 @@ class UnstructuredPowerPointLoader(UnstructuredFileLoader):if is_ppt:from unstructured.partition.ppt import partition_ppt- return partition_ppt(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_ppt(filename=self.file_path, **self.unstructured_kwargs)else:from unstructured.partition.pptx import partition_pptx- return partition_pptx(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_pptx(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/rst.py b/libs/community/langchain_community/document_loaders/rst.pyindex 77e4fc38b9..fa76979692 100644--- a/libs/community/langchain_community/document_loaders/rst.py+++ b/libs/community/langchain_community/document_loaders/rst.py@@ -56,4 +56,4 @@ class UnstructuredRSTLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.rst import partition_rst- return partition_rst(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_rst(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/rtf.py b/libs/community/langchain_community/document_loaders/rtf.pyindex bbecd7f455..871da2b482 100644--- a/libs/community/langchain_community/document_loaders/rtf.py+++ b/libs/community/langchain_community/document_loaders/rtf.py@@ -56,4 +56,4 @@ class UnstructuredRTFLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.rtf import partition_rtf- return partition_rtf(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_rtf(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/tsv.py b/libs/community/langchain_community/document_loaders/tsv.pyindex a9455fd06f..4cb3645b49 100644--- a/libs/community/langchain_community/document_loaders/tsv.py+++ b/libs/community/langchain_community/document_loaders/tsv.py@@ -39,4 +39,4 @@ class UnstructuredTSVLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.tsv import partition_tsv- return partition_tsv(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_tsv(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/vsdx.py b/libs/community/langchain_community/document_loaders/vsdx.pyindex fd7d252032..5546d5db4d 100644--- a/libs/community/langchain_community/document_loaders/vsdx.py+++ b/libs/community/langchain_community/document_loaders/vsdx.py@@ -37,7 +37,7 @@ class VsdxLoader(BaseLoader, ABC):elif not os.path.isfile(self.file_path):raise ValueError("File path %s is not a valid file or url" % self.file_path)- self.parser = VsdxParser() # type: ignore[misc]+ self.parser = VsdxParser()def __del__(self) -> None:if hasattr(self, "temp_file"):@@ -50,5 +50,5 @@ class VsdxLoader(BaseLoader, ABC):return bool(parsed.netloc) and bool(parsed.scheme)def load(self) -> List[Document]:- blob = Blob.from_path(self.file_path) # type: ignore[attr-defined]+ blob = Blob.from_path(self.file_path)return list(self.parser.parse(blob))diff --git a/libs/community/langchain_community/document_loaders/weather.py b/libs/community/langchain_community/document_loaders/weather.pyindex ff35956d10..a051f9ccf4 100644--- a/libs/community/langchain_community/document_loaders/weather.py+++ b/libs/community/langchain_community/document_loaders/weather.py@@ -33,7 +33,7 @@ class WeatherDataLoader(BaseLoader):def from_params(cls, places: Sequence[str], *, openweathermap_api_key: Optional[str] = None) -> WeatherDataLoader:- client = OpenWeatherMapAPIWrapper(openweathermap_api_key=openweathermap_api_key) # type: ignore[call-arg]+ client = OpenWeatherMapAPIWrapper(openweathermap_api_key=openweathermap_api_key)return cls(client, places)def lazy_load(diff --git a/libs/community/langchain_community/document_loaders/word_document.py b/libs/community/langchain_community/document_loaders/word_document.pyindex eac96eb5fa..957eefe7bc 100644--- a/libs/community/langchain_community/document_loaders/word_document.py+++ b/libs/community/langchain_community/document_loaders/word_document.py@@ -121,7 +121,7 @@ class UnstructuredWordDocumentLoader(UnstructuredFileLoader):try:import magic # noqa: F401- is_doc = detect_filetype(self.file_path) == FileType.DOC # type: ignore[arg-type]+ is_doc = detect_filetype(self.file_path) == FileType.DOCexcept ImportError:_, extension = os.path.splitext(str(self.file_path))is_doc = extension == ".doc"@@ -132,8 +132,8 @@ class UnstructuredWordDocumentLoader(UnstructuredFileLoader):if is_doc:from unstructured.partition.doc import partition_doc- return partition_doc(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_doc(filename=self.file_path, **self.unstructured_kwargs)else:from unstructured.partition.docx import partition_docx- return partition_docx(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_docx(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_loaders/xml.py b/libs/community/langchain_community/document_loaders/xml.pyindex 1541e3b897..a4757f222b 100644--- a/libs/community/langchain_community/document_loaders/xml.py+++ b/libs/community/langchain_community/document_loaders/xml.py@@ -46,4 +46,4 @@ class UnstructuredXMLLoader(UnstructuredFileLoader):def _get_elements(self) -> List:from unstructured.partition.xml import partition_xml- return partition_xml(filename=self.file_path, **self.unstructured_kwargs) # type: ignore[arg-type]+ return partition_xml(filename=self.file_path, **self.unstructured_kwargs)diff --git a/libs/community/langchain_community/document_transformers/google_translate.py b/libs/community/langchain_community/document_transformers/google_translate.pyindex f5a95ab851..613ab0bdfc 100644--- a/libs/community/langchain_community/document_transformers/google_translate.py+++ b/libs/community/langchain_community/document_transformers/google_translate.py@@ -33,7 +33,7 @@ class GoogleTranslateTransformer(BaseDocumentTransformer):"""try:from google.api_core.client_options import ClientOptions- from google.cloud import translate # type: ignore[attr-defined]+ from google.cloud import translateexcept ImportError as exc:raise ImportError("Install Google Cloud Translate to use this parser."@@ -76,7 +76,7 @@ class GoogleTranslateTransformer(BaseDocumentTransformer):Options: `text/plain`, `text/html`"""try:- from google.cloud import translate # type: ignore[attr-defined]+ from google.cloud import translateexcept ImportError as exc:raise ImportError("Install Google Cloud Translate to use this parser."diff --git a/libs/community/langchain_community/document_transformers/openai_functions.py b/libs/community/langchain_community/document_transformers/openai_functions.pyindex 7ba087a3e1..d95a48a64f 100644--- a/libs/community/langchain_community/document_transformers/openai_functions.py+++ b/libs/community/langchain_community/document_transformers/openai_functions.py@@ -58,7 +58,7 @@ class OpenAIMetadataTagger(BaseDocumentTransformer, BaseModel):new_documents = []for document in documents:- extracted_metadata: Dict = self.tagging_chain.run(document.page_content) # type: ignore[assignment]+ extracted_metadata: Dict = self.tagging_chain.run(document.page_content)new_document = Document(page_content=document.page_content,metadata={**extracted_metadata, **document.metadata},diff --git a/libs/community/langchain_community/embeddings/anyscale.py b/libs/community/langchain_community/embeddings/anyscale.pyindex 7f35a729b4..ffa33fa497 100644--- a/libs/community/langchain_community/embeddings/anyscale.py+++ b/libs/community/langchain_community/embeddings/anyscale.py@@ -68,7 +68,7 @@ class AnyscaleEmbeddings(OpenAIEmbeddings):else:values["openai_api_base"] = values["anyscale_api_base"]values["openai_api_key"] = values["anyscale_api_key"].get_secret_value()- values["client"] = openai.Embedding # type: ignore[attr-defined]+ values["client"] = openai.Embeddingreturn values@propertydiff --git a/libs/community/langchain_community/embeddings/azure_openai.py b/libs/community/langchain_community/embeddings/azure_openai.pyindex 7687cb08ee..00a2327d2c 100644--- a/libs/community/langchain_community/embeddings/azure_openai.py+++ b/libs/community/langchain_community/embeddings/azure_openai.py@@ -20,7 +20,7 @@ from langchain_community.utils.openai import is_openai_v1removal="1.0",alternative_import="langchain_openai.AzureOpenAIEmbeddings",)-class AzureOpenAIEmbeddings(OpenAIEmbeddings): # type: ignore[override]+class AzureOpenAIEmbeddings(OpenAIEmbeddings):"""`Azure OpenAI` Embeddings API."""azure_endpoint: Union[str, None] = None@@ -170,16 +170,16 @@ class AzureOpenAIEmbeddings(OpenAIEmbeddings): # type: ignore[override]"default_query": self.default_query,"http_client": self.http_client,}- self.client = openai.AzureOpenAI(**client_params).embeddings # type: ignore[arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type]+ self.client = openai.AzureOpenAI(**client_params).embeddingsif self.azure_ad_async_token_provider:client_params["azure_ad_token_provider"] = (self.azure_ad_async_token_provider)- self.async_client = openai.AsyncAzureOpenAI(**client_params).embeddings # type: ignore[arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type]+ self.async_client = openai.AsyncAzureOpenAI(**client_params).embeddingselse:- self.client = openai.Embedding # type: ignore[attr-defined]+ self.client = openai.Embeddingreturn self@propertydiff --git a/libs/community/langchain_community/embeddings/localai.py b/libs/community/langchain_community/embeddings/localai.pyindex d163bb284f..8c0457b395 100644--- a/libs/community/langchain_community/embeddings/localai.py+++ b/libs/community/langchain_community/embeddings/localai.py@@ -46,11 +46,11 @@ def _create_retry_decorator(embeddings: LocalAIEmbeddings) -> Callable[[Any], Anstop=stop_after_attempt(embeddings.max_retries),wait=wait_exponential(multiplier=1, min=min_seconds, max=max_seconds),retry=(- retry_if_exception_type(openai.error.Timeout) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIConnectionError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.RateLimitError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.ServiceUnavailableError) # type: ignore[attr-defined]+ retry_if_exception_type(openai.error.Timeout)+ | retry_if_exception_type(openai.error.APIError)+ | retry_if_exception_type(openai.error.APIConnectionError)+ | retry_if_exception_type(openai.error.RateLimitError)+ | retry_if_exception_type(openai.error.ServiceUnavailableError)),before_sleep=before_sleep_log(logger, logging.WARNING),)@@ -68,11 +68,11 @@ def _async_retry_decorator(embeddings: LocalAIEmbeddings) -> Any:stop=stop_after_attempt(embeddings.max_retries),wait=wait_exponential(multiplier=1, min=min_seconds, max=max_seconds),retry=(- retry_if_exception_type(openai.error.Timeout) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIConnectionError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.RateLimitError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.ServiceUnavailableError) # type: ignore[attr-defined]+ retry_if_exception_type(openai.error.Timeout)+ | retry_if_exception_type(openai.error.APIError)+ | retry_if_exception_type(openai.error.APIConnectionError)+ | retry_if_exception_type(openai.error.RateLimitError)+ | retry_if_exception_type(openai.error.ServiceUnavailableError)),before_sleep=before_sleep_log(logger, logging.WARNING),)@@ -93,7 +93,7 @@ def _check_response(response: dict) -> dict:if any(len(d["embedding"]) == 1 for d in response["data"]):import openai- raise openai.error.APIError("LocalAI API returned an empty embedding") # type: ignore[attr-defined]+ raise openai.error.APIError("LocalAI API returned an empty embedding")return response@@ -230,7 +230,7 @@ class LocalAIEmbeddings(BaseModel, Embeddings):try:import openai- values["client"] = openai.Embedding # type: ignore[attr-defined]+ values["client"] = openai.Embeddingexcept ImportError:raise ImportError("Could not import openai python package. "@@ -253,10 +253,10 @@ class LocalAIEmbeddings(BaseModel, Embeddings):if self.openai_proxy:import openai- openai.proxy = { # type: ignore[attr-defined]+ openai.proxy = {"http": self.openai_proxy,"https": self.openai_proxy,- } # type: ignore[assignment]+ }return openai_argsdef _embedding_func(self, text: str, *, engine: str) -> List[float]:diff --git a/libs/community/langchain_community/embeddings/mlflow.py b/libs/community/langchain_community/embeddings/mlflow.pyindex 2dbff7c2eb..09ceb3a229 100644--- a/libs/community/langchain_community/embeddings/mlflow.py+++ b/libs/community/langchain_community/embeddings/mlflow.py@@ -72,7 +72,7 @@ class MlflowEmbeddings(Embeddings, BaseModel):for txt in _chunk(texts, 20):resp = self._client.predict(endpoint=self.endpoint,- inputs={"input": txt, **params}, # type: ignore[arg-type]+ inputs={"input": txt, **params},)embeddings.extend(r["embedding"] for r in resp["data"])return embeddingsdiff --git a/libs/community/langchain_community/embeddings/octoai_embeddings.py b/libs/community/langchain_community/embeddings/octoai_embeddings.pyindex dc16288da9..cd10033e38 100644--- a/libs/community/langchain_community/embeddings/octoai_embeddings.py+++ b/libs/community/langchain_community/embeddings/octoai_embeddings.py@@ -74,8 +74,8 @@ class OctoAIEmbeddings(OpenAIEmbeddings):else:values["openai_api_base"] = values["endpoint_url"]values["openai_api_key"] = values["octoai_api_token"].get_secret_value()- values["client"] = openai.Embedding # type: ignore[attr-defined]- values["async_client"] = openai.Embedding # type: ignore[attr-defined]+ values["client"] = openai.Embedding+ values["async_client"] = openai.Embeddingexcept ImportError:raise ImportError(diff --git a/libs/community/langchain_community/embeddings/openai.py b/libs/community/langchain_community/embeddings/openai.pyindex 5bedfc747e..a695ab72ff 100644--- a/libs/community/langchain_community/embeddings/openai.py+++ b/libs/community/langchain_community/embeddings/openai.py@@ -58,11 +58,11 @@ def _create_retry_decorator(embeddings: OpenAIEmbeddings) -> Callable[[Any], Anymax=embeddings.retry_max_seconds,),retry=(- retry_if_exception_type(openai.error.Timeout) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIConnectionError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.RateLimitError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.ServiceUnavailableError) # type: ignore[attr-defined]+ retry_if_exception_type(openai.error.Timeout)+ | retry_if_exception_type(openai.error.APIError)+ | retry_if_exception_type(openai.error.APIConnectionError)+ | retry_if_exception_type(openai.error.RateLimitError)+ | retry_if_exception_type(openai.error.ServiceUnavailableError)),before_sleep=before_sleep_log(logger, logging.WARNING),)@@ -85,11 +85,11 @@ def _async_retry_decorator(embeddings: OpenAIEmbeddings) -> Any:max=embeddings.retry_max_seconds,),retry=(- retry_if_exception_type(openai.error.Timeout) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.APIConnectionError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.RateLimitError) # type: ignore[attr-defined]- | retry_if_exception_type(openai.error.ServiceUnavailableError) # type: ignore[attr-defined]+ retry_if_exception_type(openai.error.Timeout)+ | retry_if_exception_type(openai.error.APIError)+ | retry_if_exception_type(openai.error.APIConnectionError)+ | retry_if_exception_type(openai.error.RateLimitError)+ | retry_if_exception_type(openai.error.ServiceUnavailableError)),before_sleep=before_sleep_log(logger, logging.WARNING),)@@ -110,7 +110,7 @@ def _check_response(response: dict, skip_empty: bool = False) -> dict:if any(len(d["embedding"]) == 1 for d in response["data"]) and not skip_empty:import openai- raise openai.error.APIError("OpenAI API returned an empty embedding") # type: ignore[attr-defined]+ raise openai.error.APIError("OpenAI API returned an empty embedding")return response@@ -357,7 +357,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings):**client_params).embeddingselif not values.get("client"):- values["client"] = openai.Embedding # type: ignore[attr-defined]+ values["client"] = openai.Embeddingelse:passreturn values@@ -390,10 +390,10 @@ class OpenAIEmbeddings(BaseModel, Embeddings):"Please install it with `pip install openai`.")- openai.proxy = { # type: ignore[attr-defined]+ openai.proxy = {"http": self.openai_proxy,"https": self.openai_proxy,- } # type: ignore[assignment]+ }return openai_args# please refer todiff --git a/libs/community/langchain_community/embeddings/spacy_embeddings.py b/libs/community/langchain_community/embeddings/spacy_embeddings.pyindex cd862d3ba9..cbe9c06d57 100644--- a/libs/community/langchain_community/embeddings/spacy_embeddings.py+++ b/libs/community/langchain_community/embeddings/spacy_embeddings.py@@ -54,7 +54,7 @@ class SpacyEmbeddings(BaseModel, Embeddings):# Try to load the spaCy modelimport spacy- values["nlp"] = spacy.load(model_name) # type: ignore[arg-type]+ values["nlp"] = spacy.load(model_name)except OSError:# If the model is not found, raise a ValueErrorraise ValueError(diff --git a/libs/community/langchain_community/embeddings/vertexai.py b/libs/community/langchain_community/embeddings/vertexai.pyindex ea625c216b..06637385e0 100644--- a/libs/community/langchain_community/embeddings/vertexai.py+++ b/libs/community/langchain_community/embeddings/vertexai.py@@ -25,7 +25,7 @@ _MIN_BATCH_SIZE = 5removal="1.0",alternative_import="langchain_google_vertexai.VertexAIEmbeddings",)-class VertexAIEmbeddings(_VertexAICommon, Embeddings): # type: ignore[override]+class VertexAIEmbeddings(_VertexAICommon, Embeddings):"""Google Cloud VertexAI embedding models."""# Instance context@@ -163,8 +163,8 @@ class VertexAIEmbeddings(_VertexAICommon, Embeddings): # type: ignore[override]DeadlineExceeded,]retry_decorator = create_base_retry_decorator(- error_types=errors, # type: ignore[arg-type]- max_retries=self.max_retries, # type: ignore[arg-type]+ error_types=errors,+ max_retries=self.max_retries,)@retry_decoratordiff --git a/libs/community/langchain_community/embeddings/yandex.py b/libs/community/langchain_community/embeddings/yandex.pyindex 59637bf100..f7a6ac555c 100644--- a/libs/community/langchain_community/embeddings/yandex.py+++ b/libs/community/langchain_community/embeddings/yandex.py@@ -205,7 +205,7 @@ def _make_request(self: YandexGPTEmbeddings, texts: List[str], **kwargs): # typfor text in texts:request = TextEmbeddingRequest(model_uri=model_uri, text=text)stub = EmbeddingsServiceStub(channel)- res = stub.TextEmbedding(request, metadata=self.grpc_metadata) # type: ignore[attr-defined]+ res = stub.TextEmbedding(request, metadata=self.grpc_metadata)result.append(list(res.embedding))time.sleep(self.sleep_interval)diff --git a/libs/community/langchain_community/graphs/neo4j_graph.py b/libs/community/langchain_community/graphs/neo4j_graph.pyindex f96cd27696..7ce5f2d7e2 100644--- a/libs/community/langchain_community/graphs/neo4j_graph.py+++ b/libs/community/langchain_community/graphs/neo4j_graph.py@@ -481,20 +481,20 @@ class Neo4jGraph(GraphStore):or e.code== "Neo.DatabaseError.Transaction.TransactionStartFailed")- and "in an implicit transaction" in e.message # type: ignore[operator]+ and "in an implicit transaction" in e.message)or ( # isPeriodicCommitErrore.code == "Neo.ClientError.Statement.SemanticError"and (- "in an open transaction is not possible" in e.message # type: ignore[operator]- or "tried to execute in an explicit transaction" in e.message # type: ignore[operator]+ "in an open transaction is not possible" in e.message+ or "tried to execute in an explicit transaction" in e.message))):raise# fallback to allow implicit transactionswith self._driver.session(database=self._database) as session:- data = session.run(Query(text=query, timeout=self.timeout), params) # type: ignore[assignment]+ data = session.run(Query(text=query, timeout=self.timeout), params)json_data = [r.data() for r in data]if self.sanitize:json_data = [value_sanitize(el) for el in json_data]diff --git a/libs/community/langchain_community/indexes/_sql_record_manager.py b/libs/community/langchain_community/indexes/_sql_record_manager.pyindex 4e7874d9c1..bf59530a06 100644--- a/libs/community/langchain_community/indexes/_sql_record_manager.py+++ b/libs/community/langchain_community/indexes/_sql_record_manager.py@@ -304,7 +304,7 @@ class SQLRecordManager(RecordManager):# Note: uses SQLite insert to make on_conflict_do_update work.# This code needs to be generalized a bit to work with more dialects.insert_stmt = sqlite_insert(UpsertionRecord).values(records_to_upsert)- stmt = insert_stmt.on_conflict_do_update( # type: ignore[attr-defined]+ stmt = insert_stmt.on_conflict_do_update([UpsertionRecord.key, UpsertionRecord.namespace],set_=dict(# attr-defined type ignore@@ -318,7 +318,7 @@ class SQLRecordManager(RecordManager):# Note: uses SQLite insert to make on_conflict_do_update work.# This code needs to be generalized a bit to work with more dialects.insert_stmt = pg_insert(UpsertionRecord).values(records_to_upsert) # type: ignore[assignment]- stmt = insert_stmt.on_conflict_do_update( # type: ignore[attr-defined]+ stmt = insert_stmt.on_conflict_do_update("uix_key_namespace", # Name of constraintset_=dict(# attr-defined type ignore@@ -379,7 +379,7 @@ class SQLRecordManager(RecordManager):# Note: uses SQLite insert to make on_conflict_do_update work.# This code needs to be generalized a bit to work with more dialects.insert_stmt = sqlite_insert(UpsertionRecord).values(records_to_upsert)- stmt = insert_stmt.on_conflict_do_update( # type: ignore[attr-defined]+ stmt = insert_stmt.on_conflict_do_update([UpsertionRecord.key, UpsertionRecord.namespace],set_=dict(# attr-defined type ignore@@ -393,7 +393,7 @@ class SQLRecordManager(RecordManager):# Note: uses SQLite insert to make on_conflict_do_update work.# This code needs to be generalized a bit to work with more dialects.insert_stmt = pg_insert(UpsertionRecord).values(records_to_upsert) # type: ignore[assignment]- stmt = insert_stmt.on_conflict_do_update( # type: ignore[attr-defined]+ stmt = insert_stmt.on_conflict_do_update("uix_key_namespace", # Name of constraintset_=dict(# attr-defined type ignore@@ -412,7 +412,7 @@ class SQLRecordManager(RecordManager):with self._make_session() as session:records = (# mypy does not recognize .all()- session.query(UpsertionRecord.key) # type: ignore[attr-defined]+ session.query(UpsertionRecord.key).filter(and_(UpsertionRecord.key.in_(keys),@@ -460,21 +460,15 @@ class SQLRecordManager(RecordManager):# mypy does not recognize .all() or .filter()if after:- query = query.filter( # type: ignore[attr-defined]- UpsertionRecord.updated_at > after- )+ query = query.filter(UpsertionRecord.updated_at > after)if before:- query = query.filter( # type: ignore[attr-defined]- UpsertionRecord.updated_at < before- )+ query = query.filter(UpsertionRecord.updated_at < before)if group_ids:- query = query.filter( # type: ignore[attr-defined]- UpsertionRecord.group_id.in_(group_ids)- )+ query = query.filter(UpsertionRecord.group_id.in_(group_ids))if limit:- query = query.limit(limit) # type: ignore[attr-defined]- records = query.all() # type: ignore[attr-defined]+ query = query.limit(limit)+ records = query.all()return [r.key for r in records] # type: ignore[misc]async def alist_keys(@@ -493,20 +487,14 @@ class SQLRecordManager(RecordManager):# mypy does not recognize .all() or .filter()if after:- query = query.filter( # type: ignore[attr-defined]- UpsertionRecord.updated_at > after- )+ query = query.filter(UpsertionRecord.updated_at > after)if before:- query = query.filter( # type: ignore[attr-defined]- UpsertionRecord.updated_at < before- )+ query = query.filter(UpsertionRecord.updated_at < before)if group_ids:- query = query.filter( # type: ignore[attr-defined]- UpsertionRecord.group_id.in_(group_ids)- )+ query = query.filter(UpsertionRecord.group_id.in_(group_ids))if limit:- query = query.limit(limit) # type: ignore[attr-defined]+ query = query.limit(limit)records = (await session.execute(query)).scalars().all()return list(records)@@ -519,7 +507,7 @@ class SQLRecordManager(RecordManager):UpsertionRecord.key.in_(keys),UpsertionRecord.namespace == self.namespace,)- ).delete() # type: ignore[attr-defined]+ ).delete()session.commit()async def adelete_keys(self, keys: Sequence[str]) -> None:diff --git a/libs/community/langchain_community/llms/aleph_alpha.py b/libs/community/langchain_community/llms/aleph_alpha.pyindex 73cf1f0dd8..d1cf2175eb 100644--- a/libs/community/langchain_community/llms/aleph_alpha.py+++ b/libs/community/langchain_community/llms/aleph_alpha.py@@ -281,6 +281,6 @@ class AlephAlpha(LLM):if __name__ == "__main__":- aa = AlephAlpha() # type: ignore[call-arg]+ aa = AlephAlpha()print(aa.invoke("How are you?")) # noqa: T201diff --git a/libs/community/langchain_community/llms/anyscale.py b/libs/community/langchain_community/llms/anyscale.pyindex e91607543e..b55fb68ca8 100644--- a/libs/community/langchain_community/llms/anyscale.py+++ b/libs/community/langchain_community/llms/anyscale.py@@ -62,7 +62,7 @@ def create_llm_result(return LLMResult(generations=generations, llm_output=llm_output)-class Anyscale(BaseOpenAI): # type: ignore[override]+class Anyscale(BaseOpenAI):"""Anyscale large language models.To use, you should have the environment variable ``ANYSCALE_API_KEY``set with your@@ -136,7 +136,7 @@ class Anyscale(BaseOpenAI): # type: ignore[override]else:values["openai_api_base"] = values["anyscale_api_base"]values["openai_api_key"] = values["anyscale_api_key"].get_secret_value()- values["client"] = openai.Completion # type: ignore[attr-defined]+ values["client"] = openai.Completionexcept ImportError:raise ImportError("Could not import openai python package. "diff --git a/libs/community/langchain_community/llms/azureml_endpoint.py b/libs/community/langchain_community/llms/azureml_endpoint.pyindex 1ec03b9a52..184bf5f53e 100644--- a/libs/community/langchain_community/llms/azureml_endpoint.py+++ b/libs/community/langchain_community/llms/azureml_endpoint.py@@ -194,7 +194,7 @@ class GPT2ContentFormatter(ContentFormatterBase):try:choice = json.loads(output)[0]["0"]except (KeyError, IndexError, TypeError) as e:- raise ValueError(self.format_error_msg.format(api_type=api_type)) from e # type: ignore[union-attr]+ raise ValueError(self.format_error_msg.format(api_type=api_type)) from ereturn Generation(text=choice)@@ -239,7 +239,7 @@ class HFContentFormatter(ContentFormatterBase):try:choice = json.loads(output)[0]["0"]["generated_text"]except (KeyError, IndexError, TypeError) as e:- raise ValueError(self.format_error_msg.format(api_type=api_type)) from e # type: ignore[union-attr]+ raise ValueError(self.format_error_msg.format(api_type=api_type)) from ereturn Generation(text=choice)@@ -268,7 +268,7 @@ class DollyContentFormatter(ContentFormatterBase):try:choice = json.loads(output)[0]except (KeyError, IndexError, TypeError) as e:- raise ValueError(self.format_error_msg.format(api_type=api_type)) from e # type: ignore[union-attr]+ raise ValueError(self.format_error_msg.format(api_type=api_type)) from ereturn Generation(text=choice)@@ -315,7 +315,7 @@ class CustomOpenAIContentFormatter(ContentFormatterBase):try:choice = json.loads(output)[0]["0"]except (KeyError, IndexError, TypeError) as e:- raise ValueError(self.format_error_msg.format(api_type=api_type)) from e # type: ignore[union-attr]+ raise ValueError(self.format_error_msg.format(api_type=api_type)) from ereturn Generation(text=choice)if api_type == AzureMLEndpointApiType.serverless:try:@@ -327,7 +327,7 @@ class CustomOpenAIContentFormatter(ContentFormatterBase):"received.")except (KeyError, IndexError, TypeError) as e:- raise ValueError(self.format_error_msg.format(api_type=api_type)) from e # type: ignore[union-attr]+ raise ValueError(self.format_error_msg.format(api_type=api_type)) from ereturn Generation(text=choice["text"].strip(),generation_info=dict(diff --git a/libs/community/langchain_community/llms/beam.py b/libs/community/langchain_community/llms/beam.pyindex f5f95d1be6..7d3b6e65ec 100644--- a/libs/community/langchain_community/llms/beam.py+++ b/libs/community/langchain_community/llms/beam.py@@ -19,7 +19,7 @@ DEFAULT_NUM_TRIES = 10DEFAULT_SLEEP_TIME = 4-class Beam(LLM): # type: ignore[override, override, override, override]+class Beam(LLM):"""Beam API for gpt2 large language model.To use, you should have the ``beam-sdk`` python package installed,diff --git a/libs/community/langchain_community/llms/gooseai.py b/libs/community/langchain_community/llms/gooseai.pyindex 61383e9b7d..282bd7d8f8 100644--- a/libs/community/langchain_community/llms/gooseai.py+++ b/libs/community/langchain_community/llms/gooseai.py@@ -97,8 +97,8 @@ class GooseAI(LLM):import openaiopenai.api_key = gooseai_api_key.get_secret_value()- openai.api_base = "https://api.goose.ai/v1" # type: ignore[attr-defined]- values["client"] = openai.Completion # type: ignore[attr-defined]+ openai.api_base = "https://api.goose.ai/v1"+ values["client"] = openai.Completionexcept ImportError:raise ImportError("Could not import openai python package. "diff --git a/libs/community/langchain_community/llms/javelin_ai_gateway.py b/libs/community/langchain_community/llms/javelin_ai_gateway.pyindex 156350308f..3571ea4d8b 100644--- a/libs/community/langchain_community/llms/javelin_ai_gateway.py+++ b/libs/community/langchain_community/llms/javelin_ai_gateway.py@@ -12,7 +12,7 @@ from pydantic import BaseModel# Ignoring type because below is valid pydantic code# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class Params(BaseModel, extra="allow"): # type: ignore[call-arg]+class Params(BaseModel, extra="allow"):"""Parameters for the Javelin AI Gateway LLM."""temperature: float = 0.0diff --git a/libs/community/langchain_community/llms/mlflow_ai_gateway.py b/libs/community/langchain_community/llms/mlflow_ai_gateway.pyindex 95196838e9..8594aab8c5 100644--- a/libs/community/langchain_community/llms/mlflow_ai_gateway.py+++ b/libs/community/langchain_community/llms/mlflow_ai_gateway.py@@ -10,7 +10,7 @@ from pydantic import BaseModel# Ignoring type because below is valid pydantic code# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class Params(BaseModel, extra="allow"): # type: ignore[call-arg]+class Params(BaseModel, extra="allow"):"""Parameters for the MLflow AI Gateway LLM."""temperature: float = 0.0diff --git a/libs/community/langchain_community/llms/octoai_endpoint.py b/libs/community/langchain_community/llms/octoai_endpoint.pyindex de56c11eb5..ef519735b7 100644--- a/libs/community/langchain_community/llms/octoai_endpoint.py+++ b/libs/community/langchain_community/llms/octoai_endpoint.py@@ -10,7 +10,7 @@ DEFAULT_BASE_URL = "https://text.octoai.run/v1/"DEFAULT_MODEL = "codellama-7b-instruct"-class OctoAIEndpoint(BaseOpenAI): # type: ignore[override]+class OctoAIEndpoint(BaseOpenAI):"""OctoAI LLM Endpoints - OpenAI compatible.OctoAIEndpoint is a class to interact with OctoAI Compute Service large@@ -102,7 +102,7 @@ class OctoAIEndpoint(BaseOpenAI): # type: ignore[override]else:values["openai_api_base"] = values["octoai_api_base"]values["openai_api_key"] = values["octoai_api_token"].get_secret_value()- values["client"] = openai.Completion # type: ignore[attr-defined]+ values["client"] = openai.Completionexcept ImportError:raise ImportError("Could not import openai python package. "diff --git a/libs/community/langchain_community/llms/ollama.py b/libs/community/langchain_community/llms/ollama.pyindex 72b6107967..e6584ae218 100644--- a/libs/community/langchain_community/llms/ollama.py+++ b/libs/community/langchain_community/llms/ollama.py@@ -319,9 +319,9 @@ class _OllamaCommon(BaseLanguageModel):"Content-Type": "application/json",**(self.headers if isinstance(self.headers, dict) else {}),},- auth=self.auth, # type: ignore[arg-type]+ auth=self.auth, # type: ignore[arg-type,unused-ignore]json=request_payload,- timeout=self.timeout, # type: ignore[arg-type]+ timeout=self.timeout, # type: ignore[arg-type,unused-ignore]) as response:if response.status != 200:if response.status == 404:diff --git a/libs/community/langchain_community/llms/openai.py b/libs/community/langchain_community/llms/openai.pyindex 9d640c2bd4..525599945f 100644--- a/libs/community/langchain_community/llms/openai.py+++ b/libs/community/langchain_community/llms/openai.py@@ -100,11 +100,11 @@ def _create_retry_decorator(import openaierrors = [- openai.error.Timeout, # type: ignore[attr-defined]- openai.error.APIError, # type: ignore[attr-defined]- openai.error.APIConnectionError, # type: ignore[attr-defined]- openai.error.RateLimitError, # type: ignore[attr-defined]- openai.error.ServiceUnavailableError, # type: ignore[attr-defined]+ openai.error.Timeout,+ openai.error.APIError,+ openai.error.APIConnectionError,+ openai.error.RateLimitError,+ openai.error.ServiceUnavailableError,]return create_base_retry_decorator(error_types=errors, max_retries=llm.max_retries, run_manager=run_manager@@ -323,7 +323,7 @@ class BaseOpenAI(BaseLLM):if not values.get("async_client"):values["async_client"] = openai.AsyncOpenAI(**client_params).completionselif not values.get("client"):- values["client"] = openai.Completion # type: ignore[attr-defined]+ values["client"] = openai.Completionelse:pass@@ -607,7 +607,7 @@ class BaseOpenAI(BaseLLM):if self.openai_proxy:import openai- openai.proxy = {"http": self.openai_proxy, "https": self.openai_proxy} # type: ignore[assignment] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined]+ openai.proxy = {"http": self.openai_proxy, "https": self.openai_proxy}return {**openai_creds, **self._default_params}@property@@ -943,7 +943,7 @@ class AzureOpenAI(BaseOpenAI):).completionselse:- values["client"] = openai.Completion # type: ignore[attr-defined]+ values["client"] = openai.Completionreturn values@@ -1068,18 +1068,18 @@ class OpenAIChat(BaseLLM):openai.api_key = openai_api_keyif openai_api_base:- openai.api_base = openai_api_base # type: ignore[attr-defined]+ openai.api_base = openai_api_baseif openai_organization:openai.organization = openai_organizationif openai_proxy:- openai.proxy = {"http": openai_proxy, "https": openai_proxy} # type: ignore[assignment] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined] # type: ignore[attr-defined]+ openai.proxy = {"http": openai_proxy, "https": openai_proxy}except ImportError:raise ImportError("Could not import openai python package. ""Please install it with `pip install openai`.")try:- values["client"] = openai.ChatCompletion # type: ignore[attr-defined]+ values["client"] = openai.ChatCompletionexcept AttributeError:raise ValueError("`openai` has no `ChatCompletion` attribute, this is likely "diff --git a/libs/community/langchain_community/llms/vertexai.py b/libs/community/langchain_community/llms/vertexai.pyindex 22a1bca8e1..74ec9374ac 100644--- a/libs/community/langchain_community/llms/vertexai.py+++ b/libs/community/langchain_community/llms/vertexai.py@@ -49,7 +49,7 @@ def is_gemini_model(model_name: str) -> bool:return model_name is not None and "gemini" in model_name-def completion_with_retry( # type: ignore[no-redef]+def completion_with_retry(llm: VertexAI,prompt: List[Union[str, "Image"]],stream: bool = False,@@ -124,7 +124,7 @@ class _VertexAIBase(BaseModel):return cls.task_executor-class _VertexAICommon(_VertexAIBase): # type: ignore[override]+class _VertexAICommon(_VertexAIBase):client: "_LanguageModel" = None #: :meta private:client_preview: "_LanguageModel" = None #: :meta private:model_name: str@@ -208,7 +208,7 @@ class _VertexAICommon(_VertexAIBase): # type: ignore[override]removal="1.0",alternative_import="langchain_google_vertexai.VertexAI",)-class VertexAI(_VertexAICommon, BaseLLM): # type: ignore[override]+class VertexAI(_VertexAICommon, BaseLLM):"""Google Vertex AI large language models."""model_name: str = "text-bison"@@ -332,7 +332,7 @@ class VertexAI(_VertexAICommon, BaseLLM): # type: ignore[override]generation += chunkgenerations.append([generation])else:- res = completion_with_retry( # type: ignore[misc]+ res = completion_with_retry(self,[prompt],stream=should_stream,@@ -375,7 +375,7 @@ class VertexAI(_VertexAICommon, BaseLLM): # type: ignore[override]**kwargs: Any,) -> Iterator[GenerationChunk]:params = self._prepare_params(stop=stop, stream=True, **kwargs)- for stream_resp in completion_with_retry( # type: ignore[misc]+ for stream_resp in completion_with_retry(self,[prompt],stream=True,@@ -448,7 +448,7 @@ class VertexAIModelGarden(_VertexAIBase, BaseLLM):@propertydef endpoint_path(self) -> str:return self.client.endpoint_path(- project=self.project, # type: ignore[arg-type]+ project=self.project,location=self.location,endpoint=self.endpoint_id,)diff --git a/libs/community/langchain_community/llms/yandex.py b/libs/community/langchain_community/llms/yandex.pyindex cc615ac6d7..31b09bcdb2 100644--- a/libs/community/langchain_community/llms/yandex.py+++ b/libs/community/langchain_community/llms/yandex.py@@ -235,7 +235,7 @@ def _make_request(messages=[Message(role="user", text=prompt)],)stub = TextGenerationServiceStub(channel)- res = stub.Completion(request, metadata=self.grpc_metadata) # type: ignore[attr-defined]+ res = stub.Completion(request, metadata=self.grpc_metadata)return list(res)[0].alternatives[0].message.text@@ -291,7 +291,7 @@ async def _amake_request(self: YandexGPT, prompt: str) -> str:messages=[Message(role="user", text=prompt)],)stub = TextGenerationAsyncServiceStub(channel)- operation = await stub.Completion(request, metadata=self.grpc_metadata) # type: ignore[attr-defined]+ operation = await stub.Completion(request, metadata=self.grpc_metadata)async with grpc.aio.secure_channel(operation_api_url, channel_credentials) as operation_channel:@@ -301,7 +301,7 @@ async def _amake_request(self: YandexGPT, prompt: str) -> str:operation_request = GetOperationRequest(operation_id=operation.id)operation = await operation_stub.Get(operation_request,- metadata=self.grpc_metadata, # type: ignore[attr-defined]+ metadata=self.grpc_metadata,)completion_response = CompletionResponse()diff --git a/libs/community/langchain_community/memory/zep_cloud_memory.py b/libs/community/langchain_community/memory/zep_cloud_memory.pyindex 538fcb3b2c..eacab5eb27 100644--- a/libs/community/langchain_community/memory/zep_cloud_memory.py+++ b/libs/community/langchain_community/memory/zep_cloud_memory.py@@ -8,7 +8,7 @@ try:from langchain.memory import ConversationBufferMemoryfrom zep_cloud import MemoryGetRequestMemoryType- class ZepCloudMemory(ConversationBufferMemory): # type: ignore[override]+ class ZepCloudMemory(ConversationBufferMemory):"""Persist your chain history to the Zep MemoryStore.Documentation: https://help.getzep.comdiff --git a/libs/community/langchain_community/memory/zep_memory.py b/libs/community/langchain_community/memory/zep_memory.pyindex e4cae44883..eda8042ecb 100644--- a/libs/community/langchain_community/memory/zep_memory.py+++ b/libs/community/langchain_community/memory/zep_memory.py@@ -7,7 +7,7 @@ from langchain_community.chat_message_histories import ZepChatMessageHistorytry:from langchain.memory import ConversationBufferMemory- class ZepMemory(ConversationBufferMemory): # type: ignore[override]+ class ZepMemory(ConversationBufferMemory):"""Persist your chain history to the Zep MemoryStore.The number of messages returned by Zep and when the Zep server summarizes chatdiff --git a/libs/community/langchain_community/retrievers/bedrock.py b/libs/community/langchain_community/retrievers/bedrock.pyindex d7fe03ad2c..3dd33a045d 100644--- a/libs/community/langchain_community/retrievers/bedrock.py+++ b/libs/community/langchain_community/retrievers/bedrock.py@@ -7,13 +7,13 @@ from langchain_core.retrievers import BaseRetrieverfrom pydantic import BaseModel, model_validator-class VectorSearchConfig(BaseModel, extra="allow"): # type: ignore[call-arg]+class VectorSearchConfig(BaseModel, extra="allow"):"""Configuration for vector search."""numberOfResults: int = 4-class RetrievalConfig(BaseModel, extra="allow"): # type: ignore[call-arg]+class RetrievalConfig(BaseModel, extra="allow"):"""Configuration for retrieval."""vectorSearchConfiguration: VectorSearchConfigdiff --git a/libs/community/langchain_community/retrievers/kendra.py b/libs/community/langchain_community/retrievers/kendra.pyindex 1b7cc5fbcd..899a0052e3 100644--- a/libs/community/langchain_community/retrievers/kendra.py+++ b/libs/community/langchain_community/retrievers/kendra.py@@ -68,7 +68,7 @@ Dates are also represented as str.# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class Highlight(BaseModel, extra="allow"): # type: ignore[call-arg]+class Highlight(BaseModel, extra="allow"):"""Information that highlights the keywords in the excerpt."""BeginOffset: int@@ -82,7 +82,7 @@ class Highlight(BaseModel, extra="allow"): # type: ignore[call-arg]# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class TextWithHighLights(BaseModel, extra="allow"): # type: ignore[call-arg]+class TextWithHighLights(BaseModel, extra="allow"):"""Text with highlights."""Text: str@@ -92,9 +92,7 @@ class TextWithHighLights(BaseModel, extra="allow"): # type: ignore[call-arg]# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class AdditionalResultAttributeValue( # type: ignore[call-arg]- BaseModel, extra="allow"-):+class AdditionalResultAttributeValue(BaseModel, extra="allow"):"""Value of an additional result attribute."""TextWithHighlightsValue: TextWithHighLights@@ -102,7 +100,7 @@ class AdditionalResultAttributeValue( # type: ignore[call-arg]# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class AdditionalResultAttribute(BaseModel, extra="allow"): # type: ignore[call-arg]+class AdditionalResultAttribute(BaseModel, extra="allow"):"""Additional result attribute."""Key: str@@ -117,7 +115,7 @@ class AdditionalResultAttribute(BaseModel, extra="allow"): # type: ignore[call-# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class DocumentAttributeValue(BaseModel, extra="allow"): # type: ignore[call-arg]+class DocumentAttributeValue(BaseModel, extra="allow"):"""Value of a document attribute."""DateValue: Optional[str] = None@@ -148,7 +146,7 @@ class DocumentAttributeValue(BaseModel, extra="allow"): # type: ignore[call-arg# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class DocumentAttribute(BaseModel, extra="allow"): # type: ignore[call-arg]+class DocumentAttribute(BaseModel, extra="allow"):"""Document attribute."""Key: str@@ -158,7 +156,7 @@ class DocumentAttribute(BaseModel, extra="allow"): # type: ignore[call-arg]# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class ResultItem(BaseModel, ABC, extra="allow"): # type: ignore[call-arg]+class ResultItem(BaseModel, ABC, extra="allow"):"""Base class of a result item."""Id: Optional[str]@@ -288,7 +286,7 @@ class RetrieveResultItem(ResultItem):# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class QueryResult(BaseModel, extra="allow"): # type: ignore[call-arg]+class QueryResult(BaseModel, extra="allow"):"""`Amazon Kendra Query API` search result.It is composed of:@@ -302,7 +300,7 @@ class QueryResult(BaseModel, extra="allow"): # type: ignore[call-arg]# Unexpected keyword argument "extra" for "__init_subclass__" of "object"-class RetrieveResult(BaseModel, extra="allow"): # type: ignore[call-arg]+class RetrieveResult(BaseModel, extra="allow"):"""`Amazon Kendra Retrieve API` search result.It is composed of:diff --git a/libs/community/langchain_community/tools/ainetwork/app.py b/libs/community/langchain_community/tools/ainetwork/app.pyindex 98f83c5d36..8175a210b7 100644--- a/libs/community/langchain_community/tools/ainetwork/app.py+++ b/libs/community/langchain_community/tools/ainetwork/app.py@@ -30,7 +30,7 @@ class AppSchema(BaseModel):)-class AINAppOps(AINBaseTool): # type: ignore[override, override]+class AINAppOps(AINBaseTool):"""Tool for app operations."""name: str = "AINappOps"diff --git a/libs/community/langchain_community/tools/ainetwork/base.py b/libs/community/langchain_community/tools/ainetwork/base.pyindex a973412bd6..00e4fc7f7a 100644--- a/libs/community/langchain_community/tools/ainetwork/base.py+++ b/libs/community/langchain_community/tools/ainetwork/base.py@@ -22,7 +22,7 @@ class OperationType(str, Enum):GET = "GET"-class AINBaseTool(BaseTool): # type: ignore[override]+class AINBaseTool(BaseTool):"""Base class for the AINetwork tools."""interface: Ain = Field(default_factory=authenticate)diff --git a/libs/community/langchain_community/tools/ainetwork/owner.py b/libs/community/langchain_community/tools/ainetwork/owner.pyindex fdd15ed65a..13d41d9327 100644--- a/libs/community/langchain_community/tools/ainetwork/owner.py+++ b/libs/community/langchain_community/tools/ainetwork/owner.py@@ -30,7 +30,7 @@ class RuleSchema(BaseModel):)-class AINOwnerOps(AINBaseTool): # type: ignore[override, override]+class AINOwnerOps(AINBaseTool):"""Tool for owner operations."""name: str = "AINownerOps"diff --git a/libs/community/langchain_community/tools/ainetwork/rule.py b/libs/community/langchain_community/tools/ainetwork/rule.pyindex 9a21050175..5a24c9e5ab 100644--- a/libs/community/langchain_community/tools/ainetwork/rule.py+++ b/libs/community/langchain_community/tools/ainetwork/rule.py@@ -16,7 +16,7 @@ class RuleSchema(BaseModel):eval: Optional[str] = Field(None, description="eval string to determine permission")-class AINRuleOps(AINBaseTool): # type: ignore[override, override]+class AINRuleOps(AINBaseTool):"""Tool for owner operations."""name: str = "AINruleOps"diff --git a/libs/community/langchain_community/tools/ainetwork/transfer.py b/libs/community/langchain_community/tools/ainetwork/transfer.pyindex ff8d307948..81d630af2e 100644--- a/libs/community/langchain_community/tools/ainetwork/transfer.py+++ b/libs/community/langchain_community/tools/ainetwork/transfer.py@@ -14,7 +14,7 @@ class TransferSchema(BaseModel):amount: int = Field(..., description="Amount of AIN to transfer")-class AINTransfer(AINBaseTool): # type: ignore[override, override]+class AINTransfer(AINBaseTool):"""Tool for transfer operations."""name: str = "AINtransfer"diff --git a/libs/community/langchain_community/tools/ainetwork/value.py b/libs/community/langchain_community/tools/ainetwork/value.pyindex cd52115431..be6414727f 100644--- a/libs/community/langchain_community/tools/ainetwork/value.py+++ b/libs/community/langchain_community/tools/ainetwork/value.py@@ -18,7 +18,7 @@ class ValueSchema(BaseModel):)-class AINValueOps(AINBaseTool): # type: ignore[override, override]+class AINValueOps(AINBaseTool):"""Tool for value operations."""name: str = "AINvalueOps"diff --git a/libs/community/langchain_community/tools/amadeus/base.py b/libs/community/langchain_community/tools/amadeus/base.pyindex 9a8d5473ad..3fd3f377ce 100644--- a/libs/community/langchain_community/tools/amadeus/base.py+++ b/libs/community/langchain_community/tools/amadeus/base.py@@ -13,7 +13,7 @@ if TYPE_CHECKING:from amadeus import Client-class AmadeusBaseTool(BaseTool): # type: ignore[override]+class AmadeusBaseTool(BaseTool):"""Base Tool for Amadeus."""client: Client = Field(default_factory=authenticate)diff --git a/libs/community/langchain_community/tools/amadeus/closest_airport.py b/libs/community/langchain_community/tools/amadeus/closest_airport.pyindex 71af3c2b08..9523f73afb 100644--- a/libs/community/langchain_community/tools/amadeus/closest_airport.py+++ b/libs/community/langchain_community/tools/amadeus/closest_airport.py@@ -27,7 +27,7 @@ class ClosestAirportSchema(BaseModel):)-class AmadeusClosestAirport(AmadeusBaseTool): # type: ignore[override, override, override]+class AmadeusClosestAirport(AmadeusBaseTool):"""Tool for finding the closest airport to a particular location."""name: str = "closest_airport"diff --git a/libs/community/langchain_community/tools/amadeus/flight_search.py b/libs/community/langchain_community/tools/amadeus/flight_search.pyindex 5dd32047c1..c3cd8fe7bb 100644--- a/libs/community/langchain_community/tools/amadeus/flight_search.py+++ b/libs/community/langchain_community/tools/amadeus/flight_search.py@@ -51,7 +51,7 @@ class FlightSearchSchema(BaseModel):)-class AmadeusFlightSearch(AmadeusBaseTool): # type: ignore[override, override]+class AmadeusFlightSearch(AmadeusBaseTool):"""Tool for searching for a single flight between two airports."""name: str = "single_flight_search"diff --git a/libs/community/langchain_community/tools/arxiv/tool.py b/libs/community/langchain_community/tools/arxiv/tool.pyindex 1d2fb5aa83..601022a132 100644--- a/libs/community/langchain_community/tools/arxiv/tool.py+++ b/libs/community/langchain_community/tools/arxiv/tool.py@@ -15,7 +15,7 @@ class ArxivInput(BaseModel):query: str = Field(description="search query to look up")-class ArxivQueryRun(BaseTool): # type: ignore[override, override]+class ArxivQueryRun(BaseTool):"""Tool that searches the Arxiv API."""name: str = "arxiv"diff --git a/libs/community/langchain_community/tools/asknews/tool.py b/libs/community/langchain_community/tools/asknews/tool.pyindex 60cc7bf34c..ca5de6970c 100644--- a/libs/community/langchain_community/tools/asknews/tool.py+++ b/libs/community/langchain_community/tools/asknews/tool.py@@ -34,7 +34,7 @@ class SearchInput(BaseModel):)-class AskNewsSearch(BaseTool): # type: ignore[override]+class AskNewsSearch(BaseTool):"""Tool that searches the AskNews API."""name: str = "asknews_search"@@ -43,7 +43,7 @@ class AskNewsSearch(BaseTool): # type: ignore[override]"news. If you needs news from more than 48 hours ago, you can estimate the ""number of hours back to search.")- api_wrapper: AskNewsAPIWrapper = Field(default_factory=AskNewsAPIWrapper) # type: ignore[arg-type]+ api_wrapper: AskNewsAPIWrapper = Field(default_factory=AskNewsAPIWrapper)max_results: int = 10args_schema: Optional[Type[BaseModel]] = SearchInputdiff --git a/libs/community/langchain_community/tools/audio/huggingface_text_to_speech_inference.py b/libs/community/langchain_community/tools/audio/huggingface_text_to_speech_inference.pyindex bce7c84130..9e20870224 100644--- a/libs/community/langchain_community/tools/audio/huggingface_text_to_speech_inference.py+++ b/libs/community/langchain_community/tools/audio/huggingface_text_to_speech_inference.py@@ -12,7 +12,7 @@ from pydantic import SecretStrlogger = logging.getLogger(__name__)-class HuggingFaceTextToSpeechModelInference(BaseTool): # type: ignore[override]+class HuggingFaceTextToSpeechModelInference(BaseTool):"""HuggingFace Text-to-Speech Model Inference.Requirements:@@ -74,7 +74,7 @@ class HuggingFaceTextToSpeechModelInference(BaseTool): # type: ignore[override]f"Invalid value for 'file_naming_func': {file_naming_func}")- super().__init__( # type: ignore[call-arg]+ super().__init__(model=model,file_extension=file_extension,api_url=f"{_HUGGINGFACE_API_URL_ROOT}/{model}",diff --git a/libs/community/langchain_community/tools/azure_ai_services/document_intelligence.py b/libs/community/langchain_community/tools/azure_ai_services/document_intelligence.pyindex 994fd13e64..cd0ac25018 100644--- a/libs/community/langchain_community/tools/azure_ai_services/document_intelligence.py+++ b/libs/community/langchain_community/tools/azure_ai_services/document_intelligence.py@@ -15,7 +15,7 @@ from langchain_community.tools.azure_ai_services.utils import (logger = logging.getLogger(__name__)-class AzureAiServicesDocumentIntelligenceTool(BaseTool): # type: ignore[override]+class AzureAiServicesDocumentIntelligenceTool(BaseTool):"""Tool that queries the Azure AI Services Document Intelligence API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_ai_services/image_analysis.py b/libs/community/langchain_community/tools/azure_ai_services/image_analysis.pyindex ad6a7ca239..c3292cff6b 100644--- a/libs/community/langchain_community/tools/azure_ai_services/image_analysis.py+++ b/libs/community/langchain_community/tools/azure_ai_services/image_analysis.py@@ -15,7 +15,7 @@ from langchain_community.tools.azure_ai_services.utils import (logger = logging.getLogger(__name__)-class AzureAiServicesImageAnalysisTool(BaseTool): # type: ignore[override]+class AzureAiServicesImageAnalysisTool(BaseTool):"""Tool that queries the Azure AI Services Image Analysis API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_ai_services/speech_to_text.py b/libs/community/langchain_community/tools/azure_ai_services/speech_to_text.pyindex b10c032342..15e08d2722 100644--- a/libs/community/langchain_community/tools/azure_ai_services/speech_to_text.py+++ b/libs/community/langchain_community/tools/azure_ai_services/speech_to_text.py@@ -17,7 +17,7 @@ from langchain_community.tools.azure_ai_services.utils import (logger = logging.getLogger(__name__)-class AzureAiServicesSpeechToTextTool(BaseTool): # type: ignore[override]+class AzureAiServicesSpeechToTextTool(BaseTool):"""Tool that queries the Azure AI Services Speech to Text API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_ai_services/text_analytics_for_health.py b/libs/community/langchain_community/tools/azure_ai_services/text_analytics_for_health.pyindex b7fcd310e9..6df15788f5 100644--- a/libs/community/langchain_community/tools/azure_ai_services/text_analytics_for_health.py+++ b/libs/community/langchain_community/tools/azure_ai_services/text_analytics_for_health.py@@ -11,7 +11,7 @@ from pydantic import model_validatorlogger = logging.getLogger(__name__)-class AzureAiServicesTextAnalyticsForHealthTool(BaseTool): # type: ignore[override]+class AzureAiServicesTextAnalyticsForHealthTool(BaseTool):"""Tool that queries the Azure AI Services Text Analytics for Health API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_ai_services/text_to_speech.py b/libs/community/langchain_community/tools/azure_ai_services/text_to_speech.pyindex 605a97998e..1291e2dac5 100644--- a/libs/community/langchain_community/tools/azure_ai_services/text_to_speech.py+++ b/libs/community/langchain_community/tools/azure_ai_services/text_to_speech.py@@ -12,7 +12,7 @@ from pydantic import model_validatorlogger = logging.getLogger(__name__)-class AzureAiServicesTextToSpeechTool(BaseTool): # type: ignore[override]+class AzureAiServicesTextToSpeechTool(BaseTool):"""Tool that queries the Azure AI Services Text to Speech API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_cognitive_services/form_recognizer.py b/libs/community/langchain_community/tools/azure_cognitive_services/form_recognizer.pyindex 6789787bcc..937b1fc793 100644--- a/libs/community/langchain_community/tools/azure_cognitive_services/form_recognizer.py+++ b/libs/community/langchain_community/tools/azure_cognitive_services/form_recognizer.py@@ -15,7 +15,7 @@ from langchain_community.tools.azure_cognitive_services.utils import (logger = logging.getLogger(__name__)-class AzureCogsFormRecognizerTool(BaseTool): # type: ignore[override]+class AzureCogsFormRecognizerTool(BaseTool):"""Tool that queries the Azure Cognitive Services Form Recognizer API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_cognitive_services/image_analysis.py b/libs/community/langchain_community/tools/azure_cognitive_services/image_analysis.pyindex c4223d24a7..ce076243a7 100644--- a/libs/community/langchain_community/tools/azure_cognitive_services/image_analysis.py+++ b/libs/community/langchain_community/tools/azure_cognitive_services/image_analysis.py@@ -15,7 +15,7 @@ from langchain_community.tools.azure_cognitive_services.utils import (logger = logging.getLogger(__name__)-class AzureCogsImageAnalysisTool(BaseTool): # type: ignore[override]+class AzureCogsImageAnalysisTool(BaseTool):"""Tool that queries the Azure Cognitive Services Image Analysis API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_cognitive_services/speech2text.py b/libs/community/langchain_community/tools/azure_cognitive_services/speech2text.pyindex 3a80955060..125c910df1 100644--- a/libs/community/langchain_community/tools/azure_cognitive_services/speech2text.py+++ b/libs/community/langchain_community/tools/azure_cognitive_services/speech2text.py@@ -17,7 +17,7 @@ from langchain_community.tools.azure_cognitive_services.utils import (logger = logging.getLogger(__name__)-class AzureCogsSpeech2TextTool(BaseTool): # type: ignore[override]+class AzureCogsSpeech2TextTool(BaseTool):"""Tool that queries the Azure Cognitive Services Speech2Text API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_cognitive_services/text2speech.py b/libs/community/langchain_community/tools/azure_cognitive_services/text2speech.pyindex c669256180..343653fe9c 100644--- a/libs/community/langchain_community/tools/azure_cognitive_services/text2speech.py+++ b/libs/community/langchain_community/tools/azure_cognitive_services/text2speech.py@@ -12,7 +12,7 @@ from pydantic import model_validatorlogger = logging.getLogger(__name__)-class AzureCogsText2SpeechTool(BaseTool): # type: ignore[override]+class AzureCogsText2SpeechTool(BaseTool):"""Tool that queries the Azure Cognitive Services Text2Speech API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/azure_cognitive_services/text_analytics_health.py b/libs/community/langchain_community/tools/azure_cognitive_services/text_analytics_health.pyindex 53463f4d59..26864a8382 100644--- a/libs/community/langchain_community/tools/azure_cognitive_services/text_analytics_health.py+++ b/libs/community/langchain_community/tools/azure_cognitive_services/text_analytics_health.py@@ -11,7 +11,7 @@ from pydantic import model_validatorlogger = logging.getLogger(__name__)-class AzureCogsTextAnalyticsHealthTool(BaseTool): # type: ignore[override]+class AzureCogsTextAnalyticsHealthTool(BaseTool):"""Tool that queries the Azure Cognitive Services Text Analytics for Health API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/bing_search/tool.py b/libs/community/langchain_community/tools/bing_search/tool.pyindex 413b1f70cf..9c05405f82 100644--- a/libs/community/langchain_community/tools/bing_search/tool.py+++ b/libs/community/langchain_community/tools/bing_search/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.bing_search import BingSearchAPIWrapper-class BingSearchRun(BaseTool): # type: ignore[override]+class BingSearchRun(BaseTool):"""Tool that queries the Bing search API."""name: str = "bing_search"@@ -28,7 +28,7 @@ class BingSearchRun(BaseTool): # type: ignore[override]return self.api_wrapper.run(query)-class BingSearchResults(BaseTool): # type: ignore[override, override]+class BingSearchResults(BaseTool):"""Bing Search tool.Setup:diff --git a/libs/community/langchain_community/tools/brave_search/tool.py b/libs/community/langchain_community/tools/brave_search/tool.pyindex 9d170494d6..c9d62210c2 100644--- a/libs/community/langchain_community/tools/brave_search/tool.py+++ b/libs/community/langchain_community/tools/brave_search/tool.py@@ -9,7 +9,7 @@ from pydantic import Field, SecretStrfrom langchain_community.utilities.brave_search import BraveSearchWrapper-class BraveSearch(BaseTool): # type: ignore[override]+class BraveSearch(BaseTool):"""Tool that queries the BraveSearch.Api key can be provided as an environment variable BRAVE_SEARCH_API_KEYdiff --git a/libs/community/langchain_community/tools/cassandra_database/tool.py b/libs/community/langchain_community/tools/cassandra_database/tool.pyindex b86e2a79bd..ab6e502fb0 100644--- a/libs/community/langchain_community/tools/cassandra_database/tool.py+++ b/libs/community/langchain_community/tools/cassandra_database/tool.py@@ -29,7 +29,7 @@ class _QueryCassandraDatabaseToolInput(BaseModel):query: str = Field(..., description="A detailed and correct CQL query.")-class QueryCassandraDatabaseTool(BaseCassandraDatabaseTool, BaseTool): # type: ignore[override, override]+class QueryCassandraDatabaseTool(BaseCassandraDatabaseTool, BaseTool):"""Tool for querying an Apache Cassandra database with provided CQL."""name: str = "cassandra_db_query"@@ -60,7 +60,7 @@ class _GetSchemaCassandraDatabaseToolInput(BaseModel):)-class GetSchemaCassandraDatabaseTool(BaseCassandraDatabaseTool, BaseTool): # type: ignore[override, override]+class GetSchemaCassandraDatabaseTool(BaseCassandraDatabaseTool, BaseTool):"""Tool for getting the schema of a keyspace in an Apache Cassandra database."""name: str = "cassandra_db_schema"@@ -107,7 +107,7 @@ class _GetTableDataCassandraDatabaseToolInput(BaseModel):)-class GetTableDataCassandraDatabaseTool(BaseCassandraDatabaseTool, BaseTool): # type: ignore[override, override]+class GetTableDataCassandraDatabaseTool(BaseCassandraDatabaseTool, BaseTool):"""Tool for getting data from a table in an Apache Cassandra database.Use the WHERE clause to specify the predicate for the query that uses thediff --git a/libs/community/langchain_community/tools/clickup/tool.py b/libs/community/langchain_community/tools/clickup/tool.pyindex 7b0cac67ce..03b3fde586 100644--- a/libs/community/langchain_community/tools/clickup/tool.py+++ b/libs/community/langchain_community/tools/clickup/tool.py@@ -26,7 +26,7 @@ from pydantic import Fieldfrom langchain_community.utilities.clickup import ClickupAPIWrapper-class ClickupAction(BaseTool): # type: ignore[override]+class ClickupAction(BaseTool):"""Tool that queries the Clickup API."""api_wrapper: ClickupAPIWrapper = Field(default_factory=ClickupAPIWrapper)diff --git a/libs/community/langchain_community/tools/cogniswitch/tool.py b/libs/community/langchain_community/tools/cogniswitch/tool.pyindex 1dc62b9e5c..41c9663fb5 100644--- a/libs/community/langchain_community/tools/cogniswitch/tool.py+++ b/libs/community/langchain_community/tools/cogniswitch/tool.py@@ -7,7 +7,7 @@ from langchain_core.callbacks import CallbackManagerForToolRunfrom langchain_core.tools import BaseTool-class CogniswitchKnowledgeRequest(BaseTool): # type: ignore[override]+class CogniswitchKnowledgeRequest(BaseTool):"""Tool that uses the Cogniswitch service to answer questions.name: str = "cogniswitch_knowledge_request"@@ -80,7 +80,7 @@ class CogniswitchKnowledgeRequest(BaseTool): # type: ignore[override]return response.json()-class CogniswitchKnowledgeStatus(BaseTool): # type: ignore[override]+class CogniswitchKnowledgeStatus(BaseTool):"""Tool that uses the Cogniswitch services to get thestatus of the document or url uploaded.@@ -180,7 +180,7 @@ class CogniswitchKnowledgeStatus(BaseTool): # type: ignore[override]}-class CogniswitchKnowledgeSourceFile(BaseTool): # type: ignore[override]+class CogniswitchKnowledgeSourceFile(BaseTool):"""Tool that uses the Cogniswitch services to store data from file.name: str = "cogniswitch_knowledge_source_file"@@ -293,7 +293,7 @@ class CogniswitchKnowledgeSourceFile(BaseTool): # type: ignore[override]return {"message": "Bad Request"}-class CogniswitchKnowledgeSourceURL(BaseTool): # type: ignore[override]+class CogniswitchKnowledgeSourceURL(BaseTool):"""Tool that uses the Cogniswitch services to store data from a URL.name: str = "cogniswitch_knowledge_source_url"diff --git a/libs/community/langchain_community/tools/connery/tool.py b/libs/community/langchain_community/tools/connery/tool.pyindex 2bb0713493..d74bfc1743 100644--- a/libs/community/langchain_community/tools/connery/tool.py+++ b/libs/community/langchain_community/tools/connery/tool.py@@ -12,7 +12,7 @@ from pydantic import BaseModel, Field, create_model, model_validatorfrom langchain_community.tools.connery.models import Action, Parameter-class ConneryAction(BaseTool): # type: ignore[override, override]+class ConneryAction(BaseTool):"""Connery Action tool."""name: strdiff --git a/libs/community/langchain_community/tools/dataforseo_api_search/tool.py b/libs/community/langchain_community/tools/dataforseo_api_search/tool.pyindex 8adc8b9ab8..65bf1ec22c 100644--- a/libs/community/langchain_community/tools/dataforseo_api_search/tool.py+++ b/libs/community/langchain_community/tools/dataforseo_api_search/tool.py@@ -12,7 +12,7 @@ from pydantic import Fieldfrom langchain_community.utilities.dataforseo_api_search import DataForSeoAPIWrapper-class DataForSeoAPISearchRun(BaseTool): # type: ignore[override]+class DataForSeoAPISearchRun(BaseTool):"""Tool that queries the DataForSeo Google search API."""name: str = "dataforseo_api_search"@@ -40,7 +40,7 @@ class DataForSeoAPISearchRun(BaseTool): # type: ignore[override]return (await self.api_wrapper.arun(query)).__str__()-class DataForSeoAPISearchResults(BaseTool): # type: ignore[override]+class DataForSeoAPISearchResults(BaseTool):"""Tool that queries the DataForSeo Google Search APIand get back json."""diff --git a/libs/community/langchain_community/tools/dataherald/tool.py b/libs/community/langchain_community/tools/dataherald/tool.pyindex 56b02e7018..2a2546a328 100644--- a/libs/community/langchain_community/tools/dataherald/tool.py+++ b/libs/community/langchain_community/tools/dataherald/tool.py@@ -15,7 +15,7 @@ class DataheraldTextToSQLInput(BaseModel):)-class DataheraldTextToSQL(BaseTool): # type: ignore[override, override]+class DataheraldTextToSQL(BaseTool):"""Tool that queries using the Dataherald SDK."""name: str = "dataherald"diff --git a/libs/community/langchain_community/tools/ddg_search/tool.py b/libs/community/langchain_community/tools/ddg_search/tool.pyindex e5c28cb1f6..7db9b77da4 100644--- a/libs/community/langchain_community/tools/ddg_search/tool.py+++ b/libs/community/langchain_community/tools/ddg_search/tool.py@@ -17,7 +17,7 @@ class DDGInput(BaseModel):query: str = Field(description="search query to look up")-class DuckDuckGoSearchRun(BaseTool): # type: ignore[override, override]+class DuckDuckGoSearchRun(BaseTool):"""DuckDuckGo tool.Setup:@@ -74,7 +74,7 @@ class DuckDuckGoSearchRun(BaseTool): # type: ignore[override, override]return self.api_wrapper.run(query)-class DuckDuckGoSearchResults(BaseTool): # type: ignore[override, override]+class DuckDuckGoSearchResults(BaseTool):"""Tool that queries the DuckDuckGo search API andreturns the results in `output_format`."""diff --git a/libs/community/langchain_community/tools/e2b_data_analysis/tool.py b/libs/community/langchain_community/tools/e2b_data_analysis/tool.pyindex 0078637d96..3f952f6dc6 100644--- a/libs/community/langchain_community/tools/e2b_data_analysis/tool.py+++ b/libs/community/langchain_community/tools/e2b_data_analysis/tool.py@@ -39,7 +39,7 @@ def _unparse(tree: ast.AST) -> str:source_code = s.getvalue()s.close()else:- source_code = ast.unparse(tree) # type: ignore[attr-defined]+ source_code = ast.unparse(tree)return source_code@@ -93,7 +93,7 @@ class E2BDataAnalysisToolArguments(BaseModel):)-class E2BDataAnalysisTool(BaseTool): # type: ignore[override, override]+class E2BDataAnalysisTool(BaseTool):"""Tool for running python code in a sandboxed environment for data analysis."""name: str = "e2b_data_analysis"diff --git a/libs/community/langchain_community/tools/edenai/audio_speech_to_text.py b/libs/community/langchain_community/tools/edenai/audio_speech_to_text.pyindex b3a70d4e64..ead38e7d19 100644--- a/libs/community/langchain_community/tools/edenai/audio_speech_to_text.py+++ b/libs/community/langchain_community/tools/edenai/audio_speech_to_text.py@@ -18,7 +18,7 @@ class SpeechToTextInput(BaseModel):query: HttpUrl = Field(description="url of the audio to analyze")-class EdenAiSpeechToTextTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiSpeechToTextTool(EdenaiTool):"""Tool that queries the Eden AI Speech To Text API.for api reference check edenai documentation:diff --git a/libs/community/langchain_community/tools/edenai/audio_text_to_speech.py b/libs/community/langchain_community/tools/edenai/audio_text_to_speech.pyindex 8c88060b75..d17c0854f9 100644--- a/libs/community/langchain_community/tools/edenai/audio_text_to_speech.py+++ b/libs/community/langchain_community/tools/edenai/audio_text_to_speech.py@@ -16,7 +16,7 @@ class TextToSpeechInput(BaseModel):query: str = Field(description="text to generate audio from")-class EdenAiTextToSpeechTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiTextToSpeechTool(EdenaiTool):"""Tool that queries the Eden AI Text to speech API.for api reference check edenai documentation:https://docs.edenai.co/reference/audio_text_to_speech_create.diff --git a/libs/community/langchain_community/tools/edenai/edenai_base_tool.py b/libs/community/langchain_community/tools/edenai/edenai_base_tool.pyindex 5ce3b89dce..edc5b582e2 100644--- a/libs/community/langchain_community/tools/edenai/edenai_base_tool.py+++ b/libs/community/langchain_community/tools/edenai/edenai_base_tool.py@@ -13,7 +13,7 @@ from pydantic import Field, SecretStrlogger = logging.getLogger(__name__)-class EdenaiTool(BaseTool): # type: ignore[override]+class EdenaiTool(BaseTool):"""the base tool for all the EdenAI Tools .you should havediff --git a/libs/community/langchain_community/tools/edenai/image_explicitcontent.py b/libs/community/langchain_community/tools/edenai/image_explicitcontent.pyindex 11dfa02df0..50f9f24338 100644--- a/libs/community/langchain_community/tools/edenai/image_explicitcontent.py+++ b/libs/community/langchain_community/tools/edenai/image_explicitcontent.py@@ -15,7 +15,7 @@ class ExplicitImageInput(BaseModel):query: HttpUrl = Field(description="url of the image to analyze")-class EdenAiExplicitImageTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiExplicitImageTool(EdenaiTool):"""Tool that queries the Eden AI Explicit image detection.for api reference check edenai documentation:diff --git a/libs/community/langchain_community/tools/edenai/image_objectdetection.py b/libs/community/langchain_community/tools/edenai/image_objectdetection.pyindex ed4daac712..491f6ec5b3 100644--- a/libs/community/langchain_community/tools/edenai/image_objectdetection.py+++ b/libs/community/langchain_community/tools/edenai/image_objectdetection.py@@ -15,7 +15,7 @@ class ObjectDetectionInput(BaseModel):query: HttpUrl = Field(description="url of the image to analyze")-class EdenAiObjectDetectionTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiObjectDetectionTool(EdenaiTool):"""Tool that queries the Eden AI Object detection API.for api reference check edenai documentation:diff --git a/libs/community/langchain_community/tools/edenai/ocr_identityparser.py b/libs/community/langchain_community/tools/edenai/ocr_identityparser.pyindex 74b0e9cefc..f227034591 100644--- a/libs/community/langchain_community/tools/edenai/ocr_identityparser.py+++ b/libs/community/langchain_community/tools/edenai/ocr_identityparser.py@@ -15,7 +15,7 @@ class IDParsingInput(BaseModel):query: HttpUrl = Field(description="url of the document to parse")-class EdenAiParsingIDTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiParsingIDTool(EdenaiTool):"""Tool that queries the Eden AI Identity parsing API.for api reference check edenai documentation:diff --git a/libs/community/langchain_community/tools/edenai/ocr_invoiceparser.py b/libs/community/langchain_community/tools/edenai/ocr_invoiceparser.pyindex e84d514cca..d526647678 100644--- a/libs/community/langchain_community/tools/edenai/ocr_invoiceparser.py+++ b/libs/community/langchain_community/tools/edenai/ocr_invoiceparser.py@@ -15,7 +15,7 @@ class InvoiceParsingInput(BaseModel):query: HttpUrl = Field(description="url of the document to parse")-class EdenAiParsingInvoiceTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiParsingInvoiceTool(EdenaiTool):"""Tool that queries the Eden AI Invoice parsing API.for api reference check edenai documentation:diff --git a/libs/community/langchain_community/tools/edenai/text_moderation.py b/libs/community/langchain_community/tools/edenai/text_moderation.pyindex 319f87702a..f5f8497ff3 100644--- a/libs/community/langchain_community/tools/edenai/text_moderation.py+++ b/libs/community/langchain_community/tools/edenai/text_moderation.py@@ -15,7 +15,7 @@ class TextModerationInput(BaseModel):query: str = Field(description="Text to moderate")-class EdenAiTextModerationTool(EdenaiTool): # type: ignore[override, override, override]+class EdenAiTextModerationTool(EdenaiTool):"""Tool that queries the Eden AI Explicit text detection.for api reference check edenai documentation:diff --git a/libs/community/langchain_community/tools/eleven_labs/text2speech.py b/libs/community/langchain_community/tools/eleven_labs/text2speech.pyindex b6e51061a7..91fd89b379 100644--- a/libs/community/langchain_community/tools/eleven_labs/text2speech.py+++ b/libs/community/langchain_community/tools/eleven_labs/text2speech.py@@ -26,7 +26,7 @@ class ElevenLabsModel(str, Enum):MONO_LINGUAL = "eleven_flash_v2"-class ElevenLabsText2SpeechTool(BaseTool): # type: ignore[override]+class ElevenLabsText2SpeechTool(BaseTool):"""Tool that queries the Eleven Labs Text2Speech API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/few_shot/tool.py b/libs/community/langchain_community/tools/few_shot/tool.pyindex 2387ca4edb..a61a24e1f5 100644--- a/libs/community/langchain_community/tools/few_shot/tool.py+++ b/libs/community/langchain_community/tools/few_shot/tool.py@@ -13,7 +13,7 @@ class _FewShotToolInput(BaseModel):)-class FewShotSQLTool(BaseTool): # type: ignore[override]+class FewShotSQLTool(BaseTool):"""Tool to get example SQL queries related to an input question."""name: str = "few_shot_sql"diff --git a/libs/community/langchain_community/tools/file_management/copy.py b/libs/community/langchain_community/tools/file_management/copy.pyindex 209f217b75..7679e3c43b 100644--- a/libs/community/langchain_community/tools/file_management/copy.py+++ b/libs/community/langchain_community/tools/file_management/copy.py@@ -19,7 +19,7 @@ class FileCopyInput(BaseModel):destination_path: str = Field(..., description="Path to save the copied file")-class CopyFileTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class CopyFileTool(BaseFileToolMixin, BaseTool):"""Tool that copies a file."""name: str = "copy_file"diff --git a/libs/community/langchain_community/tools/file_management/delete.py b/libs/community/langchain_community/tools/file_management/delete.pyindex e840875807..33f4b70b28 100644--- a/libs/community/langchain_community/tools/file_management/delete.py+++ b/libs/community/langchain_community/tools/file_management/delete.py@@ -18,7 +18,7 @@ class FileDeleteInput(BaseModel):file_path: str = Field(..., description="Path of the file to delete")-class DeleteFileTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class DeleteFileTool(BaseFileToolMixin, BaseTool):"""Tool that deletes a file."""name: str = "file_delete"diff --git a/libs/community/langchain_community/tools/file_management/file_search.py b/libs/community/langchain_community/tools/file_management/file_search.pyindex 02b2e1dd44..a00aee40b4 100644--- a/libs/community/langchain_community/tools/file_management/file_search.py+++ b/libs/community/langchain_community/tools/file_management/file_search.py@@ -26,7 +26,7 @@ class FileSearchInput(BaseModel):)-class FileSearchTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class FileSearchTool(BaseFileToolMixin, BaseTool):"""Tool that searches for files in a subdirectory that match a regex pattern."""name: str = "file_search"diff --git a/libs/community/langchain_community/tools/file_management/list_dir.py b/libs/community/langchain_community/tools/file_management/list_dir.pyindex a2ffc6494f..a8bfdc8e3a 100644--- a/libs/community/langchain_community/tools/file_management/list_dir.py+++ b/libs/community/langchain_community/tools/file_management/list_dir.py@@ -18,7 +18,7 @@ class DirectoryListingInput(BaseModel):dir_path: str = Field(default=".", description="Subdirectory to list.")-class ListDirectoryTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class ListDirectoryTool(BaseFileToolMixin, BaseTool):"""Tool that lists files and directories in a specified folder."""name: str = "list_directory"diff --git a/libs/community/langchain_community/tools/file_management/move.py b/libs/community/langchain_community/tools/file_management/move.pyindex 1d9bce338e..935625172e 100644--- a/libs/community/langchain_community/tools/file_management/move.py+++ b/libs/community/langchain_community/tools/file_management/move.py@@ -19,7 +19,7 @@ class FileMoveInput(BaseModel):destination_path: str = Field(..., description="New path for the moved file")-class MoveFileTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class MoveFileTool(BaseFileToolMixin, BaseTool):"""Tool that moves a file."""name: str = "move_file"diff --git a/libs/community/langchain_community/tools/file_management/read.py b/libs/community/langchain_community/tools/file_management/read.pyindex 92572ee85a..9f746ed16c 100644--- a/libs/community/langchain_community/tools/file_management/read.py+++ b/libs/community/langchain_community/tools/file_management/read.py@@ -17,7 +17,7 @@ class ReadFileInput(BaseModel):file_path: str = Field(..., description="name of file")-class ReadFileTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class ReadFileTool(BaseFileToolMixin, BaseTool):"""Tool that reads a file."""name: str = "read_file"diff --git a/libs/community/langchain_community/tools/file_management/write.py b/libs/community/langchain_community/tools/file_management/write.pyindex 647f845ecd..1d62065bb7 100644--- a/libs/community/langchain_community/tools/file_management/write.py+++ b/libs/community/langchain_community/tools/file_management/write.py@@ -21,7 +21,7 @@ class WriteFileInput(BaseModel):)-class WriteFileTool(BaseFileToolMixin, BaseTool): # type: ignore[override, override]+class WriteFileTool(BaseFileToolMixin, BaseTool):"""Tool that writes a file to disk."""name: str = "write_file"diff --git a/libs/community/langchain_community/tools/financial_datasets/balance_sheets.py b/libs/community/langchain_community/tools/financial_datasets/balance_sheets.pyindex 4be8125cb5..21508bc6f9 100644--- a/libs/community/langchain_community/tools/financial_datasets/balance_sheets.py+++ b/libs/community/langchain_community/tools/financial_datasets/balance_sheets.py@@ -24,7 +24,7 @@ class BalanceSheetsSchema(BaseModel):)-class BalanceSheets(BaseTool): # type: ignore[override, override]+class BalanceSheets(BaseTool):"""Tool that gets balance sheets for a given ticker over a given period."""diff --git a/libs/community/langchain_community/tools/financial_datasets/cash_flow_statements.py b/libs/community/langchain_community/tools/financial_datasets/cash_flow_statements.pyindex 5f621085a1..065c645420 100644--- a/libs/community/langchain_community/tools/financial_datasets/cash_flow_statements.py+++ b/libs/community/langchain_community/tools/financial_datasets/cash_flow_statements.py@@ -24,7 +24,7 @@ class CashFlowStatementsSchema(BaseModel):)-class CashFlowStatements(BaseTool): # type: ignore[override, override]+class CashFlowStatements(BaseTool):"""Tool that gets cash flow statements for a given ticker over a given period."""diff --git a/libs/community/langchain_community/tools/financial_datasets/income_statements.py b/libs/community/langchain_community/tools/financial_datasets/income_statements.pyindex d181ef7a1c..c4801f3d06 100644--- a/libs/community/langchain_community/tools/financial_datasets/income_statements.py+++ b/libs/community/langchain_community/tools/financial_datasets/income_statements.py@@ -24,7 +24,7 @@ class IncomeStatementsSchema(BaseModel):)-class IncomeStatements(BaseTool): # type: ignore[override, override]+class IncomeStatements(BaseTool):"""Tool that gets income statements for a given ticker over a given period."""diff --git a/libs/community/langchain_community/tools/github/tool.py b/libs/community/langchain_community/tools/github/tool.pyindex 1c605c9536..836ebc0913 100644--- a/libs/community/langchain_community/tools/github/tool.py+++ b/libs/community/langchain_community/tools/github/tool.py@@ -17,10 +17,10 @@ from pydantic import BaseModel, Fieldfrom langchain_community.utilities.github import GitHubAPIWrapper-class GitHubAction(BaseTool): # type: ignore[override]+class GitHubAction(BaseTool):"""Tool for interacting with the GitHub API."""- api_wrapper: GitHubAPIWrapper = Field(default_factory=GitHubAPIWrapper) # type: ignore[arg-type]+ api_wrapper: GitHubAPIWrapper = Field(default_factory=GitHubAPIWrapper)mode: strname: str = ""description: str = ""diff --git a/libs/community/langchain_community/tools/gitlab/tool.py b/libs/community/langchain_community/tools/gitlab/tool.pyindex ac9d27b7df..338165ec84 100644--- a/libs/community/langchain_community/tools/gitlab/tool.py+++ b/libs/community/langchain_community/tools/gitlab/tool.py@@ -17,10 +17,10 @@ from pydantic import Fieldfrom langchain_community.utilities.gitlab import GitLabAPIWrapper-class GitLabAction(BaseTool): # type: ignore[override]+class GitLabAction(BaseTool):"""Tool for interacting with the GitLab API."""- api_wrapper: GitLabAPIWrapper = Field(default_factory=GitLabAPIWrapper) # type: ignore[arg-type]+ api_wrapper: GitLabAPIWrapper = Field(default_factory=GitLabAPIWrapper)mode: strname: str = ""description: str = ""diff --git a/libs/community/langchain_community/tools/gmail/base.py b/libs/community/langchain_community/tools/gmail/base.pyindex 82e44fbc00..d55b0d30f8 100644--- a/libs/community/langchain_community/tools/gmail/base.py+++ b/libs/community/langchain_community/tools/gmail/base.py@@ -20,7 +20,7 @@ else:pass-class GmailBaseTool(BaseTool): # type: ignore[override]+class GmailBaseTool(BaseTool):"""Base class for Gmail tools."""api_resource: Resource = Field(default_factory=build_resource_service)diff --git a/libs/community/langchain_community/tools/gmail/create_draft.py b/libs/community/langchain_community/tools/gmail/create_draft.pyindex a1cb44cd3c..ec2495aaa4 100644--- a/libs/community/langchain_community/tools/gmail/create_draft.py+++ b/libs/community/langchain_community/tools/gmail/create_draft.py@@ -33,7 +33,7 @@ class CreateDraftSchema(BaseModel):)-class GmailCreateDraft(GmailBaseTool): # type: ignore[override, override]+class GmailCreateDraft(GmailBaseTool):"""Tool that creates a draft email for Gmail."""name: str = "create_gmail_draft"diff --git a/libs/community/langchain_community/tools/gmail/get_message.py b/libs/community/langchain_community/tools/gmail/get_message.pyindex 0145d37b65..6155cb499f 100644--- a/libs/community/langchain_community/tools/gmail/get_message.py+++ b/libs/community/langchain_community/tools/gmail/get_message.py@@ -18,7 +18,7 @@ class SearchArgsSchema(BaseModel):)-class GmailGetMessage(GmailBaseTool): # type: ignore[override, override]+class GmailGetMessage(GmailBaseTool):"""Tool that gets a message by ID from Gmail."""name: str = "get_gmail_message"diff --git a/libs/community/langchain_community/tools/gmail/get_thread.py b/libs/community/langchain_community/tools/gmail/get_thread.pyindex 266b81115c..5e61bd8bb9 100644--- a/libs/community/langchain_community/tools/gmail/get_thread.py+++ b/libs/community/langchain_community/tools/gmail/get_thread.py@@ -16,7 +16,7 @@ class GetThreadSchema(BaseModel):)-class GmailGetThread(GmailBaseTool): # type: ignore[override, override]+class GmailGetThread(GmailBaseTool):"""Tool that gets a thread by ID from Gmail."""name: str = "get_gmail_thread"diff --git a/libs/community/langchain_community/tools/gmail/search.py b/libs/community/langchain_community/tools/gmail/search.pyindex f0b4fe1df4..eb61968429 100644--- a/libs/community/langchain_community/tools/gmail/search.py+++ b/libs/community/langchain_community/tools/gmail/search.py@@ -43,7 +43,7 @@ class SearchArgsSchema(BaseModel):)-class GmailSearch(GmailBaseTool): # type: ignore[override, override]+class GmailSearch(GmailBaseTool):"""Tool that searches for messages or threads in Gmail."""name: str = "search_gmail"diff --git a/libs/community/langchain_community/tools/gmail/send_message.py b/libs/community/langchain_community/tools/gmail/send_message.pyindex fadab49014..0d9fbc6697 100644--- a/libs/community/langchain_community/tools/gmail/send_message.py+++ b/libs/community/langchain_community/tools/gmail/send_message.py@@ -36,7 +36,7 @@ class SendMessageSchema(BaseModel):)-class GmailSendMessage(GmailBaseTool): # type: ignore[override, override]+class GmailSendMessage(GmailBaseTool):"""Tool that sends a message to Gmail."""name: str = "send_gmail_message"diff --git a/libs/community/langchain_community/tools/gmail/utils.py b/libs/community/langchain_community/tools/gmail/utils.pyindex 01a6b77448..e53a453836 100644--- a/libs/community/langchain_community/tools/gmail/utils.py+++ b/libs/community/langchain_community/tools/gmail/utils.py@@ -83,7 +83,7 @@ def get_gmail_credentials(# If there are no (valid) credentials available, let the user log in.if not creds or not creds.valid:if creds and creds.expired and creds.refresh_token:- creds.refresh(Request()) # type: ignore[call-arg]+ creds.refresh(Request())else:# https://developers.google.com/gmail/api/quickstart/python#authorize_credentials_for_a_desktop_application # noqaflow = InstalledAppFlow.from_client_secrets_file(diff --git a/libs/community/langchain_community/tools/golden_query/tool.py b/libs/community/langchain_community/tools/golden_query/tool.pyindex 1f9664aa15..7cc5c72234 100644--- a/libs/community/langchain_community/tools/golden_query/tool.py+++ b/libs/community/langchain_community/tools/golden_query/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.golden_query import GoldenQueryAPIWrapper-class GoldenQueryRun(BaseTool): # type: ignore[override]+class GoldenQueryRun(BaseTool):"""Tool that adds the capability to query using the Golden API and get back JSON."""name: str = "golden_query"diff --git a/libs/community/langchain_community/tools/google_books.py b/libs/community/langchain_community/tools/google_books.pyindex 390fce3fdf..572dd2747a 100644--- a/libs/community/langchain_community/tools/google_books.py+++ b/libs/community/langchain_community/tools/google_books.py@@ -15,7 +15,7 @@ class GoogleBooksQueryInput(BaseModel):query: str = Field(description="query to look up on google books")-class GoogleBooksQueryRun(BaseTool): # type: ignore[override]+class GoogleBooksQueryRun(BaseTool):"""Tool that searches the Google Books API."""name: str = "GoogleBooks"diff --git a/libs/community/langchain_community/tools/google_cloud/texttospeech.py b/libs/community/langchain_community/tools/google_cloud/texttospeech.pyindex 7984ae328f..02a24e9cf1 100644--- a/libs/community/langchain_community/tools/google_cloud/texttospeech.py+++ b/libs/community/langchain_community/tools/google_cloud/texttospeech.py@@ -10,12 +10,12 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.vertexai import get_client_infoif TYPE_CHECKING:- from google.cloud import texttospeech # type: ignore[attr-defined]+ from google.cloud import texttospeechdef _import_google_cloud_texttospeech() -> Any:try:- from google.cloud import texttospeech # type: ignore[attr-defined]+ from google.cloud import texttospeechexcept ImportError as e:raise ImportError("Cannot import google.cloud.texttospeech, please install "@@ -42,7 +42,7 @@ def _encoding_file_extension_map(encoding: texttospeech.AudioEncoding) -> Optionremoval="1.0",alternative_import="langchain_google_community.TextToSpeechTool",)-class GoogleCloudTextToSpeechTool(BaseTool): # type: ignore[override]+class GoogleCloudTextToSpeechTool(BaseTool):"""Tool that queries the Google Cloud Text to Speech API.In order to set this up, follow instructions at:diff --git a/libs/community/langchain_community/tools/google_finance/tool.py b/libs/community/langchain_community/tools/google_finance/tool.pyindex 15bbc1da2b..82eb82de31 100644--- a/libs/community/langchain_community/tools/google_finance/tool.py+++ b/libs/community/langchain_community/tools/google_finance/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.google_finance import GoogleFinanceAPIWrapper-class GoogleFinanceQueryRun(BaseTool): # type: ignore[override]+class GoogleFinanceQueryRun(BaseTool):"""Tool that queries the Google Finance API."""name: str = "google_finance"diff --git a/libs/community/langchain_community/tools/google_jobs/tool.py b/libs/community/langchain_community/tools/google_jobs/tool.pyindex 98211d4351..6a83b3043d 100644--- a/libs/community/langchain_community/tools/google_jobs/tool.py+++ b/libs/community/langchain_community/tools/google_jobs/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.google_jobs import GoogleJobsAPIWrapper-class GoogleJobsQueryRun(BaseTool): # type: ignore[override]+class GoogleJobsQueryRun(BaseTool):"""Tool that queries the Google Jobs API."""name: str = "google_jobs"diff --git a/libs/community/langchain_community/tools/google_lens/tool.py b/libs/community/langchain_community/tools/google_lens/tool.pyindex 677e11babd..38a4b847e2 100644--- a/libs/community/langchain_community/tools/google_lens/tool.py+++ b/libs/community/langchain_community/tools/google_lens/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.google_lens import GoogleLensAPIWrapper-class GoogleLensQueryRun(BaseTool): # type: ignore[override]+class GoogleLensQueryRun(BaseTool):"""Tool that queries the Google Lens API."""name: str = "google_lens"diff --git a/libs/community/langchain_community/tools/google_places/tool.py b/libs/community/langchain_community/tools/google_places/tool.pyindex 9328ec9050..77a1469073 100644--- a/libs/community/langchain_community/tools/google_places/tool.py+++ b/libs/community/langchain_community/tools/google_places/tool.py@@ -21,7 +21,7 @@ class GooglePlacesSchema(BaseModel):removal="1.0",alternative_import="langchain_google_community.GooglePlacesTool",)-class GooglePlacesTool(BaseTool): # type: ignore[override, override]+class GooglePlacesTool(BaseTool):"""Tool that queries the Google places API."""name: str = "google_places"@@ -31,7 +31,7 @@ class GooglePlacesTool(BaseTool): # type: ignore[override, override]"discover addressed from ambiguous text. ""Input should be a search query.")- api_wrapper: GooglePlacesAPIWrapper = Field(default_factory=GooglePlacesAPIWrapper) # type: ignore[arg-type]+ api_wrapper: GooglePlacesAPIWrapper = Field(default_factory=GooglePlacesAPIWrapper)args_schema: Type[BaseModel] = GooglePlacesSchemadef _run(diff --git a/libs/community/langchain_community/tools/google_scholar/tool.py b/libs/community/langchain_community/tools/google_scholar/tool.pyindex 05bf590b9b..49f8769696 100644--- a/libs/community/langchain_community/tools/google_scholar/tool.py+++ b/libs/community/langchain_community/tools/google_scholar/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.google_scholar import GoogleScholarAPIWrapper-class GoogleScholarQueryRun(BaseTool): # type: ignore[override]+class GoogleScholarQueryRun(BaseTool):"""Tool that queries the Google search API."""name: str = "google_scholar"diff --git a/libs/community/langchain_community/tools/google_search/tool.py b/libs/community/langchain_community/tools/google_search/tool.pyindex fe9eac16be..3ba05079df 100644--- a/libs/community/langchain_community/tools/google_search/tool.py+++ b/libs/community/langchain_community/tools/google_search/tool.py@@ -14,7 +14,7 @@ from langchain_community.utilities.google_search import GoogleSearchAPIWrapperremoval="1.0",alternative_import="langchain_google_community.GoogleSearchRun",)-class GoogleSearchRun(BaseTool): # type: ignore[override]+class GoogleSearchRun(BaseTool):"""Tool that queries the Google search API."""name: str = "google_search"@@ -39,7 +39,7 @@ class GoogleSearchRun(BaseTool): # type: ignore[override]removal="1.0",alternative_import="langchain_google_community.GoogleSearchResults",)-class GoogleSearchResults(BaseTool): # type: ignore[override]+class GoogleSearchResults(BaseTool):"""Tool that queries the Google Search API and gets back json."""name: str = "google_search_results_json"diff --git a/libs/community/langchain_community/tools/google_serper/tool.py b/libs/community/langchain_community/tools/google_serper/tool.pyindex 2b277790fb..562dd012a1 100644--- a/libs/community/langchain_community/tools/google_serper/tool.py+++ b/libs/community/langchain_community/tools/google_serper/tool.py@@ -12,7 +12,7 @@ from pydantic import Fieldfrom langchain_community.utilities.google_serper import GoogleSerperAPIWrapper-class GoogleSerperRun(BaseTool): # type: ignore[override]+class GoogleSerperRun(BaseTool):"""Tool that queries the Serper.dev Google search API."""name: str = "google_serper"@@ -40,7 +40,7 @@ class GoogleSerperRun(BaseTool): # type: ignore[override]return (await self.api_wrapper.arun(query)).__str__()-class GoogleSerperResults(BaseTool): # type: ignore[override]+class GoogleSerperResults(BaseTool):"""Tool that queries the Serper.dev Google Search APIand get back json."""diff --git a/libs/community/langchain_community/tools/google_trends/tool.py b/libs/community/langchain_community/tools/google_trends/tool.pyindex f830cf871e..8b2b5dd8bf 100644--- a/libs/community/langchain_community/tools/google_trends/tool.py+++ b/libs/community/langchain_community/tools/google_trends/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper-class GoogleTrendsQueryRun(BaseTool): # type: ignore[override]+class GoogleTrendsQueryRun(BaseTool):"""Tool that queries the Google trends API."""name: str = "google_trends"diff --git a/libs/community/langchain_community/tools/graphql/tool.py b/libs/community/langchain_community/tools/graphql/tool.pyindex 939c6a09c6..0530f8cae0 100644--- a/libs/community/langchain_community/tools/graphql/tool.py+++ b/libs/community/langchain_community/tools/graphql/tool.py@@ -8,7 +8,7 @@ from pydantic import ConfigDictfrom langchain_community.utilities.graphql import GraphQLAPIWrapper-class BaseGraphQLTool(BaseTool): # type: ignore[override]+class BaseGraphQLTool(BaseTool):"""Base tool for querying a GraphQL API."""graphql_wrapper: GraphQLAPIWrapperdiff --git a/libs/community/langchain_community/tools/human/tool.py b/libs/community/langchain_community/tools/human/tool.pyindex 0262039dc9..d9e238b93c 100644--- a/libs/community/langchain_community/tools/human/tool.py+++ b/libs/community/langchain_community/tools/human/tool.py@@ -12,7 +12,7 @@ def _print_func(text: str) -> None:print(text) # noqa: T201-class HumanInputRun(BaseTool): # type: ignore[override]+class HumanInputRun(BaseTool):"""Tool that asks user for input."""name: str = "human"diff --git a/libs/community/langchain_community/tools/ifttt.py b/libs/community/langchain_community/tools/ifttt.pyindex c28b078148..40bbe76fda 100644--- a/libs/community/langchain_community/tools/ifttt.py+++ b/libs/community/langchain_community/tools/ifttt.py@@ -40,7 +40,7 @@ from langchain_core.callbacks import CallbackManagerForToolRunfrom langchain_core.tools import BaseTool-class IFTTTWebhook(BaseTool): # type: ignore[override]+class IFTTTWebhook(BaseTool):"""IFTTT Webhook.Args:diff --git a/libs/community/langchain_community/tools/jina_search/tool.py b/libs/community/langchain_community/tools/jina_search/tool.pyindex dbb707f7f6..4c4e7650b6 100644--- a/libs/community/langchain_community/tools/jina_search/tool.py+++ b/libs/community/langchain_community/tools/jina_search/tool.py@@ -15,7 +15,7 @@ class JinaInput(BaseModel):query: str = Field(description="search query to look up")-class JinaSearch(BaseTool): # type: ignore[override]+class JinaSearch(BaseTool):"""Tool that queries the JinaSearch...versionadded:: 0.2.16diff --git a/libs/community/langchain_community/tools/jira/tool.py b/libs/community/langchain_community/tools/jira/tool.pyindex caa1a34c8c..93205920c5 100644--- a/libs/community/langchain_community/tools/jira/tool.py+++ b/libs/community/langchain_community/tools/jira/tool.py@@ -29,10 +29,10 @@ from pydantic import Fieldfrom langchain_community.utilities.jira import JiraAPIWrapper-class JiraAction(BaseTool): # type: ignore[override]+class JiraAction(BaseTool):"""Tool that queries the Atlassian Jira API."""- api_wrapper: JiraAPIWrapper = Field(default_factory=JiraAPIWrapper) # type: ignore[arg-type]+ api_wrapper: JiraAPIWrapper = Field(default_factory=JiraAPIWrapper)mode: strname: str = ""description: str = ""diff --git a/libs/community/langchain_community/tools/json/tool.py b/libs/community/langchain_community/tools/json/tool.pyindex c9957ae33a..6e7fddff6d 100644--- a/libs/community/langchain_community/tools/json/tool.py+++ b/libs/community/langchain_community/tools/json/tool.py@@ -82,7 +82,7 @@ class JsonSpec(BaseModel):return repr(e)-class JsonListKeysTool(BaseTool): # type: ignore[override]+class JsonListKeysTool(BaseTool):"""Tool for listing keys in a JSON spec."""name: str = "json_spec_list_keys"@@ -108,7 +108,7 @@ class JsonListKeysTool(BaseTool): # type: ignore[override]return self._run(tool_input)-class JsonGetValueTool(BaseTool): # type: ignore[override]+class JsonGetValueTool(BaseTool):"""Tool for getting a value in a JSON spec."""name: str = "json_spec_get_value"diff --git a/libs/community/langchain_community/tools/memorize/tool.py b/libs/community/langchain_community/tools/memorize/tool.pyindex fe1ec52ac4..87badf9ac3 100644--- a/libs/community/langchain_community/tools/memorize/tool.py+++ b/libs/community/langchain_community/tools/memorize/tool.py@@ -30,7 +30,7 @@ class TrainableLLM(Protocol):) -> TrainResult: ...-class Memorize(BaseTool): # type: ignore[override]+class Memorize(BaseTool):"""Tool that trains a language model."""name: str = "memorize"diff --git a/libs/community/langchain_community/tools/merriam_webster/tool.py b/libs/community/langchain_community/tools/merriam_webster/tool.pyindex b6f9209477..9cf4e9f21c 100644--- a/libs/community/langchain_community/tools/merriam_webster/tool.py+++ b/libs/community/langchain_community/tools/merriam_webster/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.merriam_webster import MerriamWebsterAPIWrapper-class MerriamWebsterQueryRun(BaseTool): # type: ignore[override]+class MerriamWebsterQueryRun(BaseTool):"""Tool that searches the Merriam-Webster API."""name: str = "merriam_webster"diff --git a/libs/community/langchain_community/tools/metaphor_search/tool.py b/libs/community/langchain_community/tools/metaphor_search/tool.pyindex 03af3636ba..98e932e8d2 100644--- a/libs/community/langchain_community/tools/metaphor_search/tool.py+++ b/libs/community/langchain_community/tools/metaphor_search/tool.py@@ -17,7 +17,7 @@ from langchain_community.utilities.metaphor_search import MetaphorSearchAPIWrappremoval="1.0",alternative="langchain_exa.ExaSearchResults",)-class MetaphorSearchResults(BaseTool): # type: ignore[override]+class MetaphorSearchResults(BaseTool):"""Tool that queries the Metaphor Search API and gets back json."""name: str = "metaphor_search_results_json"diff --git a/libs/community/langchain_community/tools/mojeek_search/tool.py b/libs/community/langchain_community/tools/mojeek_search/tool.pyindex 8172475cb3..9112e1afe6 100644--- a/libs/community/langchain_community/tools/mojeek_search/tool.py+++ b/libs/community/langchain_community/tools/mojeek_search/tool.py@@ -11,7 +11,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.mojeek_search import MojeekSearchAPIWrapper-class MojeekSearch(BaseTool): # type: ignore[override]+class MojeekSearch(BaseTool):name: str = "mojeek_search"description: str = ("A wrapper around Mojeek Search. "diff --git a/libs/community/langchain_community/tools/multion/close_session.py b/libs/community/langchain_community/tools/multion/close_session.pyindex 03a777f00c..28f0abd013 100644--- a/libs/community/langchain_community/tools/multion/close_session.py+++ b/libs/community/langchain_community/tools/multion/close_session.py@@ -27,7 +27,7 @@ class CloseSessionSchema(BaseModel):)-class MultionCloseSession(BaseTool): # type: ignore[override, override]+class MultionCloseSession(BaseTool):"""Tool that closes an existing Multion Browser Window with provided fields.Attributes:diff --git a/libs/community/langchain_community/tools/multion/create_session.py b/libs/community/langchain_community/tools/multion/create_session.pyindex 3feb83815d..53388a5a97 100644--- a/libs/community/langchain_community/tools/multion/create_session.py+++ b/libs/community/langchain_community/tools/multion/create_session.py@@ -31,7 +31,7 @@ class CreateSessionSchema(BaseModel):)-class MultionCreateSession(BaseTool): # type: ignore[override]+class MultionCreateSession(BaseTool):"""Tool that creates a new Multion Browser Window with provided fields.Attributes:diff --git a/libs/community/langchain_community/tools/multion/update_session.py b/libs/community/langchain_community/tools/multion/update_session.pyindex 4a2abddd35..b535861e2a 100644--- a/libs/community/langchain_community/tools/multion/update_session.py+++ b/libs/community/langchain_community/tools/multion/update_session.py@@ -36,7 +36,7 @@ class UpdateSessionSchema(BaseModel):)-class MultionUpdateSession(BaseTool): # type: ignore[override, override]+class MultionUpdateSession(BaseTool):"""Tool that updates an existing Multion Browser Window with provided fields.Attributes:diff --git a/libs/community/langchain_community/tools/nasa/tool.py b/libs/community/langchain_community/tools/nasa/tool.pyindex ee2c5f2a10..b9f2caa455 100644--- a/libs/community/langchain_community/tools/nasa/tool.py+++ b/libs/community/langchain_community/tools/nasa/tool.py@@ -12,7 +12,7 @@ from pydantic import Fieldfrom langchain_community.utilities.nasa import NasaAPIWrapper-class NasaAction(BaseTool): # type: ignore[override]+class NasaAction(BaseTool):"""Tool that queries the Atlassian Jira API."""api_wrapper: NasaAPIWrapper = Field(default_factory=NasaAPIWrapper)diff --git a/libs/community/langchain_community/tools/nuclia/tool.py b/libs/community/langchain_community/tools/nuclia/tool.pyindex e5d4e44752..8aeed0feb3 100644--- a/libs/community/langchain_community/tools/nuclia/tool.py+++ b/libs/community/langchain_community/tools/nuclia/tool.py@@ -54,7 +54,7 @@ class NUASchema(BaseModel):)-class NucliaUnderstandingAPI(BaseTool): # type: ignore[override, override]+class NucliaUnderstandingAPI(BaseTool):"""Tool to process files with the Nuclia Understanding API."""name: str = "nuclia_understanding_api"@@ -75,7 +75,7 @@ class NucliaUnderstandingAPI(BaseTool): # type: ignore[override, override]else:self._config["NUA_KEY"] = keyself._config["enable_ml"] = enable_ml- super().__init__() # type: ignore[call-arg]+ super().__init__()def _run(self,diff --git a/libs/community/langchain_community/tools/office365/base.py b/libs/community/langchain_community/tools/office365/base.pyindex a1d13cca38..55160bd5e5 100644--- a/libs/community/langchain_community/tools/office365/base.py+++ b/libs/community/langchain_community/tools/office365/base.py@@ -13,7 +13,7 @@ if TYPE_CHECKING:from O365 import Account-class O365BaseTool(BaseTool): # type: ignore[override]+class O365BaseTool(BaseTool):"""Base class for the Office 365 tools."""account: Account = Field(default_factory=authenticate)diff --git a/libs/community/langchain_community/tools/office365/create_draft_message.py b/libs/community/langchain_community/tools/office365/create_draft_message.pyindex 0abac1ab29..02915ffedc 100644--- a/libs/community/langchain_community/tools/office365/create_draft_message.py+++ b/libs/community/langchain_community/tools/office365/create_draft_message.py@@ -31,7 +31,7 @@ class CreateDraftMessageSchema(BaseModel):)-class O365CreateDraftMessage(O365BaseTool): # type: ignore[override, override]+class O365CreateDraftMessage(O365BaseTool):"""Tool for creating a draft email in Office 365."""name: str = "create_email_draft"diff --git a/libs/community/langchain_community/tools/office365/events_search.py b/libs/community/langchain_community/tools/office365/events_search.pyindex 9615b27e8b..f23dd86b08 100644--- a/libs/community/langchain_community/tools/office365/events_search.py+++ b/libs/community/langchain_community/tools/office365/events_search.py@@ -53,7 +53,7 @@ class SearchEventsInput(BaseModel):)-class O365SearchEvents(O365BaseTool): # type: ignore[override, override]+class O365SearchEvents(O365BaseTool):"""Search calendar events in Office 365.Free, but setup is requireddiff --git a/libs/community/langchain_community/tools/office365/messages_search.py b/libs/community/langchain_community/tools/office365/messages_search.pyindex 07178c5f1e..71fe2562bb 100644--- a/libs/community/langchain_community/tools/office365/messages_search.py+++ b/libs/community/langchain_community/tools/office365/messages_search.py@@ -52,7 +52,7 @@ class SearchEmailsInput(BaseModel):)-class O365SearchEmails(O365BaseTool): # type: ignore[override, override]+class O365SearchEmails(O365BaseTool):"""Search email messages in Office 365.Free, but setup is required.diff --git a/libs/community/langchain_community/tools/office365/send_event.py b/libs/community/langchain_community/tools/office365/send_event.pyindex 052fc19c0e..2ab140ca46 100644--- a/libs/community/langchain_community/tools/office365/send_event.py+++ b/libs/community/langchain_community/tools/office365/send_event.py@@ -48,7 +48,7 @@ class SendEventSchema(BaseModel):)-class O365SendEvent(O365BaseTool): # type: ignore[override, override]+class O365SendEvent(O365BaseTool):"""Tool for sending calendar events in Office 365."""name: str = "send_event"diff --git a/libs/community/langchain_community/tools/office365/send_message.py b/libs/community/langchain_community/tools/office365/send_message.pyindex c7e180e9b7..6ebc888371 100644--- a/libs/community/langchain_community/tools/office365/send_message.py+++ b/libs/community/langchain_community/tools/office365/send_message.py@@ -31,7 +31,7 @@ class SendMessageSchema(BaseModel):)-class O365SendMessage(O365BaseTool): # type: ignore[override, override]+class O365SendMessage(O365BaseTool):"""Send an email in Office 365."""name: str = "send_email"diff --git a/libs/community/langchain_community/tools/openai_dalle_image_generation/tool.py b/libs/community/langchain_community/tools/openai_dalle_image_generation/tool.pyindex 6d0583b6f9..36374e887f 100644--- a/libs/community/langchain_community/tools/openai_dalle_image_generation/tool.py+++ b/libs/community/langchain_community/tools/openai_dalle_image_generation/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.dalle_image_generator import DallEAPIWrapper-class OpenAIDALLEImageGenerationTool(BaseTool): # type: ignore[override]+class OpenAIDALLEImageGenerationTool(BaseTool):"""Tool that generates an image using OpenAI DALLE."""name: str = "openai_dalle"diff --git a/libs/community/langchain_community/tools/openweathermap/tool.py b/libs/community/langchain_community/tools/openweathermap/tool.pyindex cbeb552da2..f88095d3ef 100644--- a/libs/community/langchain_community/tools/openweathermap/tool.py+++ b/libs/community/langchain_community/tools/openweathermap/tool.py@@ -9,11 +9,11 @@ from pydantic import Fieldfrom langchain_community.utilities.openweathermap import OpenWeatherMapAPIWrapper-class OpenWeatherMapQueryRun(BaseTool): # type: ignore[override]+class OpenWeatherMapQueryRun(BaseTool):"""Tool that queries the OpenWeatherMap API."""api_wrapper: OpenWeatherMapAPIWrapper = Field(- default_factory=OpenWeatherMapAPIWrapper # type: ignore[arg-type]+ default_factory=OpenWeatherMapAPIWrapper)name: str = "open_weather_map"diff --git a/libs/community/langchain_community/tools/passio_nutrition_ai/tool.py b/libs/community/langchain_community/tools/passio_nutrition_ai/tool.pyindex 464caf6f9a..939e1a41bc 100644--- a/libs/community/langchain_community/tools/passio_nutrition_ai/tool.py+++ b/libs/community/langchain_community/tools/passio_nutrition_ai/tool.py@@ -17,7 +17,7 @@ class NutritionAIInputs(BaseModel):)-class NutritionAI(BaseTool): # type: ignore[override, override]+class NutritionAI(BaseTool):"""Tool that queries the Passio Nutrition AI API."""name: str = "nutritionai_advanced_search"diff --git a/libs/community/langchain_community/tools/playwright/base.py b/libs/community/langchain_community/tools/playwright/base.pyindex efed3bc8de..e85cc84793 100644--- a/libs/community/langchain_community/tools/playwright/base.py+++ b/libs/community/langchain_community/tools/playwright/base.py@@ -32,7 +32,7 @@ def lazy_import_playwright_browsers() -> Tuple[Type[AsyncBrowser], Type[SyncBrow)-class BaseBrowserTool(BaseTool): # type: ignore[override]+class BaseBrowserTool(BaseTool):"""Base class for browser tools."""sync_browser: Optional["SyncBrowser"] = Nonediff --git a/libs/community/langchain_community/tools/playwright/click.py b/libs/community/langchain_community/tools/playwright/click.pyindex 07490e45fb..22c6a23bf9 100644--- a/libs/community/langchain_community/tools/playwright/click.py+++ b/libs/community/langchain_community/tools/playwright/click.py@@ -21,7 +21,7 @@ class ClickToolInput(BaseModel):selector: str = Field(..., description="CSS selector for the element to click")-class ClickTool(BaseBrowserTool): # type: ignore[override, override, override]+class ClickTool(BaseBrowserTool):"""Tool for clicking on an element with the given CSS selector."""name: str = "click_element"diff --git a/libs/community/langchain_community/tools/playwright/current_page.py b/libs/community/langchain_community/tools/playwright/current_page.pyindex 861b2eca53..207cac4b70 100644--- a/libs/community/langchain_community/tools/playwright/current_page.py+++ b/libs/community/langchain_community/tools/playwright/current_page.py@@ -19,7 +19,7 @@ class CurrentWebPageToolInput(BaseModel):"""Explicit no-args input for CurrentWebPageTool."""-class CurrentWebPageTool(BaseBrowserTool): # type: ignore[override, override]+class CurrentWebPageTool(BaseBrowserTool):"""Tool for getting the URL of the current webpage."""name: str = "current_webpage"diff --git a/libs/community/langchain_community/tools/playwright/extract_hyperlinks.py b/libs/community/langchain_community/tools/playwright/extract_hyperlinks.pyindex 18c2a1180b..00a5e29027 100644--- a/libs/community/langchain_community/tools/playwright/extract_hyperlinks.py+++ b/libs/community/langchain_community/tools/playwright/extract_hyperlinks.py@@ -28,7 +28,7 @@ class ExtractHyperlinksToolInput(BaseModel):)-class ExtractHyperlinksTool(BaseBrowserTool): # type: ignore[override, override]+class ExtractHyperlinksTool(BaseBrowserTool):"""Extract all hyperlinks on the page."""name: str = "extract_hyperlinks"diff --git a/libs/community/langchain_community/tools/playwright/extract_text.py b/libs/community/langchain_community/tools/playwright/extract_text.pyindex 98774f7355..7c9ce7f8e1 100644--- a/libs/community/langchain_community/tools/playwright/extract_text.py+++ b/libs/community/langchain_community/tools/playwright/extract_text.py@@ -19,7 +19,7 @@ class ExtractTextToolInput(BaseModel):"""Explicit no-args input for ExtractTextTool."""-class ExtractTextTool(BaseBrowserTool): # type: ignore[override, override]+class ExtractTextTool(BaseBrowserTool):"""Tool for extracting all the text on the current webpage."""name: str = "extract_text"diff --git a/libs/community/langchain_community/tools/playwright/get_elements.py b/libs/community/langchain_community/tools/playwright/get_elements.pyindex 9708dcb390..11e43c0169 100644--- a/libs/community/langchain_community/tools/playwright/get_elements.py+++ b/libs/community/langchain_community/tools/playwright/get_elements.py@@ -73,7 +73,7 @@ def _get_elements(return results-class GetElementsTool(BaseBrowserTool): # type: ignore[override, override]+class GetElementsTool(BaseBrowserTool):"""Tool for getting elements in the current web page matching a CSS selector."""name: str = "get_elements"diff --git a/libs/community/langchain_community/tools/playwright/navigate.py b/libs/community/langchain_community/tools/playwright/navigate.pyindex 0cd7658598..2bfe2be4fd 100644--- a/libs/community/langchain_community/tools/playwright/navigate.py+++ b/libs/community/langchain_community/tools/playwright/navigate.py@@ -32,7 +32,7 @@ class NavigateToolInput(BaseModel):return values-class NavigateTool(BaseBrowserTool): # type: ignore[override, override]+class NavigateTool(BaseBrowserTool):"""Tool for navigating a browser to a URL.**Security Note**: This tool provides code to control web-browser navigation.diff --git a/libs/community/langchain_community/tools/playwright/navigate_back.py b/libs/community/langchain_community/tools/playwright/navigate_back.pyindex 2a2eff3890..45fa250cb4 100644--- a/libs/community/langchain_community/tools/playwright/navigate_back.py+++ b/libs/community/langchain_community/tools/playwright/navigate_back.py@@ -19,7 +19,7 @@ class NavigateBackToolInput(BaseModel):"""Explicit no-args input for NavigateBackTool."""-class NavigateBackTool(BaseBrowserTool): # type: ignore[override, override]+class NavigateBackTool(BaseBrowserTool):"""Navigate back to the previous page in the browser history."""name: str = "previous_webpage"diff --git a/libs/community/langchain_community/tools/plugin.py b/libs/community/langchain_community/tools/plugin.pyindex 440ea8d0ae..102451e72d 100644--- a/libs/community/langchain_community/tools/plugin.py+++ b/libs/community/langchain_community/tools/plugin.py@@ -63,7 +63,7 @@ class AIPluginToolSchema(BaseModel):tool_input: Optional[str] = ""-class AIPluginTool(BaseTool): # type: ignore[override, override]+class AIPluginTool(BaseTool):"""Tool for getting the OpenAPI spec for an AI Plugin."""plugin: AIPlugindiff --git a/libs/community/langchain_community/tools/polygon/aggregates.py b/libs/community/langchain_community/tools/polygon/aggregates.pyindex 74f0b85f5f..26cb62d467 100644--- a/libs/community/langchain_community/tools/polygon/aggregates.py+++ b/libs/community/langchain_community/tools/polygon/aggregates.py@@ -39,7 +39,7 @@ class PolygonAggregatesSchema(BaseModel):)-class PolygonAggregates(BaseTool): # type: ignore[override, override]+class PolygonAggregates(BaseTool):"""Tool that gets aggregate bars (stock prices) over agiven date range for a given ticker from Polygon.diff --git a/libs/community/langchain_community/tools/polygon/financials.py b/libs/community/langchain_community/tools/polygon/financials.pyindex bf044a5f89..8400e7498b 100644--- a/libs/community/langchain_community/tools/polygon/financials.py+++ b/libs/community/langchain_community/tools/polygon/financials.py@@ -13,7 +13,7 @@ class Inputs(BaseModel):query: str-class PolygonFinancials(BaseTool): # type: ignore[override, override]+class PolygonFinancials(BaseTool):"""Tool that gets the financials of a ticker from Polygon"""mode: str = "get_financials"diff --git a/libs/community/langchain_community/tools/polygon/last_quote.py b/libs/community/langchain_community/tools/polygon/last_quote.pyindex 2b9816683c..76c768113b 100644--- a/libs/community/langchain_community/tools/polygon/last_quote.py+++ b/libs/community/langchain_community/tools/polygon/last_quote.py@@ -13,7 +13,7 @@ class Inputs(BaseModel):query: str-class PolygonLastQuote(BaseTool): # type: ignore[override, override]+class PolygonLastQuote(BaseTool):"""Tool that gets the last quote of a ticker from Polygon"""mode: str = "get_last_quote"diff --git a/libs/community/langchain_community/tools/polygon/ticker_news.py b/libs/community/langchain_community/tools/polygon/ticker_news.pyindex 4a602d54ac..d4c4a2017a 100644--- a/libs/community/langchain_community/tools/polygon/ticker_news.py+++ b/libs/community/langchain_community/tools/polygon/ticker_news.py@@ -13,7 +13,7 @@ class Inputs(BaseModel):query: str-class PolygonTickerNews(BaseTool): # type: ignore[override, override]+class PolygonTickerNews(BaseTool):"""Tool that gets the latest news for a given ticker from Polygon"""mode: str = "get_ticker_news"diff --git a/libs/community/langchain_community/tools/powerbi/tool.py b/libs/community/langchain_community/tools/powerbi/tool.pyindex cf930b3baf..c5ec51e5b5 100644--- a/libs/community/langchain_community/tools/powerbi/tool.py+++ b/libs/community/langchain_community/tools/powerbi/tool.py@@ -22,7 +22,7 @@ from langchain_community.utilities.powerbi import PowerBIDataset, json_to_mdlogger = logging.getLogger(__name__)-class QueryPowerBITool(BaseTool): # type: ignore[override]+class QueryPowerBITool(BaseTool):"""Tool for querying a Power BI Dataset."""name: str = "query_powerbi"@@ -216,7 +216,7 @@ class QueryPowerBITool(BaseTool): # type: ignore[override]return False, 0-class InfoPowerBITool(BaseTool): # type: ignore[override]+class InfoPowerBITool(BaseTool):"""Tool for getting metadata about a PowerBI Dataset."""name: str = "schema_powerbi"@@ -248,7 +248,7 @@ class InfoPowerBITool(BaseTool): # type: ignore[override]return await self.powerbi.aget_table_info(tool_input.split(", "))-class ListPowerBITool(BaseTool): # type: ignore[override]+class ListPowerBITool(BaseTool):"""Tool for getting tables names."""name: str = "list_tables_powerbi"diff --git a/libs/community/langchain_community/tools/pubmed/tool.py b/libs/community/langchain_community/tools/pubmed/tool.pyindex 543c02a33b..fe83386354 100644--- a/libs/community/langchain_community/tools/pubmed/tool.py+++ b/libs/community/langchain_community/tools/pubmed/tool.py@@ -7,7 +7,7 @@ from pydantic import Fieldfrom langchain_community.utilities.pubmed import PubMedAPIWrapper-class PubmedQueryRun(BaseTool): # type: ignore[override]+class PubmedQueryRun(BaseTool):"""Tool that searches the PubMed API."""name: str = "pub_med"diff --git a/libs/community/langchain_community/tools/reddit_search/tool.py b/libs/community/langchain_community/tools/reddit_search/tool.pyindex 9a9ce882bb..fc823c2b23 100644--- a/libs/community/langchain_community/tools/reddit_search/tool.py+++ b/libs/community/langchain_community/tools/reddit_search/tool.py@@ -34,7 +34,7 @@ class RedditSearchSchema(BaseModel):)-class RedditSearchRun(BaseTool): # type: ignore[override, override]+class RedditSearchRun(BaseTool):"""Tool that queries for posts on a subreddit."""name: str = "reddit_search"diff --git a/libs/community/langchain_community/tools/requests/tool.py b/libs/community/langchain_community/tools/requests/tool.pyindex bdfd63ddcc..c91b348053 100644--- a/libs/community/langchain_community/tools/requests/tool.py+++ b/libs/community/langchain_community/tools/requests/tool.py@@ -47,7 +47,7 @@ class BaseRequestsTool(BaseModel):super().__init__(**kwargs)-class RequestsGetTool(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsGetTool(BaseRequestsTool, BaseTool):"""Tool for making a GET request to an API endpoint."""name: str = "requests_get"@@ -71,7 +71,7 @@ class RequestsGetTool(BaseRequestsTool, BaseTool): # type: ignore[override]return await self.requests_wrapper.aget(_clean_url(url))-class RequestsPostTool(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsPostTool(BaseRequestsTool, BaseTool):"""Tool for making a POST request to an API endpoint."""name: str = "requests_post"@@ -108,7 +108,7 @@ class RequestsPostTool(BaseRequestsTool, BaseTool): # type: ignore[override]return repr(e)-class RequestsPatchTool(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsPatchTool(BaseRequestsTool, BaseTool):"""Tool for making a PATCH request to an API endpoint."""name: str = "requests_patch"@@ -145,7 +145,7 @@ class RequestsPatchTool(BaseRequestsTool, BaseTool): # type: ignore[override]return repr(e)-class RequestsPutTool(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsPutTool(BaseRequestsTool, BaseTool):"""Tool for making a PUT request to an API endpoint."""name: str = "requests_put"@@ -182,7 +182,7 @@ class RequestsPutTool(BaseRequestsTool, BaseTool): # type: ignore[override]return repr(e)-class RequestsDeleteTool(BaseRequestsTool, BaseTool): # type: ignore[override]+class RequestsDeleteTool(BaseRequestsTool, BaseTool):"""Tool for making a DELETE request to an API endpoint."""name: str = "requests_delete"diff --git a/libs/community/langchain_community/tools/riza/command.py b/libs/community/langchain_community/tools/riza/command.pyindex 0fb3498dd8..37ef0446ad 100644--- a/libs/community/langchain_community/tools/riza/command.py+++ b/libs/community/langchain_community/tools/riza/command.py@@ -18,7 +18,7 @@ class ExecPythonInput(BaseModel):code: str = Field(description="the Python code to execute")-class ExecPython(BaseTool): # type: ignore[override, override]+class ExecPython(BaseTool):"""Riza Code tool.Setup:@@ -100,7 +100,7 @@ class ExecJavaScriptInput(BaseModel):code: str = Field(description="the JavaScript code to execute")-class ExecJavaScript(BaseTool): # type: ignore[override, override]+class ExecJavaScript(BaseTool):"""A tool implementation to execute JavaScript via Riza's Code Interpreter API."""name: str = "riza_exec_javascript"diff --git a/libs/community/langchain_community/tools/scenexplain/tool.py b/libs/community/langchain_community/tools/scenexplain/tool.pyindex fb3914470d..2a7bb7c03e 100644--- a/libs/community/langchain_community/tools/scenexplain/tool.py+++ b/libs/community/langchain_community/tools/scenexplain/tool.py@@ -15,7 +15,7 @@ class SceneXplainInput(BaseModel):query: str = Field(..., description="The link to the image to explain")-class SceneXplainTool(BaseTool): # type: ignore[override]+class SceneXplainTool(BaseTool):"""Tool that explains images."""name: str = "image_explainer"@@ -24,7 +24,7 @@ class SceneXplainTool(BaseTool): # type: ignore[override]"for an image. The input can be an image file of any format, and ""the output will be a text description that covers every detail of the image.")- api_wrapper: SceneXplainAPIWrapper = Field(default_factory=SceneXplainAPIWrapper) # type: ignore[arg-type]+ api_wrapper: SceneXplainAPIWrapper = Field(default_factory=SceneXplainAPIWrapper)def _run(self, query: str, run_manager: Optional[CallbackManagerForToolRun] = Nonediff --git a/libs/community/langchain_community/tools/searchapi/tool.py b/libs/community/langchain_community/tools/searchapi/tool.pyindex 8b92679bf6..205d59880d 100644--- a/libs/community/langchain_community/tools/searchapi/tool.py+++ b/libs/community/langchain_community/tools/searchapi/tool.py@@ -12,7 +12,7 @@ from pydantic import Fieldfrom langchain_community.utilities.searchapi import SearchApiAPIWrapper-class SearchAPIRun(BaseTool): # type: ignore[override]+class SearchAPIRun(BaseTool):"""Tool that queries the SearchApi.io search API."""name: str = "searchapi"@@ -40,7 +40,7 @@ class SearchAPIRun(BaseTool): # type: ignore[override]return await self.api_wrapper.arun(query)-class SearchAPIResults(BaseTool): # type: ignore[override]+class SearchAPIResults(BaseTool):"""Tool that queries the SearchApi.io search API and returns JSON."""name: str = "searchapi_results_json"diff --git a/libs/community/langchain_community/tools/searx_search/tool.py b/libs/community/langchain_community/tools/searx_search/tool.pyindex 3f752785ae..d16739e88f 100644--- a/libs/community/langchain_community/tools/searx_search/tool.py+++ b/libs/community/langchain_community/tools/searx_search/tool.py@@ -18,7 +18,7 @@ class SearxSearchQueryInput(BaseModel):query: str = Field(description="query to look up on searx")-class SearxSearchRun(BaseTool): # type: ignore[override, override]+class SearxSearchRun(BaseTool):"""Tool that queries a Searx instance."""name: str = "searx_search"@@ -48,7 +48,7 @@ class SearxSearchRun(BaseTool): # type: ignore[override, override]return await self.wrapper.arun(query, **self.kwargs)-class SearxSearchResults(BaseTool): # type: ignore[override, override]+class SearxSearchResults(BaseTool):"""Tool that queries a Searx instance and gets back json."""name: str = "searx_search_results"diff --git a/libs/community/langchain_community/tools/semanticscholar/tool.py b/libs/community/langchain_community/tools/semanticscholar/tool.pyindex b5999eb22d..ce53fa4bab 100644--- a/libs/community/langchain_community/tools/semanticscholar/tool.py+++ b/libs/community/langchain_community/tools/semanticscholar/tool.py@@ -15,7 +15,7 @@ class SemantscholarInput(BaseModel):query: str = Field(description="search query to look up")-class SemanticScholarQueryRun(BaseTool): # type: ignore[override, override]+class SemanticScholarQueryRun(BaseTool):"""Tool that searches the semanticscholar API."""name: str = "semanticscholar"diff --git a/libs/community/langchain_community/tools/shell/tool.py b/libs/community/langchain_community/tools/shell/tool.pyindex 75481536df..c4ff4d1b60 100644--- a/libs/community/langchain_community/tools/shell/tool.py+++ b/libs/community/langchain_community/tools/shell/tool.py@@ -57,7 +57,7 @@ def _get_platform() -> str:return system-class ShellTool(BaseTool): # type: ignore[override, override]+class ShellTool(BaseTool):"""Tool to run shell commands."""process: Any = Field(default_factory=_get_default_bash_process)diff --git a/libs/community/langchain_community/tools/slack/base.py b/libs/community/langchain_community/tools/slack/base.pyindex 38eb8f7d3f..4d2fc5baca 100644--- a/libs/community/langchain_community/tools/slack/base.py+++ b/libs/community/langchain_community/tools/slack/base.py@@ -20,7 +20,7 @@ else:pass-class SlackBaseTool(BaseTool): # type: ignore[override]+class SlackBaseTool(BaseTool):"""Base class for Slack tools."""client: WebClient = Field(default_factory=login)diff --git a/libs/community/langchain_community/tools/slack/get_channel.py b/libs/community/langchain_community/tools/slack/get_channel.pyindex 60419b6676..4cee16a935 100644--- a/libs/community/langchain_community/tools/slack/get_channel.py+++ b/libs/community/langchain_community/tools/slack/get_channel.py@@ -7,7 +7,7 @@ from langchain_core.callbacks import CallbackManagerForToolRunfrom langchain_community.tools.slack.base import SlackBaseTool-class SlackGetChannel(SlackBaseTool): # type: ignore[override]+class SlackGetChannel(SlackBaseTool):"""Tool that gets Slack channel information."""name: str = "get_channelid_name_dict"diff --git a/libs/community/langchain_community/tools/slack/get_message.py b/libs/community/langchain_community/tools/slack/get_message.pyindex b756f3124c..733f16979e 100644--- a/libs/community/langchain_community/tools/slack/get_message.py+++ b/libs/community/langchain_community/tools/slack/get_message.py@@ -17,7 +17,7 @@ class SlackGetMessageSchema(BaseModel):)-class SlackGetMessage(SlackBaseTool): # type: ignore[override, override]+class SlackGetMessage(SlackBaseTool):"""Tool that gets Slack messages."""name: str = "get_messages"diff --git a/libs/community/langchain_community/tools/slack/schedule_message.py b/libs/community/langchain_community/tools/slack/schedule_message.pyindex 2e4e2c060e..c4a561f5aa 100644--- a/libs/community/langchain_community/tools/slack/schedule_message.py+++ b/libs/community/langchain_community/tools/slack/schedule_message.py@@ -33,7 +33,7 @@ class ScheduleMessageSchema(BaseModel):)-class SlackScheduleMessage(SlackBaseTool): # type: ignore[override, override]+class SlackScheduleMessage(SlackBaseTool):"""Tool for scheduling a message in Slack."""name: str = "schedule_message"diff --git a/libs/community/langchain_community/tools/slack/send_message.py b/libs/community/langchain_community/tools/slack/send_message.pyindex d56de48604..87223830d4 100644--- a/libs/community/langchain_community/tools/slack/send_message.py+++ b/libs/community/langchain_community/tools/slack/send_message.py@@ -19,7 +19,7 @@ class SendMessageSchema(BaseModel):)-class SlackSendMessage(SlackBaseTool): # type: ignore[override, override]+class SlackSendMessage(SlackBaseTool):"""Tool for sending a message in Slack."""name: str = "send_message"diff --git a/libs/community/langchain_community/tools/sleep/tool.py b/libs/community/langchain_community/tools/sleep/tool.pyindex f3c7060a52..e39a272a79 100644--- a/libs/community/langchain_community/tools/sleep/tool.py+++ b/libs/community/langchain_community/tools/sleep/tool.py@@ -18,7 +18,7 @@ class SleepInput(BaseModel):sleep_time: int = Field(..., description="Time to sleep in seconds")-class SleepTool(BaseTool): # type: ignore[override]+class SleepTool(BaseTool):"""Tool that adds the capability to sleep."""name: str = "sleep"diff --git a/libs/community/langchain_community/tools/spark_sql/tool.py b/libs/community/langchain_community/tools/spark_sql/tool.pyindex 421e507cd2..91bbc87f29 100644--- a/libs/community/langchain_community/tools/spark_sql/tool.py+++ b/libs/community/langchain_community/tools/spark_sql/tool.py@@ -26,7 +26,7 @@ class BaseSparkSQLTool(BaseModel):)-class QuerySparkSQLTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]+class QuerySparkSQLTool(BaseSparkSQLTool, BaseTool):"""Tool for querying a Spark SQL."""name: str = "query_sql_db"@@ -45,7 +45,7 @@ class QuerySparkSQLTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]return self.db.run_no_throw(query)-class InfoSparkSQLTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]+class InfoSparkSQLTool(BaseSparkSQLTool, BaseTool):"""Tool for getting metadata about a Spark SQL."""name: str = "schema_sql_db"@@ -65,7 +65,7 @@ class InfoSparkSQLTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]return self.db.get_table_info_no_throw(table_names.split(", "))-class ListSparkSQLTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]+class ListSparkSQLTool(BaseSparkSQLTool, BaseTool):"""Tool for getting tables names."""name: str = "list_tables_sql_db"@@ -80,7 +80,7 @@ class ListSparkSQLTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]return ", ".join(self.db.get_usable_table_names())-class QueryCheckerTool(BaseSparkSQLTool, BaseTool): # type: ignore[override]+class QueryCheckerTool(BaseSparkSQLTool, BaseTool):"""Use an LLM to check if a query is correct.Adapted from https://www.patterns.app/blog/2023/01/18/crunchbot-sql-analyst-gpt/"""diff --git a/libs/community/langchain_community/tools/sql_database/tool.py b/libs/community/langchain_community/tools/sql_database/tool.pyindex 8bbc595581..cc235f4de8 100644--- a/libs/community/langchain_community/tools/sql_database/tool.py+++ b/libs/community/langchain_community/tools/sql_database/tool.py@@ -33,7 +33,7 @@ class _QuerySQLDatabaseToolInput(BaseModel):query: str = Field(..., description="A detailed and correct SQL query.")-class QuerySQLDatabaseTool(BaseSQLDatabaseTool, BaseTool): # type: ignore[override, override]+class QuerySQLDatabaseTool(BaseSQLDatabaseTool, BaseTool):"""Tool for querying a SQL database... versionchanged:: 0.3.12@@ -64,7 +64,7 @@ class QuerySQLDatabaseTool(BaseSQLDatabaseTool, BaseTool): # type: ignore[overrremoval="1.0",alternative_import="langchain_community.tools.QuerySQLDatabaseTool",)-class QuerySQLDataBaseTool(QuerySQLDatabaseTool): # type: ignore[override]+class QuerySQLDataBaseTool(QuerySQLDatabaseTool):"""Equivalent stub to QuerySQLDatabaseTool for backwards compatibility.:private:"""@@ -82,7 +82,7 @@ class _InfoSQLDatabaseToolInput(BaseModel):)-class InfoSQLDatabaseTool(BaseSQLDatabaseTool, BaseTool): # type: ignore[override, override]+class InfoSQLDatabaseTool(BaseSQLDatabaseTool, BaseTool):"""Tool for getting metadata about a SQL database."""name: str = "sql_db_schema"@@ -104,7 +104,7 @@ class _ListSQLDatabaseToolInput(BaseModel):tool_input: str = Field("", description="An empty string")-class ListSQLDatabaseTool(BaseSQLDatabaseTool, BaseTool): # type: ignore[override, override]+class ListSQLDatabaseTool(BaseSQLDatabaseTool, BaseTool):"""Tool for getting tables names."""name: str = "sql_db_list_tables"@@ -124,7 +124,7 @@ class _QuerySQLCheckerToolInput(BaseModel):query: str = Field(..., description="A detailed and SQL query to be checked.")-class QuerySQLCheckerTool(BaseSQLDatabaseTool, BaseTool): # type: ignore[override, override]+class QuerySQLCheckerTool(BaseSQLDatabaseTool, BaseTool):"""Use an LLM to check if a query is correct.Adapted from https://www.patterns.app/blog/2023/01/18/crunchbot-sql-analyst-gpt/"""diff --git a/libs/community/langchain_community/tools/stackexchange/tool.py b/libs/community/langchain_community/tools/stackexchange/tool.pyindex fe4a48bd1e..2060eada6e 100644--- a/libs/community/langchain_community/tools/stackexchange/tool.py+++ b/libs/community/langchain_community/tools/stackexchange/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.stackexchange import StackExchangeAPIWrapper-class StackExchangeTool(BaseTool): # type: ignore[override]+class StackExchangeTool(BaseTool):"""Tool that uses StackExchange"""name: str = "stack_exchange"diff --git a/libs/community/langchain_community/tools/steam/tool.py b/libs/community/langchain_community/tools/steam/tool.pyindex f03f0c26fb..3e71dddc0b 100644--- a/libs/community/langchain_community/tools/steam/tool.py+++ b/libs/community/langchain_community/tools/steam/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.steam import SteamWebAPIWrapper-class SteamWebAPIQueryRun(BaseTool): # type: ignore[override]+class SteamWebAPIQueryRun(BaseTool):"""Tool that searches the Steam Web API."""mode: strdiff --git a/libs/community/langchain_community/tools/steamship_image_generation/tool.py b/libs/community/langchain_community/tools/steamship_image_generation/tool.pyindex ce219236d5..ea1c4b6860 100644--- a/libs/community/langchain_community/tools/steamship_image_generation/tool.py+++ b/libs/community/langchain_community/tools/steamship_image_generation/tool.py@@ -41,7 +41,7 @@ SUPPORTED_IMAGE_SIZES = {}-class SteamshipImageGenerationTool(BaseTool): # type: ignore[override]+class SteamshipImageGenerationTool(BaseTool):"""Tool used to generate images from a text-prompt."""model_name: ModelNamediff --git a/libs/community/langchain_community/tools/tavily_search/tool.py b/libs/community/langchain_community/tools/tavily_search/tool.pyindex 32cd21d419..2e258e22d5 100644--- a/libs/community/langchain_community/tools/tavily_search/tool.py+++ b/libs/community/langchain_community/tools/tavily_search/tool.py@@ -18,7 +18,7 @@ class TavilyInput(BaseModel):query: str = Field(description="search query to look up")-class TavilySearchResults(BaseTool): # type: ignore[override, override]+class TavilySearchResults(BaseTool):"""Tool that queries the Tavily Search API and gets back json.Setup:@@ -202,7 +202,7 @@ class TavilySearchResults(BaseTool): # type: ignore[override, override]return self.api_wrapper.clean_results(raw_results["results"]), raw_results-class TavilyAnswer(BaseTool): # type: ignore[override, override]+class TavilyAnswer(BaseTool):"""Tool that queries the Tavily Search API and gets back an answer."""name: str = "tavily_answer"diff --git a/libs/community/langchain_community/tools/vectorstore/tool.py b/libs/community/langchain_community/tools/vectorstore/tool.pyindex 269d00ac48..e2479929df 100644--- a/libs/community/langchain_community/tools/vectorstore/tool.py+++ b/libs/community/langchain_community/tools/vectorstore/tool.py@@ -31,7 +31,7 @@ def _create_description_from_template(values: Dict[str, Any]) -> Dict[str, Any]:return values-class VectorStoreQATool(BaseVectorStoreTool, BaseTool): # type: ignore[override]+class VectorStoreQATool(BaseVectorStoreTool, BaseTool):"""Tool for the VectorDBQA chain. To be initialized with name and chain."""@staticmethod@@ -79,7 +79,7 @@ class VectorStoreQATool(BaseVectorStoreTool, BaseTool): # type: ignore[override)[chain.output_key]-class VectorStoreQAWithSourcesTool(BaseVectorStoreTool, BaseTool): # type: ignore[override]+class VectorStoreQAWithSourcesTool(BaseVectorStoreTool, BaseTool):"""Tool for the VectorDBQAWithSources chain."""@staticmethoddiff --git a/libs/community/langchain_community/tools/wikidata/tool.py b/libs/community/langchain_community/tools/wikidata/tool.pyindex eb2ad9a06f..c34096cf01 100644--- a/libs/community/langchain_community/tools/wikidata/tool.py+++ b/libs/community/langchain_community/tools/wikidata/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.wikidata import WikidataAPIWrapper-class WikidataQueryRun(BaseTool): # type: ignore[override]+class WikidataQueryRun(BaseTool):"""Tool that searches the Wikidata API."""name: str = "Wikidata"diff --git a/libs/community/langchain_community/tools/wikipedia/tool.py b/libs/community/langchain_community/tools/wikipedia/tool.pyindex 5d4f6e3540..127117f89d 100644--- a/libs/community/langchain_community/tools/wikipedia/tool.py+++ b/libs/community/langchain_community/tools/wikipedia/tool.py@@ -15,7 +15,7 @@ class WikipediaQueryInput(BaseModel):query: str = Field(description="query to look up on wikipedia")-class WikipediaQueryRun(BaseTool): # type: ignore[override, override]+class WikipediaQueryRun(BaseTool):"""Tool that searches the Wikipedia API."""name: str = "wikipedia"diff --git a/libs/community/langchain_community/tools/wolfram_alpha/tool.py b/libs/community/langchain_community/tools/wolfram_alpha/tool.pyindex cc5c8cf77d..e4364e669a 100644--- a/libs/community/langchain_community/tools/wolfram_alpha/tool.py+++ b/libs/community/langchain_community/tools/wolfram_alpha/tool.py@@ -8,7 +8,7 @@ from langchain_core.tools import BaseToolfrom langchain_community.utilities.wolfram_alpha import WolframAlphaAPIWrapper-class WolframAlphaQueryRun(BaseTool): # type: ignore[override]+class WolframAlphaQueryRun(BaseTool):"""Tool that queries using the Wolfram Alpha SDK."""name: str = "wolfram_alpha"diff --git a/libs/community/langchain_community/tools/yahoo_finance_news.py b/libs/community/langchain_community/tools/yahoo_finance_news.pyindex e8b8f648e0..7a9a49d2ef 100644--- a/libs/community/langchain_community/tools/yahoo_finance_news.py+++ b/libs/community/langchain_community/tools/yahoo_finance_news.py@@ -16,7 +16,7 @@ class YahooFinanceNewsInput(BaseModel):query: str = Field(description="company ticker query to look up")-class YahooFinanceNewsTool(BaseTool): # type: ignore[override, override]+class YahooFinanceNewsTool(BaseTool):"""Tool that searches financial news on Yahoo Finance."""name: str = "yahoo_finance_news"diff --git a/libs/community/langchain_community/tools/you/tool.py b/libs/community/langchain_community/tools/you/tool.pyindex 923ad41ebf..59990e71ff 100644--- a/libs/community/langchain_community/tools/you/tool.py+++ b/libs/community/langchain_community/tools/you/tool.py@@ -17,7 +17,7 @@ class YouInput(BaseModel):query: str = Field(description="should be a search query")-class YouSearchTool(BaseTool): # type: ignore[override, override]+class YouSearchTool(BaseTool):"""Tool that searches the you.com API."""name: str = "you_search"diff --git a/libs/community/langchain_community/tools/youtube/search.py b/libs/community/langchain_community/tools/youtube/search.pyindex cc68055b1b..497fa542ad 100644--- a/libs/community/langchain_community/tools/youtube/search.py+++ b/libs/community/langchain_community/tools/youtube/search.py@@ -16,7 +16,7 @@ from langchain_core.callbacks import CallbackManagerForToolRunfrom langchain_core.tools import BaseTool-class YouTubeSearchTool(BaseTool): # type: ignore[override]+class YouTubeSearchTool(BaseTool):"""Tool that queries YouTube."""name: str = "youtube_search"diff --git a/libs/community/langchain_community/tools/zapier/tool.py b/libs/community/langchain_community/tools/zapier/tool.pyindex 3d00392e75..8e2caa1742 100644--- a/libs/community/langchain_community/tools/zapier/tool.py+++ b/libs/community/langchain_community/tools/zapier/tool.py@@ -83,7 +83,7 @@ from langchain_community.tools.zapier.prompt import BASE_ZAPIER_TOOL_PROMPTfrom langchain_community.utilities.zapier import ZapierNLAWrapper-class ZapierNLARunAction(BaseTool): # type: ignore[override]+class ZapierNLARunAction(BaseTool):"""Tool to run a specific action from the user's exposed actions.Params:@@ -167,7 +167,7 @@ ZapierNLARunAction.__doc__ = ZapierNLAWrapper.run.__doc__ + ZapierNLARunAction._# other useful actions-class ZapierNLAListActions(BaseTool): # type: ignore[override]+class ZapierNLAListActions(BaseTool):"""Tool to list all exposed actions for the user."""name: str = "ZapierNLA_list_actions"diff --git a/libs/community/langchain_community/tools/zenguard/tool.py b/libs/community/langchain_community/tools/zenguard/tool.pyindex e54590079b..f577b07984 100644--- a/libs/community/langchain_community/tools/zenguard/tool.py+++ b/libs/community/langchain_community/tools/zenguard/tool.py@@ -44,7 +44,7 @@ class ZenGuardInput(BaseModel):)-class ZenGuardTool(BaseTool): # type: ignore[override, override]+class ZenGuardTool(BaseTool):name: str = "ZenGuard"description: str = ("ZenGuard AI integration package. ZenGuard AI - the fastest GenAI guardrails."diff --git a/libs/community/langchain_community/utilities/astradb.py b/libs/community/langchain_community/utilities/astradb.pyindex 72ba7ca9d4..20cc9556d9 100644--- a/libs/community/langchain_community/utilities/astradb.py+++ b/libs/community/langchain_community/utilities/astradb.py@@ -151,7 +151,7 @@ class _AstraDBCollectionEnvironment(_AstraDBEnvironment):)self.astra_db.create_collection(collection_name,- dimension=embedding_dimension, # type: ignore[arg-type]+ dimension=embedding_dimension,metric=metric,)diff --git a/libs/community/langchain_community/utilities/dalle_image_generator.py b/libs/community/langchain_community/utilities/dalle_image_generator.pyindex d95483bb4f..71d9df762d 100644--- a/libs/community/langchain_community/utilities/dalle_image_generator.py+++ b/libs/community/langchain_community/utilities/dalle_image_generator.py@@ -129,11 +129,11 @@ class DallEAPIWrapper(BaseModel):}if not self.client:- self.client = openai.OpenAI(**client_params).images # type: ignore[arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type]+ self.client = openai.OpenAI(**client_params).imagesif not self.async_client:- self.async_client = openai.AsyncOpenAI(**client_params).images # type: ignore[arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type, arg-type]+ self.async_client = openai.AsyncOpenAI(**client_params).imageselif not self.client:- self.client = openai.Image # type: ignore[attr-defined]+ self.client = openai.Imageelse:passreturn selfdiff --git a/libs/community/langchain_community/utilities/duckduckgo_search.py b/libs/community/langchain_community/utilities/duckduckgo_search.pyindex f277e62bae..ead6941aa9 100644--- a/libs/community/langchain_community/utilities/duckduckgo_search.py+++ b/libs/community/langchain_community/utilities/duckduckgo_search.py@@ -63,7 +63,7 @@ class DuckDuckGoSearchAPIWrapper(BaseModel):with DDGS() as ddgs:ddgs_gen = ddgs.text(query,- region=self.region, # type: ignore[arg-type]+ region=self.region,safesearch=self.safesearch,timelimit=self.time,max_results=max_results or self.max_results,@@ -82,7 +82,7 @@ class DuckDuckGoSearchAPIWrapper(BaseModel):with DDGS() as ddgs:ddgs_gen = ddgs.news(query,- region=self.region, # type: ignore[arg-type]+ region=self.region,safesearch=self.safesearch,timelimit=self.time,max_results=max_results or self.max_results,@@ -100,7 +100,7 @@ class DuckDuckGoSearchAPIWrapper(BaseModel):with DDGS() as ddgs:ddgs_gen = ddgs.images(query,- region=self.region, # type: ignore[arg-type]+ region=self.region,safesearch=self.safesearch,max_results=max_results or self.max_results,)diff --git a/libs/community/langchain_community/utilities/nvidia_riva.py b/libs/community/langchain_community/utilities/nvidia_riva.pyindex 74afba23d2..40a788a85f 100644--- a/libs/community/langchain_community/utilities/nvidia_riva.py+++ b/libs/community/langchain_community/utilities/nvidia_riva.py@@ -401,7 +401,7 @@ ASRInputType = AudioStreamASROutputType = str-class RivaASR( # type: ignore[override]+class RivaASR(RivaAuthMixin,RivaCommonConfigMixin,RunnableSerializable[ASRInputType, ASROutputType],@@ -509,7 +509,7 @@ TTSInputType = Union[str, AnyMessage, PromptValue]TTSOutputType = bytes-class RivaTTS( # type: ignore[override]+class RivaTTS(RivaAuthMixin,RivaCommonConfigMixin,RunnableSerializable[TTSInputType, TTSOutputType],diff --git a/libs/community/langchain_community/utilities/zapier.py b/libs/community/langchain_community/utilities/zapier.pyindex 56e5dc5dda..37d5aa83c9 100644--- a/libs/community/langchain_community/utilities/zapier.py+++ b/libs/community/langchain_community/utilities/zapier.py@@ -285,13 +285,13 @@ class ZapierNLAWrapper(BaseModel):data = await self.apreview(*args, **kwargs)return json.dumps(data)- def list_as_str(self) -> str: # type: ignore[no-untyped-def]+ def list_as_str(self) -> str:"""Same as list, but returns a stringified version of the JSON forinsertting back into an LLM."""actions = self.list()return json.dumps(actions)- async def alist_as_str(self) -> str: # type: ignore[no-untyped-def]+ async def alist_as_str(self) -> str:"""Same as list, but returns a stringified version of the JSON forinsertting back into an LLM."""actions = await self.alist()diff --git a/libs/community/langchain_community/utils/math.py b/libs/community/langchain_community/utils/math.pyindex 59b7440ddb..bf110f2217 100644--- a/libs/community/langchain_community/utils/math.py+++ b/libs/community/langchain_community/utils/math.py@@ -71,4 +71,4 @@ def cosine_similarity_top_k(top_k_idxs = top_k_idxs[np.argsort(score_array.ravel()[top_k_idxs])][::-1]ret_idxs = np.unravel_index(top_k_idxs, score_array.shape)scores = score_array.ravel()[top_k_idxs].tolist()- return list(zip(*ret_idxs)), scores # type: ignore[return-value]+ return list(zip(*ret_idxs)), scores # type: ignore[return-value,unused-ignore]diff --git a/libs/community/langchain_community/vectorstores/apache_doris.py b/libs/community/langchain_community/vectorstores/apache_doris.pyindex 0e88fba5bd..6b53572604 100644--- a/libs/community/langchain_community/vectorstores/apache_doris.py+++ b/libs/community/langchain_community/vectorstores/apache_doris.py@@ -108,7 +108,7 @@ class ApacheDoris(VectorStore):config (ApacheDorisSettings): Apache Doris client configuration information."""try:- import pymysql # type: ignore[import]+ import pymysql # type: ignore[import-untyped]except ImportError:raise ImportError("Could not import pymysql python package. "diff --git a/libs/community/langchain_community/vectorstores/astradb.py b/libs/community/langchain_community/vectorstores/astradb.pyindex ad6f1d358a..06f3e51a9a 100644--- a/libs/community/langchain_community/vectorstores/astradb.py+++ b/libs/community/langchain_community/vectorstores/astradb.py@@ -245,7 +245,7 @@ class AstraDB(VectorStore):async def aclear(self) -> None:"""Empty the collection of all its stored entries."""await self.astra_env.aensure_db_setup()- await self.async_collection.delete_many({}) # type: ignore[union-attr]+ await self.async_collection.delete_many({})def delete_by_document_id(self, document_id: str) -> bool:"""@@ -258,7 +258,7 @@ class AstraDB(VectorStore):True if a document has indeed been deleted, False if ID not found."""self.astra_env.ensure_db_setup()- deletion_response = self.collection.delete_one(document_id) # type: ignore[union-attr]+ deletion_response = self.collection.delete_one(document_id)return ((deletion_response or {}).get("status") or {}).get("deletedCount", 0) == 1diff --git a/libs/community/langchain_community/vectorstores/chroma.py b/libs/community/langchain_community/vectorstores/chroma.pyindex ebf91f718a..e67b137bf4 100644--- a/libs/community/langchain_community/vectorstores/chroma.py+++ b/libs/community/langchain_community/vectorstores/chroma.py@@ -75,7 +75,7 @@ class Chroma(VectorStore):persist_directory: Optional[str] = None,client_settings: Optional[chromadb.config.Settings] = None,collection_metadata: Optional[Dict] = None,- client: Optional[chromadb.Client] = None, # type: ignore[valid-type]+ client: Optional[chromadb.Client] = None,relevance_score_fn: Optional[Callable[[float], float]] = None,) -> None:"""Initialize with a Chroma client."""@@ -118,14 +118,14 @@ class Chroma(VectorStore):_client_settings.persist_directory = persist_directoryelse:_client_settings = chromadb.config.Settings()- self._client_settings = _client_settings # type: ignore[has-type]- self._client = chromadb.Client(_client_settings) # type: ignore[has-type]- self._persist_directory = ( # type: ignore[has-type]+ self._client_settings = _client_settings+ self._client = chromadb.Client(_client_settings)+ self._persist_directory = (_client_settings.persist_directory or persist_directory)self._embedding_function = embedding_function- self._collection = self._client.get_or_create_collection( # type: ignore[has-type]+ self._collection = self._client.get_or_create_collection(name=collection_name,embedding_function=None,metadata=collection_metadata,@@ -154,12 +154,12 @@ class Chroma(VectorStore):"Could not import chromadb python package. ""Please install it with `pip install chromadb`.")- return self._collection.query( # type: ignore[return-value]+ return self._collection.query(query_texts=query_texts,- query_embeddings=query_embeddings, # type: ignore[arg-type]+ query_embeddings=query_embeddings,n_results=n_results,- where=where, # type: ignore[arg-type]- where_document=where_document, # type: ignore[arg-type]+ where=where,+ where_document=where_document,**kwargs,)@@ -218,7 +218,7 @@ class Chroma(VectorStore):ids_with_metadata = [ids[idx] for idx in non_empty_ids]try:self._collection.upsert(- metadatas=metadatas, # type: ignore[arg-type]+ metadatas=metadatas,embeddings=embeddings_with_metadatas,documents=images_with_metadatas,ids=ids_with_metadata,@@ -297,8 +297,8 @@ class Chroma(VectorStore):ids_with_metadata = [ids[idx] for idx in non_empty_ids]try:self._collection.upsert(- metadatas=metadatas, # type: ignore[arg-type]- embeddings=embeddings_with_metadatas, # type: ignore[arg-type]+ metadatas=metadatas,+ embeddings=embeddings_with_metadatas,documents=texts_with_metadatas,ids=ids_with_metadata,)@@ -318,13 +318,13 @@ class Chroma(VectorStore):)ids_without_metadatas = [ids[j] for j in empty_ids]self._collection.upsert(- embeddings=embeddings_without_metadatas, # type: ignore[arg-type]+ embeddings=embeddings_without_metadatas,documents=texts_without_metadatas,ids=ids_without_metadatas,)else:self._collection.upsert(- embeddings=embeddings, # type: ignore[arg-type]+ embeddings=embeddings,documents=texts,ids=ids,)@@ -659,7 +659,7 @@ class Chroma(VectorStore):def delete_collection(self) -> None:"""Delete the collection."""- self._client.delete_collection(self._collection.name) # type: ignore[has-type]+ self._client.delete_collection(self._collection.name)def get(self,@@ -697,7 +697,7 @@ class Chroma(VectorStore):if include is not None:kwargs["include"] = include- return self._collection.get(**kwargs) # type: ignore[return-value, arg-type, arg-type, arg-type, arg-type, arg-type]+ return self._collection.get(**kwargs)@deprecated(since="0.1.17",@@ -716,7 +716,7 @@ class Chroma(VectorStore):Since Chroma 0.4.x the manual persistence method is no longersupported as docs are automatically persisted."""- if self._persist_directory is None: # type: ignore[has-type]+ if self._persist_directory is None:raise ValueError("You must specify a persist_directory on""creation to persist the collection."@@ -726,7 +726,7 @@ class Chroma(VectorStore):# Maintain backwards compatibility with chromadb < 0.4.0major, minor, _ = chromadb.__version__.split(".")if int(major) == 0 and int(minor) < 4:- self._client.persist() # type: ignore[has-type]+ self._client.persist()def update_document(self, document_id: str, document: Document) -> None:"""Update a document in the collection.@@ -763,9 +763,9 @@ class Chroma(VectorStore):for batch in create_batches(api=self._collection._client,ids=ids,- metadatas=metadata, # type: ignore[arg-type]+ metadatas=metadata,documents=text,- embeddings=embeddings, # type: ignore[arg-type]+ embeddings=embeddings,):self._collection.update(ids=batch[0],@@ -776,9 +776,9 @@ class Chroma(VectorStore):else:self._collection.update(ids=ids,- embeddings=embeddings, # type: ignore[arg-type]+ embeddings=embeddings,documents=text,- metadatas=metadata, # type: ignore[arg-type]+ metadatas=metadata,)@classmethod@@ -791,7 +791,7 @@ class Chroma(VectorStore):collection_name: str = _LANGCHAIN_DEFAULT_COLLECTION_NAME,persist_directory: Optional[str] = None,client_settings: Optional[chromadb.config.Settings] = None,- client: Optional[chromadb.Client] = None, # type: ignore[valid-type]+ client: Optional[chromadb.Client] = None,collection_metadata: Optional[Dict] = None,**kwargs: Any,) -> Chroma:@@ -826,23 +826,23 @@ class Chroma(VectorStore):if ids is None:ids = [str(uuid.uuid4()) for _ in texts]if hasattr(- chroma_collection._client, # type: ignore[has-type]+ chroma_collection._client,"get_max_batch_size", # for Chroma 0.5.1 and above) or hasattr(- chroma_collection._client, # type: ignore[has-type]+ chroma_collection._client,"max_batch_size",): # for Chroma 0.4.10 and abovefrom chromadb.utils.batch_utils import create_batchesfor batch in create_batches(- api=chroma_collection._client, # type: ignore[has-type]+ api=chroma_collection._client,ids=ids,- metadatas=metadatas, # type: ignore[arg-type]+ metadatas=metadatas,documents=texts,):chroma_collection.add_texts(texts=batch[3] if batch[3] else [],- metadatas=batch[2] if batch[2] else None, # type: ignore[arg-type]+ metadatas=batch[2] if batch[2] else None,ids=batch[0],)else:@@ -858,7 +858,7 @@ class Chroma(VectorStore):collection_name: str = _LANGCHAIN_DEFAULT_COLLECTION_NAME,persist_directory: Optional[str] = None,client_settings: Optional[chromadb.config.Settings] = None,- client: Optional[ # type: ignore[valid-type]+ client: Optional[chromadb.Client] = None, # Add this line # type: ignore[valid-type]collection_metadata: Optional[Dict] = None,diff --git a/libs/community/langchain_community/vectorstores/hanavector.py b/libs/community/langchain_community/vectorstores/hanavector.pyindex 9c20656ac4..f9087fde01 100644--- a/libs/community/langchain_community/vectorstores/hanavector.py+++ b/libs/community/langchain_community/vectorstores/hanavector.py@@ -222,7 +222,7 @@ class HanaDB(VectorStore):return self.embedding@staticmethod- def _sanitize_name(input_str: str) -> str: # type: ignore[misc]+ def _sanitize_name(input_str: str) -> str:# Remove characters that are not alphanumeric or underscoresreturn re.sub(r"[^a-zA-Z0-9_]", "", input_str)@@ -356,7 +356,7 @@ class HanaDB(VectorStore):finally:cur.close()- def add_texts( # type: ignore[override]+ def add_texts(self,texts: Iterable[str],metadatas: Optional[List[dict]] = None,diff --git a/libs/community/langchain_community/vectorstores/llm_rails.py b/libs/community/langchain_community/vectorstores/llm_rails.pyindex 2238d15fab..1627716128 100644--- a/libs/community/langchain_community/vectorstores/llm_rails.py+++ b/libs/community/langchain_community/vectorstores/llm_rails.py@@ -226,7 +226,7 @@ class LLMRails(VectorStore):return LLMRailsRetriever(vectorstore=self, **kwargs)-class LLMRailsRetriever(VectorStoreRetriever): # type: ignore[override]+class LLMRailsRetriever(VectorStoreRetriever):"""Retriever for LLMRails."""vectorstore: LLMRailsdiff --git a/libs/community/langchain_community/vectorstores/matching_engine.py b/libs/community/langchain_community/vectorstores/matching_engine.pyindex 86f2ea27e0..d0f9c0b9a4 100644--- a/libs/community/langchain_community/vectorstores/matching_engine.py+++ b/libs/community/langchain_community/vectorstores/matching_engine.py@@ -284,7 +284,7 @@ class MatchingEngine(VectorStore):page_content=page_content,metadata=metadata,)- docs.append((document, result.distance)) # type: ignore[arg-type]+ docs.append((document, result.distance))logger.debug("Downloaded documents for query.")@@ -426,16 +426,16 @@ class MatchingEngine(VectorStore):"""gcs_bucket_name = cls._validate_gcs_bucket(gcs_bucket_name)credentials = cls._create_credentials_from_file(credentials_path)- index = cls._create_index_by_id(index_id, project_id, region, credentials) # type: ignore[arg-type]+ index = cls._create_index_by_id(index_id, project_id, region, credentials)endpoint = cls._create_endpoint_by_id(endpoint_id,project_id,region,- credentials, # type: ignore[arg-type]+ credentials,)- gcs_client = cls._get_gcs_client(credentials, project_id) # type: ignore[arg-type]- cls._init_aiplatform(project_id, region, gcs_bucket_name, credentials) # type: ignore[arg-type]+ gcs_client = cls._get_gcs_client(credentials, project_id)+ cls._init_aiplatform(project_id, region, gcs_bucket_name, credentials)return cls(project_id=project_id,diff --git a/libs/community/langchain_community/vectorstores/milvus.py b/libs/community/langchain_community/vectorstores/milvus.pyindex 7dd4049996..f9e984d350 100644--- a/libs/community/langchain_community/vectorstores/milvus.py+++ b/libs/community/langchain_community/vectorstores/milvus.py@@ -1053,7 +1053,7 @@ class Milvus(VectorStore):pks = [item.get(self._primary_field) for item in query_result]return pks- def upsert( # type: ignore[override]+ def upsert(self,ids: Optional[List[str]] = None,documents: List[Document] | None = None,diff --git a/libs/community/langchain_community/vectorstores/mongodb_atlas.py b/libs/community/langchain_community/vectorstores/mongodb_atlas.pyindex 2c23ae92c4..10fab4ec11 100644--- a/libs/community/langchain_community/vectorstores/mongodb_atlas.py+++ b/libs/community/langchain_community/vectorstores/mongodb_atlas.py@@ -210,7 +210,7 @@ class MongoDBAtlasVectorSearch(VectorStore):]if post_filter_pipeline is not None:pipeline.extend(post_filter_pipeline)- cursor = self._collection.aggregate(pipeline) # type: ignore[arg-type]+ cursor = self._collection.aggregate(pipeline)docs = []for res in cursor:text = res.pop(self._text_key)diff --git a/libs/community/langchain_community/vectorstores/neo4j_vector.py b/libs/community/langchain_community/vectorstores/neo4j_vector.pyindex b65f165aba..57c7202b33 100644--- a/libs/community/langchain_community/vectorstores/neo4j_vector.py+++ b/libs/community/langchain_community/vectorstores/neo4j_vector.py@@ -692,20 +692,20 @@ class Neo4jVector(VectorStore):or e.code== "Neo.DatabaseError.Transaction.TransactionStartFailed")- and "in an implicit transaction" in e.message # type: ignore[operator]+ and "in an implicit transaction" in e.message)or ( # isPeriodicCommitErrore.code == "Neo.ClientError.Statement.SemanticError"and (- "in an open transaction is not possible" in e.message # type: ignore[operator]- or "tried to execute in an explicit transaction" in e.message # type: ignore[operator]+ "in an open transaction is not possible" in e.message+ or "tried to execute in an explicit transaction" in e.message))):raise# Fallback to allow implicit transactionswith self._driver.session(database=self._database) as session:- data = session.run(Query(text=query), params) # type: ignore[assignment]+ data = session.run(Query(text=query), params)return [r.data() for r in data]def verify_version(self) -> None:diff --git a/libs/community/langchain_community/vectorstores/pgvector.py b/libs/community/langchain_community/vectorstores/pgvector.pyindex c2a9cd8b69..9497299f30 100644--- a/libs/community/langchain_community/vectorstores/pgvector.py+++ b/libs/community/langchain_community/vectorstores/pgvector.py@@ -375,7 +375,7 @@ class PGVector(VectorStore):def create_vector_extension(self) -> None:try:- with Session(self._bind) as session: # type: ignore[arg-type]+ with Session(self._bind) as session:# The advisor lock fixes issue arising from concurrent# creation of the vector extension.# https://github.com/langchain-ai/langchain/issues/12933@@ -393,24 +393,24 @@ class PGVector(VectorStore):raise Exception(f"Failed to create vector extension: {e}") from edef create_tables_if_not_exists(self) -> None:- with Session(self._bind) as session, session.begin(): # type: ignore[arg-type]+ with Session(self._bind) as session, session.begin():Base.metadata.create_all(session.get_bind())def drop_tables(self) -> None:- with Session(self._bind) as session, session.begin(): # type: ignore[arg-type]+ with Session(self._bind) as session, session.begin():Base.metadata.drop_all(session.get_bind())def create_collection(self) -> None:if self.pre_delete_collection:self.delete_collection()- with Session(self._bind) as session: # type: ignore[arg-type]+ with Session(self._bind) as session:self.CollectionStore.get_or_create(session, self.collection_name, cmetadata=self.collection_metadata)def delete_collection(self) -> None:self.logger.debug("Trying to delete collection")- with Session(self._bind) as session: # type: ignore[arg-type]+ with Session(self._bind) as session:collection = self.get_collection(session)if not collection:self.logger.warning("Collection not found")@@ -421,7 +421,7 @@ class PGVector(VectorStore):@contextlib.contextmanagerdef _make_session(self) -> Generator[Session, None, None]:"""Create a context manager for the session, bind to _conn string."""- yield Session(self._bind) # type: ignore[arg-type]+ yield Session(self._bind)def delete(self,@@ -435,7 +435,7 @@ class PGVector(VectorStore):ids: List of ids to delete.collection_only: Only delete ids in the collection."""- with Session(self._bind) as session: # type: ignore[arg-type]+ with Session(self._bind) as session:if ids is not None:self.logger.debug("Trying to delete vectors by ids (represented by the model "@@ -523,7 +523,7 @@ class PGVector(VectorStore):if not metadatas:metadatas = [{} for _ in texts]- with Session(self._bind) as session: # type: ignore[arg-type]+ with Session(self._bind) as session:collection = self.get_collection(session)if not collection:raise ValueError("Collection not found")@@ -935,7 +935,7 @@ class PGVector(VectorStore):filter: Optional[Dict[str, str]] = None,) -> List[Any]:"""Query the collection."""- with Session(self._bind) as session: # type: ignore[arg-type]+ with Session(self._bind) as session:collection = self.get_collection(session)if not collection:raise ValueError("Collection not found")diff --git a/libs/community/langchain_community/vectorstores/qdrant.py b/libs/community/langchain_community/vectorstores/qdrant.pyindex 9f402718e6..b4a9c60b2c 100644--- a/libs/community/langchain_community/vectorstores/qdrant.py+++ b/libs/community/langchain_community/vectorstores/qdrant.py@@ -1049,7 +1049,7 @@ class Qdrant(VectorStore):**kwargs,)embeddings = [- result.vector.get(self.vector_name) # type: ignore[index, union-attr]+ result.vector.get(self.vector_name)if self.vector_name is not Noneelse result.vectorfor result in results@@ -1124,7 +1124,7 @@ class Qdrant(VectorStore):**kwargs,)embeddings = [- result.vector.get(self.vector_name) # type: ignore[index, union-attr]+ result.vector.get(self.vector_name)if self.vector_name is not Noneelse result.vectorfor result in results@@ -1673,7 +1673,7 @@ class Qdrant(VectorStore):f"If you want to recreate the collection, set `force_recreate` "f"parameter to `True`.")- current_vector_config = current_vector_config.get(vector_name) # type: ignore[assignment]+ current_vector_config = current_vector_config.get(vector_name)elif isinstance(current_vector_config, dict) and vector_name is None:raise QdrantException(f"Existing Qdrant collection {collection_name} uses named vectors. "@@ -1694,18 +1694,16 @@ class Qdrant(VectorStore):)# Check if the vector configuration has the same dimensionality.- if current_vector_config.size != vector_size: # type: ignore[union-attr]+ if current_vector_config.size != vector_size:raise QdrantException(f"Existing Qdrant collection is configured for vectors with "- f"{current_vector_config.size} " # type: ignore[union-attr]+ f"{current_vector_config.size} "f"dimensions. Selected embeddings are {vector_size}-dimensional. "f"If you want to recreate the collection, set `force_recreate` "f"parameter to `True`.")- current_distance_func = (- current_vector_config.distance.name.upper() # type: ignore[union-attr]- )+ current_distance_func = current_vector_config.distance.name.upper()if current_distance_func != distance_func:raise QdrantException(f"Existing Qdrant collection is configured for "@@ -1725,7 +1723,7 @@ class Qdrant(VectorStore):# If vector name was provided, we're going to use the named vectors feature# with just a single vector.if vector_name is not None:- vectors_config = { # type: ignore[assignment]+ vectors_config = {vector_name: vectors_config,}@@ -1741,7 +1739,7 @@ class Qdrant(VectorStore):wal_config=wal_config,quantization_config=quantization_config,init_from=init_from,- timeout=timeout, # type: ignore[arg-type]+ timeout=timeout,)qdrant = cls(client=client,@@ -1838,7 +1836,7 @@ class Qdrant(VectorStore):f"If you want to recreate the collection, set `force_recreate` "f"parameter to `True`.")- current_vector_config = current_vector_config.get(vector_name) # type: ignore[assignment]+ current_vector_config = current_vector_config.get(vector_name)elif isinstance(current_vector_config, dict) and vector_name is None:raise QdrantException(f"Existing Qdrant collection {collection_name} uses named vectors. "@@ -1859,22 +1857,20 @@ class Qdrant(VectorStore):)# Check if the vector configuration has the same dimensionality.- if current_vector_config.size != vector_size: # type: ignore[union-attr]+ if current_vector_config.size != vector_size:raise QdrantException(f"Existing Qdrant collection is configured for vectors with "- f"{current_vector_config.size} " # type: ignore[union-attr]+ f"{current_vector_config.size} "f"dimensions. Selected embeddings are {vector_size}-dimensional. "f"If you want to recreate the collection, set `force_recreate` "f"parameter to `True`.")- current_distance_func = (- current_vector_config.distance.name.upper() # type: ignore[union-attr]- )+ current_distance_func = current_vector_config.distance.name.upper()if current_distance_func != distance_func:raise QdrantException(f"Existing Qdrant collection is configured for "- f"{current_vector_config.distance} " # type: ignore[union-attr]+ f"{current_vector_config.distance} "f"similarity. Please set `distance_func` parameter to "f"`{distance_func}` if you want to reuse it. If you want to "f"recreate the collection, set `force_recreate` parameter to "@@ -1890,7 +1886,7 @@ class Qdrant(VectorStore):# If vector name was provided, we're going to use the named vectors feature# with just a single vector.if vector_name is not None:- vectors_config = { # type: ignore[assignment]+ vectors_config = {vector_name: vectors_config,}@@ -1906,7 +1902,7 @@ class Qdrant(VectorStore):wal_config=wal_config,quantization_config=quantization_config,init_from=init_from,- timeout=timeout, # type: ignore[arg-type]+ timeout=timeout,)qdrant = cls(client=client,diff --git a/libs/community/langchain_community/vectorstores/redis/base.py b/libs/community/langchain_community/vectorstores/redis/base.pyindex a4efc12a7d..36c9ebae35 100644--- a/libs/community/langchain_community/vectorstores/redis/base.py+++ b/libs/community/langchain_community/vectorstores/redis/base.py@@ -1429,7 +1429,7 @@ def _prepare_metadata(metadata: Dict[str, Any]) -> Dict[str, Any]:return clean_meta-class RedisVectorStoreRetriever(VectorStoreRetriever): # type: ignore[override]+class RedisVectorStoreRetriever(VectorStoreRetriever):"""Retriever for Redis VectorStore."""vectorstore: Redisdiff --git a/libs/community/langchain_community/vectorstores/redis/schema.py b/libs/community/langchain_community/vectorstores/redis/schema.pyindex c613c9a762..ac6b0cfc1d 100644--- a/libs/community/langchain_community/vectorstores/redis/schema.py+++ b/libs/community/langchain_community/vectorstores/redis/schema.py@@ -124,7 +124,7 @@ class RedisVectorField(RedisField):return field_data-class FlatVectorField(RedisVectorField): # type: ignore[override]+class FlatVectorField(RedisVectorField):"""Schema for flat vector fields in Redis."""algorithm: Literal["FLAT"] = "FLAT"@@ -139,7 +139,7 @@ class FlatVectorField(RedisVectorField): # type: ignore[override]return VectorField(self.name, self.algorithm, field_data)-class HNSWVectorField(RedisVectorField): # type: ignore[override]+class HNSWVectorField(RedisVectorField):"""Schema for HNSW vector fields in Redis."""algorithm: Literal["HNSW"] = "HNSW"diff --git a/libs/community/langchain_community/vectorstores/starrocks.py b/libs/community/langchain_community/vectorstores/starrocks.pyindex d3ce2dcc9b..8c24a794c4 100644--- a/libs/community/langchain_community/vectorstores/starrocks.py+++ b/libs/community/langchain_community/vectorstores/starrocks.py@@ -162,7 +162,7 @@ class StarRocks(VectorStore):config (StarRocksSettings): Configuration to StarRocks Client"""try:- import pymysql # type: ignore[import]+ import pymysql # type: ignore[import-untyped]except ImportError:raise ImportError("Could not import pymysql python package. "diff --git a/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py b/libs/community/langchain_community/vectorstores/thirdai_neuraldb.pyindex 17d0d6318a..45b15fafa8 100644--- a/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py+++ b/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py@@ -81,7 +81,7 @@ class NeuralDBVectorStore(VectorStore):NeuralDBVectorStore._verify_thirdai_library(thirdai_key)from thirdai import neural_db as ndb- return cls(db=ndb.NeuralDB(**model_kwargs)) # type: ignore[call-arg]+ return cls(db=ndb.NeuralDB(**model_kwargs))@classmethoddef from_checkpoint( # type: ignore[no-untyped-def]@@ -116,7 +116,7 @@ class NeuralDBVectorStore(VectorStore):NeuralDBVectorStore._verify_thirdai_library(thirdai_key)from thirdai import neural_db as ndb- return cls(db=ndb.NeuralDB.from_checkpoint(checkpoint)) # type: ignore[call-arg]+ return cls(db=ndb.NeuralDB.from_checkpoint(checkpoint))@classmethoddef from_texts(@@ -157,7 +157,7 @@ class NeuralDBVectorStore(VectorStore):df = pd.DataFrame({"texts": texts})if metadatas:df = pd.concat([df, pd.DataFrame.from_records(metadatas)], axis=1)- temp = tempfile.NamedTemporaryFile("w", delete=False, delete_on_close=False) # type: ignore[call-overload]+ temp = tempfile.NamedTemporaryFile("w", delete=False, delete_on_close=False) # type: ignore[call-overload,unused-ignore]df.to_csv(temp)source_id = self.insert([ndb.CSV(temp.name)], **kwargs)[0]offset = self.db._savable_state.documents.get_source_by_id(source_id)[1]diff --git a/libs/community/langchain_community/vectorstores/vectara.py b/libs/community/langchain_community/vectorstores/vectara.pyindex a5d8058952..7c48f184e4 100644--- a/libs/community/langchain_community/vectorstores/vectara.py+++ b/libs/community/langchain_community/vectorstores/vectara.py@@ -731,7 +731,7 @@ class Vectara(VectorStore):)-class VectaraRetriever(VectorStoreRetriever): # type: ignore[override]+class VectaraRetriever(VectorStoreRetriever):"""Vectara Retriever class."""vectorstore: Vectaradiff --git a/libs/community/langchain_community/vectorstores/vikingdb.py b/libs/community/langchain_community/vectorstores/vikingdb.pyindex 2e0a9b0c57..485f4876a9 100644--- a/libs/community/langchain_community/vectorstores/vikingdb.py+++ b/libs/community/langchain_community/vectorstores/vikingdb.py@@ -222,7 +222,7 @@ class VikingDB(VectorStore):end = min(i + batch_size, total_count)insert_data = data[i:end]# print(insert_data)- self.collection.upsert_data(insert_data) # type: ignore[union-attr]+ self.collection.upsert_data(insert_data)return pksdef similarity_search( # type: ignore[override]@@ -394,7 +394,7 @@ class VikingDB(VectorStore):) -> None:if self.collection is None:logger.debug("No existing collection to search.")- self.collection.delete_data(ids) # type: ignore[union-attr]+ self.collection.delete_data(ids)@classmethoddef from_texts( # type: ignore[no-untyped-def, override]diff --git a/libs/community/pyproject.toml b/libs/community/pyproject.tomlindex 3811b99d48..1569d155c9 100644--- a/libs/community/pyproject.toml+++ b/libs/community/pyproject.toml@@ -95,7 +95,7 @@ exclude = [[tool.mypy]ignore_missing_imports = "True"disallow_untyped_defs = "True"-exclude = ["notebooks", "examples", "example_data"]+warn_unused_ignores = "True"[tool.codespell]skip = ".git,*.pdf,*.svg,*.pdf,*.yaml,*.ipynb,poetry.lock,*.min.js,*.css,package-lock.json,example_data,_dist,examples,*.trig"diff --git a/libs/community/tests/integration_tests/adapters/test_openai.py b/libs/community/tests/integration_tests/adapters/test_openai.pyindex 644f3cc7ff..3f8f6c01c8 100644--- a/libs/community/tests/integration_tests/adapters/test_openai.py+++ b/libs/community/tests/integration_tests/adapters/test_openai.py@@ -6,7 +6,7 @@ from langchain_community.adapters import openai as lcopenaidef _test_no_stream(**kwargs: Any) -> None:import openai- result = openai.ChatCompletion.create(**kwargs) # type: ignore[attr-defined]+ result = openai.ChatCompletion.create(**kwargs)lc_result = lcopenai.ChatCompletion.create(**kwargs)if isinstance(lc_result, dict):if isinstance(result, dict):@@ -20,7 +20,7 @@ def _test_stream(**kwargs: Any) -> None:import openairesult = []- for c in openai.ChatCompletion.create(**kwargs): # type: ignore[attr-defined]+ for c in openai.ChatCompletion.create(**kwargs):result.append(c["choices"][0]["delta"].to_dict_recursive())lc_result = []@@ -32,7 +32,7 @@ def _test_stream(**kwargs: Any) -> None:async def _test_async(**kwargs: Any) -> None:import openai- result = await openai.ChatCompletion.acreate(**kwargs) # type: ignore[attr-defined]+ result = await openai.ChatCompletion.acreate(**kwargs)lc_result = await lcopenai.ChatCompletion.acreate(**kwargs)if isinstance(lc_result, dict):if isinstance(result, dict):@@ -46,7 +46,7 @@ async def _test_astream(**kwargs: Any) -> None:import openairesult = []- async for c in await openai.ChatCompletion.acreate(**kwargs): # type: ignore[attr-defined]+ async for c in await openai.ChatCompletion.acreate(**kwargs):result.append(c["choices"][0]["delta"].to_dict_recursive())lc_result = []diff --git a/libs/community/tests/integration_tests/chains/test_ontotext_graphdb_qa.py b/libs/community/tests/integration_tests/chains/test_ontotext_graphdb_qa.pyindex 85785f660b..54486d7101 100644--- a/libs/community/tests/integration_tests/chains/test_ontotext_graphdb_qa.py+++ b/libs/community/tests/integration_tests/chains/test_ontotext_graphdb_qa.py@@ -375,9 +375,9 @@ def test_chain(model_name: str, question: str) -> None:"FROM <https://swapi.co/ontology/> WHERE {?s ?p ?o}",)chain = OntotextGraphDBQAChain.from_llm(- ChatOpenAI(temperature=0, model_name=model_name), # type: ignore[call-arg]+ ChatOpenAI(temperature=0, model_name=model_name),graph=graph,- verbose=True, # type: ignore[call-arg]+ verbose=True,)try:chain.invoke({chain.input_key: question})diff --git a/libs/community/tests/integration_tests/chat_models/test_bedrock.py b/libs/community/tests/integration_tests/chat_models/test_bedrock.pyindex 5d7ea6dc91..46a9293d30 100644--- a/libs/community/tests/integration_tests/chat_models/test_bedrock.py+++ b/libs/community/tests/integration_tests/chat_models/test_bedrock.py@@ -109,7 +109,7 @@ def test_bedrock_streaming(chat: BedrockChat) -> None:full = Nonefor token in chat.stream("I'm Pickle Rick"):- full = token if full is None else full + token # type: ignore[operator]+ full = token if full is None else full + tokenassert isinstance(token.content, str)assert isinstance(cast(AIMessageChunk, full).content, str)diff --git a/libs/community/tests/integration_tests/chat_models/test_jinachat.py b/libs/community/tests/integration_tests/chat_models/test_jinachat.pyindex 50b641311c..4188c4f520 100644--- a/libs/community/tests/integration_tests/chat_models/test_jinachat.py+++ b/libs/community/tests/integration_tests/chat_models/test_jinachat.py@@ -14,7 +14,7 @@ from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandlerdef test_jinachat_api_key_is_secret_string() -> None:- llm = JinaChat(jinachat_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = JinaChat(jinachat_api_key="secret-api-key") # type: ignore[arg-type]assert isinstance(llm.jinachat_api_key, SecretStr)@@ -23,7 +23,7 @@ def test_jinachat_api_key_masked_when_passed_from_env() -> None:"""Test initialization with an API key provided via an env variable"""monkeypatch.setenv("JINACHAT_API_KEY", "secret-api-key")- llm = JinaChat() # type: ignore[call-arg]+ llm = JinaChat()print(llm.jinachat_api_key, end="") # noqa: T201captured = capsys.readouterr()@@ -34,7 +34,7 @@ def test_jinachat_api_key_masked_when_passed_via_constructor(capsys: CaptureFixture,) -> None:"""Test initialization with an API key provided via the initializer"""- llm = JinaChat(jinachat_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = JinaChat(jinachat_api_key="secret-api-key") # type: ignore[arg-type]print(llm.jinachat_api_key, end="") # noqa: T201captured = capsys.readouterr()@@ -43,13 +43,13 @@ def test_jinachat_api_key_masked_when_passed_via_constructor(def test_uses_actual_secret_value_from_secretstr() -> None:"""Test that actual secret is retrieved using `.get_secret_value()`."""- llm = JinaChat(jinachat_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = JinaChat(jinachat_api_key="secret-api-key") # type: ignore[arg-type]assert cast(SecretStr, llm.jinachat_api_key).get_secret_value() == "secret-api-key"def test_jinachat() -> None:"""Test JinaChat wrapper."""- chat = JinaChat(max_tokens=10) # type: ignore[call-arg]+ chat = JinaChat(max_tokens=10)message = HumanMessage(content="Hello")response = chat.invoke([message])assert isinstance(response, BaseMessage)@@ -58,7 +58,7 @@ def test_jinachat() -> None:def test_jinachat_system_message() -> None:"""Test JinaChat wrapper with system message."""- chat = JinaChat(max_tokens=10) # type: ignore[call-arg]+ chat = JinaChat(max_tokens=10)system_message = SystemMessage(content="You are to chat with the user.")human_message = HumanMessage(content="Hello")response = chat.invoke([system_message, human_message])@@ -68,7 +68,7 @@ def test_jinachat_system_message() -> None:def test_jinachat_generate() -> None:"""Test JinaChat wrapper with generate."""- chat = JinaChat(max_tokens=10) # type: ignore[call-arg]+ chat = JinaChat(max_tokens=10)message = HumanMessage(content="Hello")response = chat.generate([[message], [message]])assert isinstance(response, LLMResult)@@ -85,7 +85,7 @@ def test_jinachat_streaming() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()callback_manager = CallbackManager([callback_handler])- chat = JinaChat( # type: ignore[call-arg]+ chat = JinaChat(max_tokens=10,streaming=True,temperature=0,@@ -100,7 +100,7 @@ def test_jinachat_streaming() -> None:async def test_async_jinachat() -> None:"""Test async generation."""- chat = JinaChat(max_tokens=102) # type: ignore[call-arg]+ chat = JinaChat(max_tokens=102)message = HumanMessage(content="Hello")response = await chat.agenerate([[message], [message]])assert isinstance(response, LLMResult)@@ -117,7 +117,7 @@ async def test_async_jinachat_streaming() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()callback_manager = CallbackManager([callback_handler])- chat = JinaChat( # type: ignore[call-arg]+ chat = JinaChat(max_tokens=10,streaming=True,temperature=0,@@ -154,4 +154,4 @@ def test_jinachat_extra_kwargs() -> None:# Test that if explicit param is specified in kwargs it errorswith pytest.raises(ValueError):- JinaChat(model_kwargs={"temperature": 0.2}) # type: ignore[call-arg]+ JinaChat(model_kwargs={"temperature": 0.2})diff --git a/libs/community/tests/integration_tests/chat_models/test_litellm.py b/libs/community/tests/integration_tests/chat_models/test_litellm.pyindex 27be6e7931..6d1f9bce9d 100644--- a/libs/community/tests/integration_tests/chat_models/test_litellm.py+++ b/libs/community/tests/integration_tests/chat_models/test_litellm.py@@ -14,7 +14,7 @@ from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandlerdef test_litellm_call() -> None:"""Test valid call to litellm."""- chat = ChatLiteLLM( # type: ignore[call-arg]+ chat = ChatLiteLLM(model="test",)message = HumanMessage(content="Hello")@@ -25,7 +25,7 @@ def test_litellm_call() -> None:def test_litellm_generate() -> None:"""Test generate method of anthropic."""- chat = ChatLiteLLM(model="test") # type: ignore[call-arg]+ chat = ChatLiteLLM(model="test")chat_messages: List[List[BaseMessage]] = [[HumanMessage(content="How many toes do dogs have?")]]@@ -41,7 +41,7 @@ def test_litellm_generate() -> None:def test_litellm_streaming() -> None:"""Test streaming tokens from anthropic."""- chat = ChatLiteLLM(model="test", streaming=True) # type: ignore[call-arg]+ chat = ChatLiteLLM(model="test", streaming=True)message = HumanMessage(content="Hello")response = chat.invoke([message])assert isinstance(response, AIMessage)@@ -52,7 +52,7 @@ def test_litellm_streaming_callback() -> None:"""Test that streaming correctly invokes on_llm_new_token callback."""callback_handler = FakeCallbackHandler()callback_manager = CallbackManager([callback_handler])- chat = ChatLiteLLM( # type: ignore[call-arg]+ chat = ChatLiteLLM(model="test",streaming=True,callback_manager=callback_manager,diff --git a/libs/community/tests/integration_tests/chat_models/test_minimax.py b/libs/community/tests/integration_tests/chat_models/test_minimax.pyindex 45127107f5..a41dcc0b60 100644--- a/libs/community/tests/integration_tests/chat_models/test_minimax.py+++ b/libs/community/tests/integration_tests/chat_models/test_minimax.py@@ -52,7 +52,7 @@ def test_chat_minimax_with_tool() -> None:messages.append(ai_msg) # type: ignore[arg-type]for tool_call in ai_msg.tool_calls:selected_tool = {"add": add, "multiply": multiply}[tool_call["name"].lower()]- tool_output = selected_tool.invoke(tool_call["args"]) # type: ignore[attr-defined]+ tool_output = selected_tool.invoke(tool_call["args"])messages.append(ToolMessage(tool_output, tool_call_id=tool_call["id"])) # type: ignore[arg-type]response = chat_with_tools.invoke(messages)assert isinstance(response, AIMessage)diff --git a/libs/community/tests/integration_tests/chat_models/test_premai.py b/libs/community/tests/integration_tests/chat_models/test_premai.pyindex 2f67b65654..cd297bd23a 100644--- a/libs/community/tests/integration_tests/chat_models/test_premai.py+++ b/libs/community/tests/integration_tests/chat_models/test_premai.py@@ -14,12 +14,12 @@ from langchain_community.chat_models import ChatPremAI@pytest.fixturedef chat() -> ChatPremAI:- return ChatPremAI(project_id=8) # type: ignore[call-arg]+ return ChatPremAI(project_id=8)def test_chat_premai() -> None:"""Test ChatPremAI wrapper."""- chat = ChatPremAI(project_id=8) # type: ignore[call-arg]+ chat = ChatPremAI(project_id=8)message = HumanMessage(content="Hello")response = chat.invoke([message])assert isinstance(response, BaseMessage)@@ -28,7 +28,7 @@ def test_chat_premai() -> None:def test_chat_prem_system_message() -> None:"""Test ChatPremAI wrapper for system message"""- chat = ChatPremAI(project_id=8) # type: ignore[call-arg]+ chat = ChatPremAI(project_id=8)system_message = SystemMessage(content="You are to chat with the user.")human_message = HumanMessage(content="Hello")response = chat.invoke([system_message, human_message])@@ -44,7 +44,7 @@ def test_chat_prem_model() -> None:def test_chat_prem_generate() -> None:"""Test ChatPremAI wrapper with generate."""- chat = ChatPremAI(project_id=8) # type: ignore[call-arg]+ chat = ChatPremAI(project_id=8)message = HumanMessage(content="Hello")response = chat.generate([[message], [message]])assert isinstance(response, LLMResult)@@ -64,7 +64,7 @@ async def test_prem_invoke(chat: ChatPremAI) -> None:def test_prem_streaming() -> None:"""Test streaming tokens from Prem."""- chat = ChatPremAI(project_id=8, streaming=True) # type: ignore[call-arg]+ chat = ChatPremAI(project_id=8, streaming=True)for token in chat.stream("I'm Pickle Rick"):assert isinstance(token.content, str)diff --git a/libs/community/tests/integration_tests/chat_models/test_qianfan_endpoint.py b/libs/community/tests/integration_tests/chat_models/test_qianfan_endpoint.pyindex 6749090eb2..f2e624daa4 100644--- a/libs/community/tests/integration_tests/chat_models/test_qianfan_endpoint.py+++ b/libs/community/tests/integration_tests/chat_models/test_qianfan_endpoint.py@@ -89,7 +89,7 @@ def test_initialization() -> None:"""Test chat model initialization."""for model in [- QianfanChatEndpoint(model="BLOOMZ-7B", timeout=40), # type: ignore[call-arg]+ QianfanChatEndpoint(model="BLOOMZ-7B", timeout=40),QianfanChatEndpoint(model="BLOOMZ-7B", request_timeout=40), # type: ignore[call-arg]]:assert model.model == "BLOOMZ-7B"@@ -132,7 +132,7 @@ def test_endpoint_param() -> None:"""Test user custom model deployments like some open source models."""chat = QianfanChatEndpoint() # type: ignore[call-arg]response = chat.invoke(- [HumanMessage(endpoint="qianfan_bloomz_7b_compressed", content="Hello")] # type: ignore[call-arg]+ [HumanMessage(endpoint="qianfan_bloomz_7b_compressed", content="Hello")])assert isinstance(response, BaseMessage)assert isinstance(response.content, str)@@ -261,7 +261,7 @@ def test_functions_call_thoughts() -> None:prompt_msgs = [HumanMessagePromptTemplate.from_template(prompt_tmpl),]- prompt = ChatPromptTemplate(messages=prompt_msgs) # type: ignore[arg-type, call-arg]+ prompt = ChatPromptTemplate(messages=prompt_msgs)chain = prompt | chat.bind(functions=_FUNCTIONS)@@ -274,7 +274,7 @@ def test_functions_call_thoughts() -> None:def test_functions_call() -> None:chat = QianfanChatEndpoint(model="ERNIE-Bot") # type: ignore[call-arg]- prompt = ChatPromptTemplate( # type: ignore[call-arg]+ prompt = ChatPromptTemplate(messages=[HumanMessage(content="What's the temperature in Shanghai today?"),AIMessage(@@ -340,8 +340,8 @@ def test_qianfan_key_masked_when_passed_via_constructor() -> None:"""Test initialization with an API key provided via the initializer"""chat = QianfanChatEndpoint( # type: ignore[call-arg]- qianfan_ak="test-api-key", # type: ignore[arg-type]- qianfan_sk="test-secret-key", # type: ignore[arg-type]+ qianfan_ak="test-api-key",+ qianfan_sk="test-secret-key",)print(chat.qianfan_ak, end="") # noqa: T201captured = capsys.readouterr()@@ -356,8 +356,8 @@ def test_qianfan_key_masked_when_passed_via_constructor(def test_uses_actual_secret_value_from_secret_str() -> None:"""Test that actual secret is retrieved using `.get_secret_value()`."""chat = QianfanChatEndpoint( # type: ignore[call-arg]- qianfan_ak="test-api-key", # type: ignore[arg-type]- qianfan_sk="test-secret-key", # type: ignore[arg-type]+ qianfan_ak="test-api-key",+ qianfan_sk="test-secret-key",)assert cast(SecretStr, chat.qianfan_ak).get_secret_value() == "test-api-key"assert cast(SecretStr, chat.qianfan_sk).get_secret_value() == "test-secret-key"@@ -371,8 +371,8 @@ def test_init_api_key_param() -> None:secret_key="test-secret-key", # type: ignore[arg-type]),QianfanChatEndpoint( # type: ignore[call-arg]- qianfan_ak="test-api-key", # type: ignore[arg-type]- qianfan_sk="test-secret-key", # type: ignore[arg-type]+ qianfan_ak="test-api-key",+ qianfan_sk="test-secret-key",),]:assert cast(SecretStr, chat.qianfan_ak).get_secret_value() == "test-api-key"diff --git a/libs/community/tests/integration_tests/chat_models/test_tongyi.py b/libs/community/tests/integration_tests/chat_models/test_tongyi.pyindex 50d1d81c99..0eee4d39b2 100644--- a/libs/community/tests/integration_tests/chat_models/test_tongyi.py+++ b/libs/community/tests/integration_tests/chat_models/test_tongyi.py@@ -103,7 +103,7 @@ def test_functions_call_thoughts() -> None:prompt_msgs = [HumanMessagePromptTemplate.from_template(prompt_tmpl),]- prompt = ChatPromptTemplate(messages=prompt_msgs) # type: ignore[arg-type, call-arg]+ prompt = ChatPromptTemplate(messages=prompt_msgs)chain = prompt | chat.bind(functions=_FUNCTIONS)diff --git a/libs/community/tests/integration_tests/chat_models/test_volcengine_maas.py b/libs/community/tests/integration_tests/chat_models/test_volcengine_maas.pyindex d236ae2251..24002ec617 100644--- a/libs/community/tests/integration_tests/chat_models/test_volcengine_maas.py+++ b/libs/community/tests/integration_tests/chat_models/test_volcengine_maas.py@@ -10,7 +10,7 @@ from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandlerdef test_default_call() -> None:"""Test valid chat call to volc engine."""- chat = VolcEngineMaasChat() # type: ignore[call-arg]+ chat = VolcEngineMaasChat()response = chat.invoke([HumanMessage(content="Hello")])assert isinstance(response, BaseMessage)assert isinstance(response.content, str)@@ -18,7 +18,7 @@ def test_default_call() -> None:def test_multiple_history() -> None:"""Tests multiple history works."""- chat = VolcEngineMaasChat() # type: ignore[call-arg]+ chat = VolcEngineMaasChat()response = chat.invoke([@@ -33,7 +33,7 @@ def test_multiple_history() -> None:def test_stream() -> None:"""Test that stream works."""- chat = VolcEngineMaasChat(streaming=True) # type: ignore[call-arg]+ chat = VolcEngineMaasChat(streaming=True)callback_handler = FakeCallbackHandler()callback_manager = CallbackManager([callback_handler])response = chat.invoke(@@ -51,7 +51,7 @@ def test_stream() -> None:def test_stop() -> None:"""Test that stop works."""- chat = VolcEngineMaasChat( # type: ignore[call-arg]+ chat = VolcEngineMaasChat(model="skylark2-pro-4k", model_version="1.2", streaming=True)callback_handler = FakeCallbackHandler()@@ -73,7 +73,7 @@ def test_stop() -> None:def test_multiple_messages() -> None:"""Tests multiple messages works."""- chat = VolcEngineMaasChat() # type: ignore[call-arg]+ chat = VolcEngineMaasChat()message = HumanMessage(content="Hi, how are you?")response = chat.generate([[message], [message]])diff --git a/libs/community/tests/integration_tests/chat_models/test_zhipuai.py b/libs/community/tests/integration_tests/chat_models/test_zhipuai.pyindex 1f94712a25..3182947291 100644--- a/libs/community/tests/integration_tests/chat_models/test_zhipuai.py+++ b/libs/community/tests/integration_tests/chat_models/test_zhipuai.py@@ -88,7 +88,7 @@ def multiply(a: int, b: int) -> int:def test_tool_call() -> None:"""Test tool calling by ChatZhipuAI"""- chat = ChatZhipuAI(model="glm-4-long") # type: ignore[call-arg]+ chat = ChatZhipuAI(model="glm-4-long")tools = [add, multiply]chat_with_tools = chat.bind_tools(tools)@@ -103,7 +103,7 @@ def test_tool_call() -> None:messages.append(ai_msg) # type: ignore[arg-type]for tool_call in ai_msg.tool_calls:selected_tool = {"add": add, "multiply": multiply}[tool_call["name"].lower()]- tool_output = selected_tool.invoke(tool_call["args"]) # type: ignore[attr-defined]+ tool_output = selected_tool.invoke(tool_call["args"])messages.append(ToolMessage(tool_output, tool_call_id=tool_call["id"])) # type: ignore[arg-type]response = chat_with_tools.invoke(messages)assert isinstance(response, AIMessage)diff --git a/libs/community/tests/integration_tests/embeddings/test_azure_openai.py b/libs/community/tests/integration_tests/embeddings/test_azure_openai.pyindex 5f304551b2..7f895055ea 100644--- a/libs/community/tests/integration_tests/embeddings/test_azure_openai.py+++ b/libs/community/tests/integration_tests/embeddings/test_azure_openai.py@@ -105,7 +105,7 @@ def test_azure_openai_embedding_with_empty_string() -> None:output = embedding.embed_documents(document)assert len(output) == 2assert len(output[0]) == 1536- expected_output = openai.Embedding.create(input="", model="text-embedding-ada-002")[ # type: ignore[attr-defined]+ expected_output = openai.Embedding.create(input="", model="text-embedding-ada-002")["data"][0]["embedding"]assert np.allclose(output[0], expected_output)diff --git a/libs/community/tests/integration_tests/embeddings/test_baichuan.py b/libs/community/tests/integration_tests/embeddings/test_baichuan.pyindex 0c68d65c99..edfcf24951 100644--- a/libs/community/tests/integration_tests/embeddings/test_baichuan.py+++ b/libs/community/tests/integration_tests/embeddings/test_baichuan.py@@ -6,7 +6,7 @@ from langchain_community.embeddings.baichuan import BaichuanTextEmbeddingsdef test_baichuan_embedding_documents() -> None:"""Test Baichuan Text Embedding for documents."""documents = ["今天天气不错", "今天阳光灿烂"]- embedding = BaichuanTextEmbeddings() # type: ignore[call-arg]+ embedding = BaichuanTextEmbeddings()output = embedding.embed_documents(documents)assert len(output) == 2 # type: ignore[arg-type]assert len(output[0]) == 1024 # type: ignore[index]@@ -15,7 +15,7 @@ def test_baichuan_embedding_documents() -> None:def test_baichuan_embedding_query() -> None:"""Test Baichuan Text Embedding for query."""document = "所有的小学生都会学过只因兔同笼问题。"- embedding = BaichuanTextEmbeddings() # type: ignore[call-arg]+ embedding = BaichuanTextEmbeddings()output = embedding.embed_query(document)assert len(output) == 1024 # type: ignore[arg-type]@@ -24,7 +24,7 @@ def test_baichuan_embeddings_multi_documents() -> None:"""Test Baichuan Text Embedding for documents with multi texts."""document = "午餐吃了螺蛳粉"doc_amount = 35- embeddings = BaichuanTextEmbeddings() # type: ignore[call-arg]+ embeddings = BaichuanTextEmbeddings()output = embeddings.embed_documents([document] * doc_amount)assert len(output) == doc_amount # type: ignore[arg-type]assert len(output[0]) == 1024 # type: ignore[index]diff --git a/libs/community/tests/integration_tests/embeddings/test_cohere.py b/libs/community/tests/integration_tests/embeddings/test_cohere.pyindex 6ca91681af..a06db9c7f4 100644--- a/libs/community/tests/integration_tests/embeddings/test_cohere.py+++ b/libs/community/tests/integration_tests/embeddings/test_cohere.py@@ -6,7 +6,7 @@ from langchain_community.embeddings.cohere import CohereEmbeddingsdef test_cohere_embedding_documents() -> None:"""Test cohere embeddings."""documents = ["foo bar"]- embedding = CohereEmbeddings() # type: ignore[call-arg]+ embedding = CohereEmbeddings()output = embedding.embed_documents(documents)assert len(output) == 1assert len(output[0]) == 2048@@ -15,6 +15,6 @@ def test_cohere_embedding_documents() -> None:def test_cohere_embedding_query() -> None:"""Test cohere embeddings."""document = "foo bar"- embedding = CohereEmbeddings() # type: ignore[call-arg]+ embedding = CohereEmbeddings()output = embedding.embed_query(document)assert len(output) == 2048diff --git a/libs/community/tests/integration_tests/embeddings/test_dashscope.py b/libs/community/tests/integration_tests/embeddings/test_dashscope.pyindex b60b51cf51..33f654ce52 100644--- a/libs/community/tests/integration_tests/embeddings/test_dashscope.py+++ b/libs/community/tests/integration_tests/embeddings/test_dashscope.py@@ -8,7 +8,7 @@ from langchain_community.embeddings.dashscope import DashScopeEmbeddingsdef test_dashscope_embedding_documents() -> None:"""Test dashscope embeddings."""documents = ["foo bar"]- embedding = DashScopeEmbeddings(model="text-embedding-v1") # type: ignore[call-arg]+ embedding = DashScopeEmbeddings(model="text-embedding-v1")output = embedding.embed_documents(documents)assert len(output) == 1assert len(output[0]) == 1536@@ -46,7 +46,7 @@ def test_dashscope_embedding_documents_multiple() -> None:"foo23","foo24",]- embedding = DashScopeEmbeddings(model="text-embedding-v1") # type: ignore[call-arg]+ embedding = DashScopeEmbeddings(model="text-embedding-v1")output = embedding.embed_documents(documents)assert len(output) == 28assert len(output[0]) == 1536@@ -57,7 +57,7 @@ def test_dashscope_embedding_documents_multiple() -> None:def test_dashscope_embedding_query() -> None:"""Test dashscope embeddings."""document = "foo bar"- embedding = DashScopeEmbeddings(model="text-embedding-v1") # type: ignore[call-arg]+ embedding = DashScopeEmbeddings(model="text-embedding-v1")output = embedding.embed_query(document)assert len(output) == 1536@@ -67,7 +67,7 @@ def test_dashscope_embedding_with_empty_string() -> None:import dashscopedocument = ["", "abc"]- embedding = DashScopeEmbeddings(model="text-embedding-v1") # type: ignore[call-arg]+ embedding = DashScopeEmbeddings(model="text-embedding-v1")output = embedding.embed_documents(document)assert len(output) == 2assert len(output[0]) == 1536diff --git a/libs/community/tests/integration_tests/embeddings/test_fastembed.py b/libs/community/tests/integration_tests/embeddings/test_fastembed.pyindex f39c4cedfb..36acee1db4 100644--- a/libs/community/tests/integration_tests/embeddings/test_fastembed.py+++ b/libs/community/tests/integration_tests/embeddings/test_fastembed.py@@ -17,7 +17,7 @@ def test_fastembed_embedding_documents() -> None:"""Test fastembed embeddings for documents."""documents = ["foo bar", "bar foo"]- embedding = FastEmbedEmbeddings( # type: ignore[call-arg]+ embedding = FastEmbedEmbeddings(model_name=model_name,max_length=max_length,doc_embed_type=doc_embed_type, # type: ignore[arg-type]@@ -41,7 +41,7 @@ def test_fastembed_embedding_query(document = "foo bar"embedding = FastEmbedEmbeddings(model_name=model_name, max_length=max_length, batch_size=batch_size- ) # type: ignore[call-arg]+ )output = embedding.embed_query(document)assert len(output) == 384@@ -57,7 +57,7 @@ async def test_fastembed_async_embedding_documents() -> None:"""Test fastembed embeddings for documents."""documents = ["foo bar", "bar foo"]- embedding = FastEmbedEmbeddings( # type: ignore[call-arg]+ embedding = FastEmbedEmbeddings(model_name=model_name,max_length=max_length,doc_embed_type=doc_embed_type, # type: ignore[arg-type]@@ -77,7 +77,7 @@ async def test_fastembed_async_embedding_query() -> None:"""Test fastembed embeddings for query."""document = "foo bar"- embedding = FastEmbedEmbeddings(model_name=model_name, max_length=max_length) # type: ignore[call-arg]+ embedding = FastEmbedEmbeddings(model_name=model_name, max_length=max_length)output = await embedding.aembed_query(document)assert len(output) == 384@@ -85,6 +85,6 @@ async def test_fastembed_async_embedding_query(def test_fastembed_embedding_query_with_default_params() -> None:"""Test fastembed embeddings for query with default model params"""document = "foo bar"- embedding = FastEmbedEmbeddings() # type: ignore[call-arg]+ embedding = FastEmbedEmbeddings()output = embedding.embed_query(document)assert len(output) == 384diff --git a/libs/community/tests/integration_tests/embeddings/test_huggingface_hub.py b/libs/community/tests/integration_tests/embeddings/test_huggingface_hub.pyindex 8ac2e41b5a..813b4834e6 100644--- a/libs/community/tests/integration_tests/embeddings/test_huggingface_hub.py+++ b/libs/community/tests/integration_tests/embeddings/test_huggingface_hub.py@@ -8,7 +8,7 @@ from langchain_community.embeddings import HuggingFaceHubEmbeddingsdef test_huggingfacehub_embedding_documents() -> None:"""Test huggingfacehub embeddings."""documents = ["foo bar"]- embedding = HuggingFaceHubEmbeddings() # type: ignore[call-arg]+ embedding = HuggingFaceHubEmbeddings()output = embedding.embed_documents(documents)assert len(output) == 1assert len(output[0]) == 768@@ -17,7 +17,7 @@ def test_huggingfacehub_embedding_documents() -> None:async def test_huggingfacehub_embedding_async_documents() -> None:"""Test huggingfacehub embeddings."""documents = ["foo bar"]- embedding = HuggingFaceHubEmbeddings() # type: ignore[call-arg]+ embedding = HuggingFaceHubEmbeddings()output = await embedding.aembed_documents(documents)assert len(output) == 1assert len(output[0]) == 768@@ -26,7 +26,7 @@ async def test_huggingfacehub_embedding_async_documents() -> None:def test_huggingfacehub_embedding_query() -> None:"""Test huggingfacehub embeddings."""document = "foo bar"- embedding = HuggingFaceHubEmbeddings() # type: ignore[call-arg]+ embedding = HuggingFaceHubEmbeddings()output = embedding.embed_query(document)assert len(output) == 768@@ -34,7 +34,7 @@ def test_huggingfacehub_embedding_query() -> None:async def test_huggingfacehub_embedding_async_query() -> None:"""Test huggingfacehub embeddings."""document = "foo bar"- embedding = HuggingFaceHubEmbeddings() # type: ignore[call-arg]+ embedding = HuggingFaceHubEmbeddings()output = await embedding.aembed_query(document)assert len(output) == 768@@ -43,4 +43,4 @@ def test_huggingfacehub_embedding_invalid_repo() -> None:"""Test huggingfacehub embedding repo id validation."""# Only sentence-transformers models are currently supported.with pytest.raises(ValueError):- HuggingFaceHubEmbeddings(repo_id="allenai/specter") # type: ignore[call-arg]+ HuggingFaceHubEmbeddings(repo_id="allenai/specter")diff --git a/libs/community/tests/integration_tests/embeddings/test_laser.py b/libs/community/tests/integration_tests/embeddings/test_laser.pyindex df8e83bdd2..d3331d3a30 100644--- a/libs/community/tests/integration_tests/embeddings/test_laser.py+++ b/libs/community/tests/integration_tests/embeddings/test_laser.py@@ -12,10 +12,10 @@ def test_laser_embedding_documents(lang: str) -> None:User warning is returned by LASER library implementationso will ignore in testing."""documents = ["hello", "world"]- embedding = LaserEmbeddings(lang=lang) # type: ignore[call-arg]+ embedding = LaserEmbeddings(lang=lang)output = embedding.embed_documents(documents)- assert len(output) == 2 # type: ignore[arg-type]- assert len(output[0]) == 1024 # type: ignore[index]+ assert len(output) == 2+ assert len(output[0]) == 1024@pytest.mark.filterwarnings("ignore::UserWarning:")@@ -25,6 +25,6 @@ def test_laser_embedding_query(lang: str) -> None:User warning is returned by LASER library implementationso will ignore in testing."""query = "hello world"- embedding = LaserEmbeddings(lang=lang) # type: ignore[call-arg]+ embedding = LaserEmbeddings(lang=lang)output = embedding.embed_query(query)assert len(output) == 1024diff --git a/libs/community/tests/integration_tests/embeddings/test_minimax.py b/libs/community/tests/integration_tests/embeddings/test_minimax.pyindex 3bb949d953..c00ef608be 100644--- a/libs/community/tests/integration_tests/embeddings/test_minimax.py+++ b/libs/community/tests/integration_tests/embeddings/test_minimax.py@@ -10,9 +10,9 @@ def test_initialization_with_alias() -> None:api_key = "your-api-key"group_id = "your-group-id"- embeddings = MiniMaxEmbeddings( # type: ignore[arg-type, call-arg]+ embeddings = MiniMaxEmbeddings(api_key=api_key, # type: ignore[arg-type]- group_id=group_id, # type: ignore[arg-type]+ group_id=group_id,)assert cast(SecretStr, embeddings.minimax_api_key).get_secret_value() == api_keydiff --git a/libs/community/tests/integration_tests/embeddings/test_openai.py b/libs/community/tests/integration_tests/embeddings/test_openai.pyindex 739b12593f..ac6c0a6f8b 100644--- a/libs/community/tests/integration_tests/embeddings/test_openai.py+++ b/libs/community/tests/integration_tests/embeddings/test_openai.py@@ -71,7 +71,7 @@ def test_openai_embedding_with_empty_string() -> None:output = embedding.embed_documents(document)assert len(output) == 2assert len(output[0]) == 1536- expected_output = openai.Embedding.create(input="", model="text-embedding-ada-002")[ # type: ignore[attr-defined]+ expected_output = openai.Embedding.create(input="", model="text-embedding-ada-002")["data"][0]["embedding"]assert np.allclose(output[0], expected_output)diff --git a/libs/community/tests/integration_tests/embeddings/test_qianfan_endpoint.py b/libs/community/tests/integration_tests/embeddings/test_qianfan_endpoint.pyindex 6be6ecc5f8..ba2d86c8f7 100644--- a/libs/community/tests/integration_tests/embeddings/test_qianfan_endpoint.py+++ b/libs/community/tests/integration_tests/embeddings/test_qianfan_endpoint.py@@ -11,7 +11,7 @@ from langchain_community.embeddings.baidu_qianfan_endpoint import (def test_embedding_multiple_documents() -> None:documents = ["foo", "bar"]- embedding = QianfanEmbeddingsEndpoint() # type: ignore[call-arg]+ embedding = QianfanEmbeddingsEndpoint()output = embedding.embed_documents(documents)assert len(output) == 2assert len(output[0]) == 384@@ -20,20 +20,20 @@ def test_embedding_multiple_documents() -> None:def test_embedding_query() -> None:query = "foo"- embedding = QianfanEmbeddingsEndpoint() # type: ignore[call-arg]+ embedding = QianfanEmbeddingsEndpoint()output = embedding.embed_query(query)assert len(output) == 384def test_model() -> None:documents = ["hi", "qianfan"]- embedding = QianfanEmbeddingsEndpoint(model="Embedding-V1") # type: ignore[call-arg]+ embedding = QianfanEmbeddingsEndpoint(model="Embedding-V1")output = embedding.embed_documents(documents)assert len(output) == 2def test_rate_limit() -> None:- llm = QianfanEmbeddingsEndpoint( # type: ignore[call-arg]+ llm = QianfanEmbeddingsEndpoint(model="Embedding-V1", init_kwargs={"query_per_second": 2})assert llm.client._client._rate_limiter._sync_limiter._query_per_second == 2@@ -49,7 +49,7 @@ def test_initialization_with_alias() -> None:api_key = "your-api-key"secret_key = "your-secret-key"- embeddings = QianfanEmbeddingsEndpoint( # type: ignore[arg-type, call-arg]+ embeddings = QianfanEmbeddingsEndpoint(api_key=api_key, # type: ignore[arg-type]secret_key=secret_key, # type: ignore[arg-type])diff --git a/libs/community/tests/integration_tests/embeddings/test_self_hosted.py b/libs/community/tests/integration_tests/embeddings/test_self_hosted.pyindex 1bf681d225..8cf67c4e92 100644--- a/libs/community/tests/integration_tests/embeddings/test_self_hosted.py+++ b/libs/community/tests/integration_tests/embeddings/test_self_hosted.py@@ -78,7 +78,7 @@ def test_self_hosted_embedding_documents() -> None:"""Test self-hosted huggingface instruct embeddings."""documents = ["foo bar"] * 2gpu = get_remote_instance()- embedding = SelfHostedEmbeddings( # type: ignore[call-arg]+ embedding = SelfHostedEmbeddings(model_load_fn=get_pipeline, hardware=gpu, inference_fn=inference_fn)output = embedding.embed_documents(documents)@@ -90,7 +90,7 @@ def test_self_hosted_embedding_query() -> None:"""Test self-hosted custom embeddings."""query = "foo bar"gpu = get_remote_instance()- embedding = SelfHostedEmbeddings( # type: ignore[call-arg]+ embedding = SelfHostedEmbeddings(model_load_fn=get_pipeline, hardware=gpu, inference_fn=inference_fn)output = embedding.embed_query(query)diff --git a/libs/community/tests/integration_tests/embeddings/test_sparkllm.py b/libs/community/tests/integration_tests/embeddings/test_sparkllm.pyindex 6c6581ca78..06589b3fb0 100644--- a/libs/community/tests/integration_tests/embeddings/test_sparkllm.py+++ b/libs/community/tests/integration_tests/embeddings/test_sparkllm.py@@ -18,7 +18,7 @@ def test_baichuan_embedding_documents() -> None:"understand and think, ""creating a better world with artificial intelligence."]- embedding = SparkLLMTextEmbeddings() # type: ignore[call-arg]+ embedding = SparkLLMTextEmbeddings()output = embedding.embed_documents(documents)assert len(output) == 1 # type: ignore[arg-type]assert len(output[0]) == 2560 # type: ignore[index]@@ -31,6 +31,6 @@ def test_baichuan_embedding_query() -> None:"first Artificial Intelligence open platform for Mobile Internet ""and intelligent hardware developers")- embedding = SparkLLMTextEmbeddings() # type: ignore[call-arg]+ embedding = SparkLLMTextEmbeddings()output = embedding.embed_query(document)assert len(output) == 2560 # type: ignore[arg-type]diff --git a/libs/community/tests/integration_tests/embeddings/test_zhipuai.py b/libs/community/tests/integration_tests/embeddings/test_zhipuai.pyindex 894088832a..72dc5ec539 100644--- a/libs/community/tests/integration_tests/embeddings/test_zhipuai.py+++ b/libs/community/tests/integration_tests/embeddings/test_zhipuai.py@@ -8,8 +8,8 @@ def test_zhipuai_embedding_documents() -> None:documents = ["This is a test query1.", "This is a test query2."]embedding = ZhipuAIEmbeddings() # type: ignore[call-arg]res = embedding.embed_documents(documents)- assert len(res) == 2 # type: ignore[arg-type]- assert len(res[0]) == 1024 # type: ignore[index]+ assert len(res) == 2+ assert len(res[0]) == 1024def test_zhipuai_embedding_query() -> None:@@ -17,7 +17,7 @@ def test_zhipuai_embedding_query() -> None:document = "This is a test query."embedding = ZhipuAIEmbeddings() # type: ignore[call-arg]res = embedding.embed_query(document)- assert len(res) == 1024 # type: ignore[arg-type]+ assert len(res) == 1024def test_zhipuai_embedding_dimensions() -> None:@@ -28,4 +28,4 @@ def test_zhipuai_embedding_dimensions() -> None:dimensions=2048,) # type: ignore[call-arg]res = embedding.embed_query(document)- assert len(res) == 2048 # type: ignore[arg-type]+ assert len(res) == 2048diff --git a/libs/community/tests/integration_tests/llms/test_aleph_alpha.py b/libs/community/tests/integration_tests/llms/test_aleph_alpha.pyindex 3ccafb99bb..56d6aad2af 100644--- a/libs/community/tests/integration_tests/llms/test_aleph_alpha.py+++ b/libs/community/tests/integration_tests/llms/test_aleph_alpha.py@@ -5,6 +5,6 @@ from langchain_community.llms.aleph_alpha import AlephAlphadef test_aleph_alpha_call() -> None:"""Test valid call to cohere."""- llm = AlephAlpha(maximum_tokens=10) # type: ignore[call-arg]+ llm = AlephAlpha(maximum_tokens=10)output = llm.invoke("Say foo:")assert isinstance(output, str)diff --git a/libs/community/tests/integration_tests/llms/test_cohere.py b/libs/community/tests/integration_tests/llms/test_cohere.pyindex 02404d2066..e5e2857c0d 100644--- a/libs/community/tests/integration_tests/llms/test_cohere.py+++ b/libs/community/tests/integration_tests/llms/test_cohere.py@@ -12,7 +12,7 @@ from tests.integration_tests.llms.utils import assert_llm_equalitydef test_cohere_call() -> None:"""Test valid call to cohere."""- llm = Cohere(max_tokens=10) # type: ignore[call-arg]+ llm = Cohere(max_tokens=10)output = llm.invoke("Say foo:")assert isinstance(output, str)@@ -20,16 +20,16 @@ def test_cohere_call() -> None:def test_cohere_api_key(monkeypatch: MonkeyPatch) -> None:"""Test that cohere api key is a secret key."""# test initialization from init- assert isinstance(Cohere(cohere_api_key="1").cohere_api_key, SecretStr) # type: ignore[arg-type, call-arg]+ assert isinstance(Cohere(cohere_api_key="1").cohere_api_key, SecretStr) # type: ignore[arg-type]# test initialization from env variablemonkeypatch.setenv("COHERE_API_KEY", "secret-api-key")- assert isinstance(Cohere().cohere_api_key, SecretStr) # type: ignore[call-arg]+ assert isinstance(Cohere().cohere_api_key, SecretStr)def test_saving_loading_llm(tmp_path: Path) -> None:"""Test saving/loading an Cohere LLM."""- llm = Cohere(max_tokens=10) # type: ignore[call-arg]+ llm = Cohere(max_tokens=10)llm.save(file_path=tmp_path / "cohere.yaml")loaded_llm = load_llm(tmp_path / "cohere.yaml")assert_llm_equality(llm, loaded_llm)diff --git a/libs/community/tests/integration_tests/llms/test_gooseai.py b/libs/community/tests/integration_tests/llms/test_gooseai.pyindex 13ee8b79d4..bbb1413679 100644--- a/libs/community/tests/integration_tests/llms/test_gooseai.py+++ b/libs/community/tests/integration_tests/llms/test_gooseai.py@@ -5,14 +5,14 @@ from langchain_community.llms.gooseai import GooseAIdef test_gooseai_call() -> None:"""Test valid call to gooseai."""- llm = GooseAI(max_tokens=10) # type: ignore[call-arg]+ llm = GooseAI(max_tokens=10)output = llm.invoke("Say foo:")assert isinstance(output, str)def test_gooseai_call_fairseq() -> None:"""Test valid call to gooseai with fairseq model."""- llm = GooseAI(model_name="fairseq-1-3b", max_tokens=10) # type: ignore[call-arg]+ llm = GooseAI(model_name="fairseq-1-3b", max_tokens=10)output = llm.invoke("Say foo:")assert isinstance(output, str)@@ -22,7 +22,7 @@ def test_gooseai_stop_valid() -> None:query = "write an ordered list of five items"first_llm = GooseAI(stop="3", temperature=0) # type: ignore[call-arg]first_output = first_llm.invoke(query)- second_llm = GooseAI(temperature=0) # type: ignore[call-arg]+ second_llm = GooseAI(temperature=0)second_output = second_llm.invoke(query, stop=["3"])# Because it stops on new lines, shouldn't return anythingassert first_output == second_outputdiff --git a/libs/community/tests/integration_tests/llms/test_huggingface_hub.py b/libs/community/tests/integration_tests/llms/test_huggingface_hub.pyindex 678c9c7a80..999f92ad41 100644--- a/libs/community/tests/integration_tests/llms/test_huggingface_hub.py+++ b/libs/community/tests/integration_tests/llms/test_huggingface_hub.py@@ -11,35 +11,35 @@ from tests.integration_tests.llms.utils import assert_llm_equalitydef test_huggingface_text_generation() -> None:"""Test valid call to HuggingFace text generation model."""- llm = HuggingFaceHub(repo_id="gpt2", model_kwargs={"max_new_tokens": 10}) # type: ignore[call-arg]+ llm = HuggingFaceHub(repo_id="gpt2", model_kwargs={"max_new_tokens": 10})output = llm.invoke("Say foo:")assert isinstance(output, str)def test_huggingface_text2text_generation() -> None:"""Test valid call to HuggingFace text2text model."""- llm = HuggingFaceHub(repo_id="google/flan-t5-xl") # type: ignore[call-arg]+ llm = HuggingFaceHub(repo_id="google/flan-t5-xl")output = llm.invoke("The capital of New York is")assert output == "Albany"def test_huggingface_summarization() -> None:"""Test valid call to HuggingFace summarization model."""- llm = HuggingFaceHub(repo_id="facebook/bart-large-cnn") # type: ignore[call-arg]+ llm = HuggingFaceHub(repo_id="facebook/bart-large-cnn")output = llm.invoke("Say foo:")assert isinstance(output, str)def test_huggingface_call_error() -> None:"""Test valid call to HuggingFace that errors."""- llm = HuggingFaceHub(model_kwargs={"max_new_tokens": -1}) # type: ignore[call-arg]+ llm = HuggingFaceHub(model_kwargs={"max_new_tokens": -1})with pytest.raises(ValueError):llm.invoke("Say foo:")def test_saving_loading_llm(tmp_path: Path) -> None:"""Test saving/loading an HuggingFaceHub LLM."""- llm = HuggingFaceHub(repo_id="gpt2", model_kwargs={"max_new_tokens": 10}) # type: ignore[call-arg]+ llm = HuggingFaceHub(repo_id="gpt2", model_kwargs={"max_new_tokens": 10})llm.save(file_path=tmp_path / "hf.yaml")loaded_llm = load_llm(tmp_path / "hf.yaml")assert_llm_equality(llm, loaded_llm)diff --git a/libs/community/tests/integration_tests/llms/test_nlpcloud.py b/libs/community/tests/integration_tests/llms/test_nlpcloud.pyindex 3645359e85..30083ec968 100644--- a/libs/community/tests/integration_tests/llms/test_nlpcloud.py+++ b/libs/community/tests/integration_tests/llms/test_nlpcloud.py@@ -13,14 +13,14 @@ from tests.integration_tests.llms.utils import assert_llm_equalitydef test_nlpcloud_call() -> None:"""Test valid call to nlpcloud."""- llm = NLPCloud(max_length=10) # type: ignore[call-arg]+ llm = NLPCloud(max_length=10)output = llm.invoke("Say foo:")assert isinstance(output, str)def test_saving_loading_llm(tmp_path: Path) -> None:"""Test saving/loading an NLPCloud LLM."""- llm = NLPCloud(max_length=10) # type: ignore[call-arg]+ llm = NLPCloud(max_length=10)llm.save(file_path=tmp_path / "nlpcloud.yaml")loaded_llm = load_llm(tmp_path / "nlpcloud.yaml")assert_llm_equality(llm, loaded_llm)@@ -29,10 +29,10 @@ def test_saving_loading_llm(tmp_path: Path) -> None:def test_nlpcloud_api_key(monkeypatch: MonkeyPatch, capsys: CaptureFixture) -> None:"""Test that nlpcloud api key is a secret key."""# test initialization from init- assert isinstance(NLPCloud(nlpcloud_api_key="1").nlpcloud_api_key, SecretStr) # type: ignore[arg-type, call-arg]+ assert isinstance(NLPCloud(nlpcloud_api_key="1").nlpcloud_api_key, SecretStr) # type: ignore[arg-type]monkeypatch.setenv("NLPCLOUD_API_KEY", "secret-api-key")- llm = NLPCloud() # type: ignore[call-arg]+ llm = NLPCloud()assert isinstance(llm.nlpcloud_api_key, SecretStr)assert cast(SecretStr, llm.nlpcloud_api_key).get_secret_value() == "secret-api-key"diff --git a/libs/community/tests/integration_tests/llms/test_petals.py b/libs/community/tests/integration_tests/llms/test_petals.pyindex 1689efb26b..9192306093 100644--- a/libs/community/tests/integration_tests/llms/test_petals.py+++ b/libs/community/tests/integration_tests/llms/test_petals.py@@ -7,14 +7,14 @@ from langchain_community.llms.petals import Petalsdef test_api_key_is_string() -> None:- llm = Petals(huggingface_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = Petals(huggingface_api_key="secret-api-key") # type: ignore[arg-type]assert isinstance(llm.huggingface_api_key, SecretStr)def test_api_key_masked_when_passed_via_constructor(capsys: CaptureFixture,) -> None:- llm = Petals(huggingface_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = Petals(huggingface_api_key="secret-api-key") # type: ignore[arg-type]print(llm.huggingface_api_key, end="") # noqa: T201captured = capsys.readouterr()@@ -23,6 +23,6 @@ def test_api_key_masked_when_passed_via_constructor(def test_gooseai_call() -> None:"""Test valid call to gooseai."""- llm = Petals(max_new_tokens=10) # type: ignore[call-arg]+ llm = Petals(max_new_tokens=10)output = llm.invoke("Say foo:")assert isinstance(output, str)diff --git a/libs/community/tests/integration_tests/llms/test_predictionguard.py b/libs/community/tests/integration_tests/llms/test_predictionguard.pyindex 3907c1dd50..c49c1e0176 100644--- a/libs/community/tests/integration_tests/llms/test_predictionguard.py+++ b/libs/community/tests/integration_tests/llms/test_predictionguard.py@@ -7,7 +7,7 @@ from langchain_community.llms.predictionguard import PredictionGuarddef test_predictionguard_invoke() -> None:"""Test valid call to prediction guard."""- llm = PredictionGuard(model="Hermes-3-Llama-3.1-8B") # type: ignore[call-arg]+ llm = PredictionGuard(model="Hermes-3-Llama-3.1-8B")output = llm.invoke("Tell a joke.")assert isinstance(output, str)diff --git a/libs/community/tests/integration_tests/llms/test_qianfan_endpoint.py b/libs/community/tests/integration_tests/llms/test_qianfan_endpoint.pyindex 35c63e8d87..38dc831cd8 100644--- a/libs/community/tests/integration_tests/llms/test_qianfan_endpoint.py+++ b/libs/community/tests/integration_tests/llms/test_qianfan_endpoint.py@@ -10,14 +10,14 @@ from langchain_community.llms.baidu_qianfan_endpoint import QianfanLLMEndpointdef test_call() -> None:"""Test valid call to qianfan."""- llm = QianfanLLMEndpoint() # type: ignore[call-arg]+ llm = QianfanLLMEndpoint()output = llm.invoke("write a joke")assert isinstance(output, str)def test_generate() -> None:"""Test valid call to qianfan."""- llm = QianfanLLMEndpoint() # type: ignore[call-arg]+ llm = QianfanLLMEndpoint()output = llm.generate(["write a joke"])assert isinstance(output, LLMResult)assert isinstance(output.generations, list)@@ -25,20 +25,20 @@ def test_generate() -> None:def test_generate_stream() -> None:"""Test valid call to qianfan."""- llm = QianfanLLMEndpoint() # type: ignore[call-arg]+ llm = QianfanLLMEndpoint()output = llm.stream("write a joke")assert isinstance(output, Generator)async def test_qianfan_aio() -> None:- llm = QianfanLLMEndpoint(streaming=True) # type: ignore[call-arg]+ llm = QianfanLLMEndpoint(streaming=True)async for token in llm.astream("hi qianfan."):assert isinstance(token, str)def test_rate_limit() -> None:- llm = QianfanLLMEndpoint(model="ERNIE-Bot", init_kwargs={"query_per_second": 2}) # type: ignore[call-arg]+ llm = QianfanLLMEndpoint(model="ERNIE-Bot", init_kwargs={"query_per_second": 2})assert llm.client._client._rate_limiter._sync_limiter._query_per_second == 2output = llm.generate(["write a joke"])assert isinstance(output, LLMResult)@@ -47,11 +47,11 @@ def test_rate_limit() -> None:def test_qianfan_with_param_alias() -> None:"""Test with qianfan llm parameter alias."""- llm = QianfanLLMEndpoint( # type: ignore[call-arg]+ llm = QianfanLLMEndpoint(api_key="your-api-key", # type: ignore[arg-type]secret_key="your-secret-key", # type: ignore[arg-type]timeout=50,- ) # type: ignore[call-arg]+ )assert cast(SecretStr, llm.qianfan_ak).get_secret_value() == "your-api-key"assert cast(SecretStr, llm.qianfan_sk).get_secret_value() == "your-secret-key"assert llm.request_timeout == 50diff --git a/libs/community/tests/integration_tests/llms/test_sparkllm.py b/libs/community/tests/integration_tests/llms/test_sparkllm.pyindex 8bcd28f4df..2f9896f946 100644--- a/libs/community/tests/integration_tests/llms/test_sparkllm.py+++ b/libs/community/tests/integration_tests/llms/test_sparkllm.py@@ -22,7 +22,7 @@ def test_generate() -> None:def test_spark_llm_with_param_alias() -> None:"""Test SparkLLM with parameters alias."""- llm = SparkLLM( # type: ignore[call-arg]+ llm = SparkLLM(app_id="your-app-id",api_key="your-api-key",api_secret="your-api-secret",@@ -40,6 +40,6 @@ def test_spark_llm_with_param_alias() -> None:def test_spark_llm_with_stream() -> None:"""Test SparkLLM with stream."""- llm = SparkLLM() # type: ignore[call-arg]+ llm = SparkLLM()for chunk in llm.stream("你好呀"):assert isinstance(chunk, str)diff --git a/libs/community/tests/integration_tests/llms/test_tongyi.py b/libs/community/tests/integration_tests/llms/test_tongyi.pyindex 99e8c5f87b..e7b6ec0e72 100644--- a/libs/community/tests/integration_tests/llms/test_tongyi.py+++ b/libs/community/tests/integration_tests/llms/test_tongyi.py@@ -7,14 +7,14 @@ from langchain_community.llms.tongyi import Tongyidef test_tongyi_call() -> None:"""Test valid call to tongyi."""- llm = Tongyi() # type: ignore[call-arg]+ llm = Tongyi()output = llm.invoke("who are you")assert isinstance(output, str)def test_tongyi_generate() -> None:"""Test valid call to tongyi."""- llm = Tongyi() # type: ignore[call-arg]+ llm = Tongyi()output = llm.generate(["who are you"])assert isinstance(output, LLMResult)assert isinstance(output.generations, list)@@ -22,7 +22,7 @@ def test_tongyi_generate() -> None:def test_tongyi_generate_stream() -> None:"""Test valid call to tongyi."""- llm = Tongyi(streaming=True) # type: ignore[call-arg]+ llm = Tongyi(streaming=True)output = llm.generate(["who are you"])print(output) # noqa: T201assert isinstance(output, LLMResult)@@ -31,6 +31,6 @@ def test_tongyi_generate_stream() -> None:def test_tongyi_with_param_alias() -> None:"""Test tongyi parameters alias"""- llm = Tongyi(model="qwen-max", api_key="your-api_key") # type: ignore[call-arg]+ llm = Tongyi(model="qwen-max", api_key="your-api_key")assert llm.model_name == "qwen-max"assert llm.dashscope_api_key == "your-api_key"diff --git a/libs/community/tests/integration_tests/llms/test_volcengine_maas.py b/libs/community/tests/integration_tests/llms/test_volcengine_maas.pyindex 321e830eeb..4702a7a703 100644--- a/libs/community/tests/integration_tests/llms/test_volcengine_maas.py+++ b/libs/community/tests/integration_tests/llms/test_volcengine_maas.py@@ -13,7 +13,7 @@ from langchain_community.llms.volcengine_maas import (def test_api_key_is_string() -> None:- llm = VolcEngineMaasBase( # type: ignore[call-arg]+ llm = VolcEngineMaasBase(volc_engine_maas_ak="secret-volc-ak", # type: ignore[arg-type]volc_engine_maas_sk="secret-volc-sk", # type: ignore[arg-type])@@ -24,7 +24,7 @@ def test_api_key_is_string() -> None:def test_api_key_masked_when_passed_via_constructor(capsys: CaptureFixture,) -> None:- llm = VolcEngineMaasBase( # type: ignore[call-arg]+ llm = VolcEngineMaasBase(volc_engine_maas_ak="secret-volc-ak", # type: ignore[arg-type]volc_engine_maas_sk="secret-volc-sk", # type: ignore[arg-type])@@ -36,14 +36,14 @@ def test_api_key_masked_when_passed_via_constructor(def test_default_call() -> None:"""Test valid call to volc engine."""- llm = VolcEngineMaasLLM() # type: ignore[call-arg]+ llm = VolcEngineMaasLLM()output = llm.invoke("tell me a joke")assert isinstance(output, str)def test_generate() -> None:"""Test valid call to volc engine."""- llm = VolcEngineMaasLLM() # type: ignore[call-arg]+ llm = VolcEngineMaasLLM()output = llm.generate(["tell me a joke"])assert isinstance(output, LLMResult)assert isinstance(output.generations, list)@@ -51,6 +51,6 @@ def test_generate() -> None:def test_generate_stream() -> None:"""Test valid call to volc engine."""- llm = VolcEngineMaasLLM(streaming=True) # type: ignore[call-arg]+ llm = VolcEngineMaasLLM(streaming=True)output = llm.stream("tell me a joke")assert isinstance(output, Generator)diff --git a/libs/community/tests/integration_tests/test_dalle.py b/libs/community/tests/integration_tests/test_dalle.pyindex e5f1967785..c2262f4e2d 100644--- a/libs/community/tests/integration_tests/test_dalle.py+++ b/libs/community/tests/integration_tests/test_dalle.py@@ -5,6 +5,6 @@ from langchain_community.utilities.dalle_image_generator import DallEAPIWrapperdef test_call() -> None:"""Test that call returns a URL in the output."""- search = DallEAPIWrapper() # type: ignore[call-arg]+ search = DallEAPIWrapper()output = search.run("volcano island")assert "https://oaidalleapi" in outputdiff --git a/libs/community/tests/integration_tests/tools/edenai/test_audio_text_to_speech.py b/libs/community/tests/integration_tests/tools/edenai/test_audio_text_to_speech.pyindex dd76ffda82..6411fed472 100644--- a/libs/community/tests/integration_tests/tools/edenai/test_audio_text_to_speech.py+++ b/libs/community/tests/integration_tests/tools/edenai/test_audio_text_to_speech.py@@ -16,7 +16,7 @@ from langchain_community.tools.edenai import EdenAiTextToSpeechTooldef test_edenai_call() -> None:"""Test simple call to edenai's text to speech endpoint."""- text2speech = EdenAiTextToSpeechTool( # type: ignore[call-arg]+ text2speech = EdenAiTextToSpeechTool(providers=["amazon"], language="en", voice="MALE")diff --git a/libs/community/tests/integration_tests/tools/edenai/test_image_explicitcontent.py b/libs/community/tests/integration_tests/tools/edenai/test_image_explicitcontent.pyindex 2412286d6c..a95fb99b13 100644--- a/libs/community/tests/integration_tests/tools/edenai/test_image_explicitcontent.py+++ b/libs/community/tests/integration_tests/tools/edenai/test_image_explicitcontent.py@@ -14,7 +14,7 @@ from langchain_community.tools.edenai import EdenAiExplicitImageTooldef test_edenai_call() -> None:"""Test simple call to edenai's image moderation endpoint."""- image_moderation = EdenAiExplicitImageTool(providers=["amazon"]) # type: ignore[call-arg]+ image_moderation = EdenAiExplicitImageTool(providers=["amazon"])output = image_moderation.invoke("https://static.javatpoint.com/images/objects.jpg")diff --git a/libs/community/tests/integration_tests/tools/edenai/test_image_objectdetection.py b/libs/community/tests/integration_tests/tools/edenai/test_image_objectdetection.pyindex a8253256ab..0d3e62b6c0 100644--- a/libs/community/tests/integration_tests/tools/edenai/test_image_objectdetection.py+++ b/libs/community/tests/integration_tests/tools/edenai/test_image_objectdetection.py@@ -14,7 +14,7 @@ from langchain_community.tools.edenai import EdenAiObjectDetectionTooldef test_edenai_call() -> None:"""Test simple call to edenai's object detection endpoint."""- object_detection = EdenAiObjectDetectionTool(providers=["google"]) # type: ignore[call-arg]+ object_detection = EdenAiObjectDetectionTool(providers=["google"])output = object_detection.invoke("https://static.javatpoint.com/images/objects.jpg")diff --git a/libs/community/tests/integration_tests/tools/edenai/test_ocr_identityparser.py b/libs/community/tests/integration_tests/tools/edenai/test_ocr_identityparser.pyindex 104cc6efa6..91bd110f44 100644--- a/libs/community/tests/integration_tests/tools/edenai/test_ocr_identityparser.py+++ b/libs/community/tests/integration_tests/tools/edenai/test_ocr_identityparser.py@@ -14,7 +14,7 @@ from langchain_community.tools.edenai import EdenAiParsingIDTooldef test_edenai_call() -> None:"""Test simple call to edenai's identity parser endpoint."""- id_parser = EdenAiParsingIDTool(providers=["amazon"], language="en") # type: ignore[call-arg]+ id_parser = EdenAiParsingIDTool(providers=["amazon"], language="en")output = id_parser.invoke("https://www.citizencard.com/images/citizencard-uk-id-card-2023.jpg"diff --git a/libs/community/tests/integration_tests/tools/edenai/test_ocr_invoiceparser.py b/libs/community/tests/integration_tests/tools/edenai/test_ocr_invoiceparser.pyindex 9dc989214c..80b8d36b3c 100644--- a/libs/community/tests/integration_tests/tools/edenai/test_ocr_invoiceparser.py+++ b/libs/community/tests/integration_tests/tools/edenai/test_ocr_invoiceparser.py@@ -14,7 +14,7 @@ from langchain_community.tools.edenai import EdenAiParsingInvoiceTooldef test_edenai_call() -> None:"""Test simple call to edenai's invoice parser endpoint."""- invoice_parser = EdenAiParsingInvoiceTool(providers=["amazon"], language="en") # type: ignore[call-arg]+ invoice_parser = EdenAiParsingInvoiceTool(providers=["amazon"], language="en")output = invoice_parser.invoke("https://app.edenai.run/assets/img/data_1.72e3bdcc.png"diff --git a/libs/community/tests/integration_tests/tools/edenai/test_text_moderation.py b/libs/community/tests/integration_tests/tools/edenai/test_text_moderation.pyindex e903276d86..97134576e9 100644--- a/libs/community/tests/integration_tests/tools/edenai/test_text_moderation.py+++ b/libs/community/tests/integration_tests/tools/edenai/test_text_moderation.py@@ -15,7 +15,7 @@ from langchain_community.tools.edenai.text_moderation import EdenAiTextModeratiodef test_edenai_call() -> None:"""Test simple call to edenai's text moderation endpoint."""- text_moderation = EdenAiTextModerationTool(providers=["openai"], language="en") # type: ignore[call-arg]+ text_moderation = EdenAiTextModerationTool(providers=["openai"], language="en")output = text_moderation.invoke("i hate you")diff --git a/libs/community/tests/integration_tests/utilities/test_dataherald_api.py b/libs/community/tests/integration_tests/utilities/test_dataherald_api.pyindex 7ead67e9cc..57a8107af9 100644--- a/libs/community/tests/integration_tests/utilities/test_dataherald_api.py+++ b/libs/community/tests/integration_tests/utilities/test_dataherald_api.py@@ -5,6 +5,6 @@ from langchain_community.utilities.dataherald import DataheraldAPIWrapperdef test_call() -> None:"""Test that call gives the correct answer."""- search = DataheraldAPIWrapper(db_connection_id="65fb766367dd22c99ce1a12d") # type: ignore[call-arg]+ search = DataheraldAPIWrapper(db_connection_id="65fb766367dd22c99ce1a12d")output = search.run("How many employees are in the company?")assert "Answer: SELECT \n COUNT(*) FROM \n employees" in outputdiff --git a/libs/community/tests/integration_tests/utilities/test_github.py b/libs/community/tests/integration_tests/utilities/test_github.pyindex 538112fa0a..cc59f47942 100644--- a/libs/community/tests/integration_tests/utilities/test_github.py+++ b/libs/community/tests/integration_tests/utilities/test_github.py@@ -13,7 +13,7 @@ from langchain_community.utilities.github import GitHubAPIWrapper@pytest.fixturedef api_client() -> GitHubAPIWrapper:- return GitHubAPIWrapper() # type: ignore[call-arg]+ return GitHubAPIWrapper()def test_get_open_issues(api_client: GitHubAPIWrapper) -> None:diff --git a/libs/community/tests/integration_tests/utilities/test_googlesearch_api.py b/libs/community/tests/integration_tests/utilities/test_googlesearch_api.pyindex 8868bfc6bc..b32d05e76b 100644--- a/libs/community/tests/integration_tests/utilities/test_googlesearch_api.py+++ b/libs/community/tests/integration_tests/utilities/test_googlesearch_api.py@@ -5,14 +5,14 @@ from langchain_community.utilities.google_search import GoogleSearchAPIWrapperdef test_call() -> None:"""Test that call gives the correct answer."""- search = GoogleSearchAPIWrapper() # type: ignore[call-arg]+ search = GoogleSearchAPIWrapper()output = search.run("What was Obama's first name?")assert "Barack Hussein Obama II" in outputdef test_no_result_call() -> None:"""Test that call gives no result."""- search = GoogleSearchAPIWrapper() # type: ignore[call-arg]+ search = GoogleSearchAPIWrapper()output = search.run("NORESULTCALL_NORESULTCALL_NORESULTCALL_NORESULTCALL_NORESULTCALL_NORESULTCALL")@@ -22,7 +22,7 @@ def test_no_result_call() -> None:def test_result_with_params_call() -> None:"""Test that call gives the correct answer with extra params."""- search = GoogleSearchAPIWrapper() # type: ignore[call-arg]+ search = GoogleSearchAPIWrapper()output = search.results(query="What was Obama's first name?",num_results=5,diff --git a/libs/community/tests/integration_tests/utilities/test_jira_api.py b/libs/community/tests/integration_tests/utilities/test_jira_api.pyindex 557c639e1b..e712afa57e 100644--- a/libs/community/tests/integration_tests/utilities/test_jira_api.py+++ b/libs/community/tests/integration_tests/utilities/test_jira_api.py@@ -6,14 +6,14 @@ from langchain_community.utilities.jira import JiraAPIWrapperdef test_search() -> None:"""Test for Searching issues on JIRA"""jql = "project = TP"- jira = JiraAPIWrapper() # type: ignore[call-arg]+ jira = JiraAPIWrapper()output = jira.run("jql", jql)assert "issues" in outputdef test_getprojects() -> None:"""Test for getting projects on JIRA"""- jira = JiraAPIWrapper() # type: ignore[call-arg]+ jira = JiraAPIWrapper()output = jira.run("get_projects", "")assert "projects" in output@@ -24,7 +24,7 @@ def test_create_ticket() -> None:'{"summary": "Test Summary", "description": "Test Description",'' "issuetype": {"name": "Bug"}, "project": {"key": "TP"}}')- jira = JiraAPIWrapper() # type: ignore[call-arg]+ jira = JiraAPIWrapper()output = jira.run("create_issue", issue_string)assert "id" in outputassert "key" in output@@ -32,7 +32,7 @@ def test_create_ticket() -> None:def test_create_confluence_page() -> None:"""Test for getting projects on JIRA"""- jira = JiraAPIWrapper() # type: ignore[call-arg]+ jira = JiraAPIWrapper()create_page_dict = ('{"space": "ROC", "title":"This is the title",''"body":"This is the body. You can use '@@ -46,7 +46,7 @@ def test_create_confluence_page() -> None:def test_other() -> None:"""Non-exhaustive test for accessing other JIRA API methods"""- jira = JiraAPIWrapper() # type: ignore[call-arg]+ jira = JiraAPIWrapper()issue_create_dict = """{"function":"issue_create",diff --git a/libs/community/tests/integration_tests/utilities/test_openweathermap.py b/libs/community/tests/integration_tests/utilities/test_openweathermap.pyindex 5a4415f8ff..9f6e1f2c0f 100644--- a/libs/community/tests/integration_tests/utilities/test_openweathermap.py+++ b/libs/community/tests/integration_tests/utilities/test_openweathermap.py@@ -4,7 +4,7 @@ from langchain_community.utilities.openweathermap import OpenWeatherMapAPIWrappedef test_openweathermap_api_wrapper() -> None:"""Test that OpenWeatherMapAPIWrapper returns correct data for London, GB."""- weather = OpenWeatherMapAPIWrapper() # type: ignore[call-arg]+ weather = OpenWeatherMapAPIWrapper()weather_data = weather.run("London,GB")assert weather_data is not Nonediff --git a/libs/community/tests/integration_tests/utilities/test_steam_api.py b/libs/community/tests/integration_tests/utilities/test_steam_api.pyindex 96de47eeb4..be61f5f1ab 100644--- a/libs/community/tests/integration_tests/utilities/test_steam_api.py+++ b/libs/community/tests/integration_tests/utilities/test_steam_api.py@@ -5,7 +5,7 @@ from langchain_community.utilities.steam import SteamWebAPIWrapperdef test_get_game_details() -> None:"""Test for getting game details on Steam"""- steam = SteamWebAPIWrapper() # type: ignore[call-arg]+ steam = SteamWebAPIWrapper()output = steam.run("get_game_details", "Terraria")assert "id" in outputassert "link" in output@@ -16,7 +16,7 @@ def test_get_game_details() -> None:def test_get_recommended_games() -> None:"""Test for getting recommended games on Steam"""- steam = SteamWebAPIWrapper() # type: ignore[call-arg]+ steam = SteamWebAPIWrapper()output = steam.run("get_recommended_games", "76561198362745711")output = ast.literal_eval(output)assert len(output) == 5diff --git a/libs/community/tests/integration_tests/utilities/test_twilio.py b/libs/community/tests/integration_tests/utilities/test_twilio.pyindex ba00f51d24..fa6b3ed20e 100644--- a/libs/community/tests/integration_tests/utilities/test_twilio.py+++ b/libs/community/tests/integration_tests/utilities/test_twilio.py@@ -5,6 +5,6 @@ from langchain_community.utilities.twilio import TwilioAPIWrapperdef test_call() -> None:"""Test that call runs."""- twilio = TwilioAPIWrapper() # type: ignore[call-arg]+ twilio = TwilioAPIWrapper()output = twilio.run("Message", "+16162904619")assert outputdiff --git a/libs/community/tests/integration_tests/utilities/test_wolfram_alpha_api.py b/libs/community/tests/integration_tests/utilities/test_wolfram_alpha_api.pyindex f6bc43f462..54d7255725 100644--- a/libs/community/tests/integration_tests/utilities/test_wolfram_alpha_api.py+++ b/libs/community/tests/integration_tests/utilities/test_wolfram_alpha_api.py@@ -5,6 +5,6 @@ from langchain_community.utilities.wolfram_alpha import WolframAlphaAPIWrapperdef test_call() -> None:"""Test that call gives the correct answer."""- search = WolframAlphaAPIWrapper() # type: ignore[call-arg]+ search = WolframAlphaAPIWrapper()output = search.run("what is 2x+18=x+5?")assert "x = -13" in outputdiff --git a/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.py b/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.pyindex ab7ecebd6d..83ff601bc1 100644--- a/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.py+++ b/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_add_texts.py@@ -43,7 +43,7 @@ async def test_qdrant_aadd_texts_stores_duplicated_texts(collection_name = uuid.uuid4().hexvectors_config = rest.VectorParams(size=10, distance=rest.Distance.COSINE)if vector_name is not None:- vectors_config = {vector_name: vectors_config} # type: ignore[assignment]+ vectors_config = {vector_name: vectors_config}client.recreate_collection(collection_name, vectors_config=vectors_config)vec_store = Qdrant(@@ -119,6 +119,6 @@ async def test_qdrant_aadd_texts_stores_embeddings_as_named_vectors(assert 5 == client.count(collection_name).countassert all(- vector_name in point.vector # type: ignore[operator]+ vector_name in point.vectorfor point in client.scroll(collection_name, with_vectors=True)[0])diff --git a/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.py b/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.pyindex 1ee99d40bd..bb787a7a2b 100644--- a/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.py+++ b/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/test_from_texts.py@@ -82,7 +82,7 @@ async def test_qdrant_from_texts_stores_embeddings_as_named_vectors(client = vec_store.clientassert 5 == client.count(collection_name).countassert all(- vector_name in point.vector # type: ignore[operator]+ vector_name in point.vectorfor point in client.scroll(collection_name, with_vectors=True)[0])@@ -221,8 +221,8 @@ async def test_qdrant_from_texts_recreates_collection_on_force_recreate(assert 2 == client.count(collection_name).countvector_params = client.get_collection(collection_name).config.params.vectorsif vector_name is not None:- vector_params = vector_params[vector_name] # type: ignore[index]- assert 5 == vector_params.size # type: ignore[union-attr]+ vector_params = vector_params[vector_name]+ assert 5 == vector_params.size@pytest.mark.parametrize("batch_size", [1, 64])diff --git a/libs/community/tests/integration_tests/vectorstores/qdrant/test_add_texts.py b/libs/community/tests/integration_tests/vectorstores/qdrant/test_add_texts.pyindex d3d73b3c6d..bf579feb71 100644--- a/libs/community/tests/integration_tests/vectorstores/qdrant/test_add_texts.py+++ b/libs/community/tests/integration_tests/vectorstores/qdrant/test_add_texts.py@@ -62,7 +62,7 @@ def test_qdrant_add_texts_stores_duplicated_texts(vector_name: Optional[str]) ->collection_name = uuid.uuid4().hexvectors_config = rest.VectorParams(size=10, distance=rest.Distance.COSINE)if vector_name is not None:- vectors_config = {vector_name: vectors_config} # type: ignore[assignment]+ vectors_config = {vector_name: vectors_config}client.recreate_collection(collection_name, vectors_config=vectors_config)vec_store = Qdrant(@@ -130,6 +130,6 @@ def test_qdrant_add_texts_stores_embeddings_as_named_vectors(vector_name: str) -assert 5 == client.count(collection_name).countassert all(- vector_name in point.vector # type: ignore[operator]+ vector_name in point.vectorfor point in client.scroll(collection_name, with_vectors=True)[0])diff --git a/libs/community/tests/integration_tests/vectorstores/qdrant/test_from_texts.py b/libs/community/tests/integration_tests/vectorstores/qdrant/test_from_texts.pyindex 27264c7356..dadc4ea004 100644--- a/libs/community/tests/integration_tests/vectorstores/qdrant/test_from_texts.py+++ b/libs/community/tests/integration_tests/vectorstores/qdrant/test_from_texts.py@@ -85,7 +85,7 @@ def test_qdrant_from_texts_stores_embeddings_as_named_vectors(vector_name: str)client = QdrantClient(path=str(tmpdir))assert 5 == client.count(collection_name).countassert all(- vector_name in point.vector # type: ignore[operator]+ vector_name in point.vectorfor point in client.scroll(collection_name, with_vectors=True)[0])diff --git a/libs/community/tests/integration_tests/vectorstores/test_azure_cosmos_db.py b/libs/community/tests/integration_tests/vectorstores/test_azure_cosmos_db.pyindex 2c7614f9b2..727dfbc1de 100644--- a/libs/community/tests/integration_tests/vectorstores/test_azure_cosmos_db.py+++ b/libs/community/tests/integration_tests/vectorstores/test_azure_cosmos_db.py@@ -84,19 +84,19 @@ class TestAzureCosmosDBVectorSearch:# ensure the test collection is emptycollection = prepare_collection()- assert collection.count_documents({}) == 0 # type: ignore[index]+ assert collection.count_documents({}) == 0@classmethoddef teardown_class(cls) -> None:collection = prepare_collection()# delete all the documents in the collection- collection.delete_many({}) # type: ignore[index]+ collection.delete_many({})@pytest.fixture(autouse=True)def setup(self) -> None:collection = prepare_collection()# delete all the documents in the collection- collection.delete_many({}) # type: ignore[index]+ collection.delete_many({})@pytest.fixture(scope="class", autouse=True)def cosmos_db_url(self) -> Union[str, Generator[str, None, None]]:diff --git a/libs/community/tests/integration_tests/vectorstores/test_chroma.py b/libs/community/tests/integration_tests/vectorstores/test_chroma.pyindex 1f93e11a11..706771d8ce 100644--- a/libs/community/tests/integration_tests/vectorstores/test_chroma.py+++ b/libs/community/tests/integration_tests/vectorstores/test_chroma.py@@ -206,7 +206,7 @@ def test_chroma_update_document() -> None:embedding=embedding,ids=[document_id],)- old_embedding = docsearch._collection.peek()["embeddings"][ # type: ignore[index]+ old_embedding = docsearch._collection.peek()["embeddings"][docsearch._collection.peek()["ids"].index(document_id)]@@ -226,7 +226,7 @@ def test_chroma_update_document() -> None:assert output == [Document(page_content=updated_content, metadata={"page": "0"})]# Assert that the new embedding is correct- new_embedding = docsearch._collection.peek()["embeddings"][ # type: ignore[index]+ new_embedding = docsearch._collection.peek()["embeddings"][docsearch._collection.peek()["ids"].index(document_id)]assert new_embedding == embedding.embed_documents([updated_content])[0]@@ -344,7 +344,7 @@ def test_chroma_large_batch() -> None:"my_collection",embedding_function=embedding_function.embed_documents,)- docs = ["This is a test document"] * (client.max_batch_size + 100) # type: ignore[attr-defined]+ docs = ["This is a test document"] * (client.max_batch_size + 100)Chroma.from_texts(client=client,collection_name=col.name,@@ -372,7 +372,7 @@ def test_chroma_large_batch_update() -> None:"my_collection",embedding_function=embedding_function.embed_documents,)- docs = ["This is a test document"] * (client.max_batch_size + 100) # type: ignore[attr-defined]+ docs = ["This is a test document"] * (client.max_batch_size + 100)ids = [str(uuid.uuid4()) for _ in range(len(docs))]db = Chroma.from_texts(client=client,diff --git a/libs/community/tests/integration_tests/vectorstores/test_documentdb.py b/libs/community/tests/integration_tests/vectorstores/test_documentdb.pyindex acb2670d1b..9227965e21 100644--- a/libs/community/tests/integration_tests/vectorstores/test_documentdb.py+++ b/libs/community/tests/integration_tests/vectorstores/test_documentdb.py@@ -71,20 +71,20 @@ class TestDocumentDBVectorSearch:# ensure the test collection is emptycollection = prepare_collection()- assert collection.count_documents({}) == 0 # type: ignore[index]+ assert collection.count_documents({}) == 0@classmethoddef teardown_class(cls) -> None:collection = prepare_collection()# delete all the documents in the collection- collection.delete_many({}) # type: ignore[index]+ collection.delete_many({})collection.drop_indexes()@pytest.fixture(autouse=True)def setup(self) -> None:collection = prepare_collection()# delete all the documents in the collection- collection.delete_many({}) # type: ignore[index]+ collection.delete_many({})collection.drop_indexes()def test_from_documents_cosine_distance(diff --git a/libs/community/tests/integration_tests/vectorstores/test_mongodb_atlas.py b/libs/community/tests/integration_tests/vectorstores/test_mongodb_atlas.pyindex a9c52d128a..fdf7747e18 100644--- a/libs/community/tests/integration_tests/vectorstores/test_mongodb_atlas.py+++ b/libs/community/tests/integration_tests/vectorstores/test_mongodb_atlas.py@@ -35,19 +35,19 @@ class TestMongoDBAtlasVectorSearch:def setup_class(cls) -> None:# ensure the test collection is emptycollection = get_collection()- assert collection.count_documents({}) == 0 # type: ignore[index]+ assert collection.count_documents({}) == 0@classmethoddef teardown_class(cls) -> None:collection = get_collection()# delete all the documents in the collection- collection.delete_many({}) # type: ignore[index]+ collection.delete_many({})@pytest.fixture(autouse=True)def setup(self) -> None:collection = get_collection()# delete all the documents in the collection- collection.delete_many({}) # type: ignore[index]+ collection.delete_many({})def test_from_documents(self, embedding_openai: Embeddings, collection: Anydiff --git a/libs/community/tests/integration_tests/vectorstores/test_singlestoredb.py b/libs/community/tests/integration_tests/vectorstores/test_singlestoredb.pyindex 8308adaa76..b9e23123be 100644--- a/libs/community/tests/integration_tests/vectorstores/test_singlestoredb.py+++ b/libs/community/tests/integration_tests/vectorstores/test_singlestoredb.py@@ -557,7 +557,7 @@ def test_singestoredb_add_image2() -> None:table_name = "test_singlestoredb_add_images"drop(table_name)docsearch = SingleStoreDB(- OpenCLIPEmbeddings(), # type: ignore[call-arg, call-arg, call-arg]+ OpenCLIPEmbeddings(),table_name=table_name,host=TEST_SINGLESTOREDB_URL,)diff --git a/libs/community/tests/integration_tests/vectorstores/test_tidb_vector.py b/libs/community/tests/integration_tests/vectorstores/test_tidb_vector.pyindex 0451bc50a6..d6803815c7 100644--- a/libs/community/tests/integration_tests/vectorstores/test_tidb_vector.py+++ b/libs/community/tests/integration_tests/vectorstores/test_tidb_vector.py@@ -324,7 +324,7 @@ def test_relevance_score() -> None:except ValueError:pass- docsearch_l2.drop_vectorstore() # type: ignore[attr-defined]+ docsearch_l2.drop_vectorstore()def test_retriever_search_threshold() -> None:diff --git a/libs/community/tests/integration_tests/vectorstores/test_vdms.py b/libs/community/tests/integration_tests/vectorstores/test_vdms.pyindex a453a0fc20..c389422ff7 100644--- a/libs/community/tests/integration_tests/vectorstores/test_vdms.py+++ b/libs/community/tests/integration_tests/vectorstores/test_vdms.py@@ -40,7 +40,7 @@ def vdms_client() -> vdms.vdms:@pytest.mark.requires("vdms")@pytest.mark.enable_socketdef test_init_from_client(vdms_client: vdms.vdms) -> None:- _ = VDMS( # type: ignore[call-arg]+ _ = VDMS(embedding=embedding_function,client=vdms_client,)@@ -341,7 +341,7 @@ def test_with_relevance_score(vdms_client: vdms.vdms) -> None:@pytest.mark.enable_socketdef test_add_documents_no_metadata(vdms_client: vdms.vdms) -> None:collection_name = "test_add_documents_no_metadata"- db = VDMS( # type: ignore[call-arg]+ db = VDMS(collection_name=collection_name,embedding=embedding_function,client=vdms_client,@@ -353,7 +353,7 @@ def test_add_documents_no_metadata(vdms_client: vdms.vdms) -> None:@pytest.mark.enable_socketdef test_add_documents_mixed_metadata(vdms_client: vdms.vdms) -> None:collection_name = "test_add_documents_mixed_metadata"- db = VDMS( # type: ignore[call-arg]+ db = VDMS(collection_name=collection_name,embedding=embedding_function,client=vdms_client,diff --git a/libs/community/tests/integration_tests/vectorstores/test_vectara.py b/libs/community/tests/integration_tests/vectorstores/test_vectara.pyindex a09a5b0b91..8c6ac53a6b 100644--- a/libs/community/tests/integration_tests/vectorstores/test_vectara.py+++ b/libs/community/tests/integration_tests/vectorstores/test_vectara.py@@ -268,7 +268,7 @@ def vectara3() -> Iterable[Vectara]:vectara3.delete(doc_ids)-def test_vectara_with_langchain_mmr(vectara3: Vectara) -> None: # type: ignore[no-untyped-def]+def test_vectara_with_langchain_mmr(vectara3: Vectara) -> None:# test max marginal relevanceoutput1 = vectara3.max_marginal_relevance_search("generative AI",@@ -299,7 +299,7 @@ def test_vectara_with_langchain_mmr(vectara3: Vectara) -> None: # type: ignore[)-def test_vectara_rerankers(vectara3: Vectara) -> None: # type: ignore[no-untyped-def]+def test_vectara_rerankers(vectara3: Vectara) -> None:# test Vectara multi-lingual rerankersummary_config = SummaryConfig(is_enabled=True, max_results=7, response_lang="eng")rerank_config = RerankConfig(reranker="rerank_multilingual_v1", rerank_k=50)diff --git a/libs/community/tests/integration_tests/vectorstores/test_vlite.py b/libs/community/tests/integration_tests/vectorstores/test_vlite.pyindex 7acd2e02df..048807c1ab 100644--- a/libs/community/tests/integration_tests/vectorstores/test_vlite.py+++ b/libs/community/tests/integration_tests/vectorstores/test_vlite.py@@ -21,7 +21,7 @@ def test_vlite_with_metadatas() -> None:docsearch = VLite.from_texts(texts=texts,embedding=FakeEmbeddings(), # type: ignore[call-arg]- metadatas=metadatas, # type: ignore[call-arg]+ metadatas=metadatas,)output = docsearch.similarity_search("foo", k=1)assert output == [Document(page_content="foo", metadata={"page": "0"})]@@ -34,7 +34,7 @@ def test_vlite_with_metadatas_with_scores() -> None:docsearch = VLite.from_texts(texts=texts,embedding=FakeEmbeddings(), # type: ignore[call-arg]- metadatas=metadatas, # type: ignore[call-arg]+ metadatas=metadatas,)output = docsearch.similarity_search_with_score("foo", k=1)assert output == [(Document(page_content="foo", metadata={"page": "0"}), 0.0)]@@ -46,7 +46,7 @@ def test_vlite_update_document() -> None:docsearch = VLite.from_texts(texts=texts,embedding=FakeEmbeddings(), # type: ignore[call-arg]- ids=["1", "2", "3"], # type: ignore[call-arg]+ ids=["1", "2", "3"],)docsearch.update_document("1", Document(page_content="updated_foo"))output = docsearch.similarity_search("updated_foo", k=1)@@ -59,7 +59,7 @@ def test_vlite_delete_document() -> None:docsearch = VLite.from_texts(texts=texts,embedding=FakeEmbeddings(), # type: ignore[call-arg]- ids=["1", "2", "3"], # type: ignore[call-arg]+ ids=["1", "2", "3"],)docsearch.delete(["1"])output = docsearch.similarity_search("foo", k=3)@@ -89,7 +89,7 @@ def test_vlite_from_existing_index() -> None:VLite.from_texts(texts=texts,embedding=FakeEmbeddings(), # type: ignore[call-arg]- collection="test_collection", # type: ignore[call-arg]+ collection="test_collection",)new_docsearch = VLite.from_existing_index(collection="test_collection",diff --git a/libs/community/tests/unit_tests/chat_models/test_baichuan.py b/libs/community/tests/unit_tests/chat_models/test_baichuan.pyindex d869f0042b..2688dedd3e 100644--- a/libs/community/tests/unit_tests/chat_models/test_baichuan.py+++ b/libs/community/tests/unit_tests/chat_models/test_baichuan.py@@ -25,7 +25,7 @@ def test_initialization() -> None:"""Test chat model initialization."""for model in [- ChatBaichuan(model="Baichuan2-Turbo-192K", api_key="test-api-key", timeout=40), # type: ignore[arg-type, call-arg]+ ChatBaichuan(model="Baichuan2-Turbo-192K", api_key="test-api-key", timeout=40), # type: ignore[arg-type]ChatBaichuan( # type: ignore[call-arg]model="Baichuan2-Turbo-192K",baichuan_api_key="test-api-key",@@ -149,8 +149,8 @@ def test_uses_actual_secret_value_from_secret_str() -> None:def test_chat_baichuan_with_base_url() -> None:- chat = ChatBaichuan( # type: ignore[call-arg]+ chat = ChatBaichuan(api_key="your-api-key", # type: ignore[arg-type]- base_url="https://exmaple.com", # type: ignore[arg-type]+ base_url="https://exmaple.com",)assert chat.baichuan_api_base == "https://exmaple.com"diff --git a/libs/community/tests/unit_tests/chat_models/test_mlflow.py b/libs/community/tests/unit_tests/chat_models/test_mlflow.pyindex af2efd5202..6a05068e68 100644--- a/libs/community/tests/unit_tests/chat_models/test_mlflow.py+++ b/libs/community/tests/unit_tests/chat_models/test_mlflow.py@@ -238,7 +238,7 @@ def test_chat_mlflow_bind_tools()]agent = create_tool_calling_agent(llm, tools, prompt)- agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True) # type: ignore[arg-type]+ agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)result = agent_executor.invoke({"input": "36939 * 8922.4"})assert result["output"] == "36939x8922.4 = 329,511,111.6"diff --git a/libs/community/tests/unit_tests/chat_models/test_perplexity.py b/libs/community/tests/unit_tests/chat_models/test_perplexity.pyindex 45cc4ec7cd..ba44a4beff 100644--- a/libs/community/tests/unit_tests/chat_models/test_perplexity.py+++ b/libs/community/tests/unit_tests/chat_models/test_perplexity.py@@ -48,7 +48,7 @@ def test_perplexity_initialization() -> None:# Verify that chat perplexity can be initialized using a secret key provided# as a parameter rather than an environment variable.for model in [- ChatPerplexity( # type: ignore[call-arg]+ ChatPerplexity(model="test", timeout=1, api_key="test", temperature=0.7, verbose=True),ChatPerplexity( # type: ignore[call-arg]diff --git a/libs/community/tests/unit_tests/chat_models/test_premai.py b/libs/community/tests/unit_tests/chat_models/test_premai.pyindex 09118f48ea..155cf1ae0c 100644--- a/libs/community/tests/unit_tests/chat_models/test_premai.py+++ b/libs/community/tests/unit_tests/chat_models/test_premai.py@@ -64,7 +64,7 @@ def test_messages_to_prompt_dict_with_valid_messages() -> None:def test_premai_initialization() -> None:for model in [ChatPremAI(model="prem-ai-model", premai_api_key="xyz", project_id=8), # type: ignore[call-arg]- ChatPremAI(model_name="prem-ai-model", api_key="xyz", project_id=8), # type: ignore[arg-type, call-arg]+ ChatPremAI(model_name="prem-ai-model", api_key="xyz", project_id=8), # type: ignore[arg-type]]:assert model.model == "prem-ai-model"assert model.temperature is Nonediff --git a/libs/community/tests/unit_tests/chat_models/test_tongyi.py b/libs/community/tests/unit_tests/chat_models/test_tongyi.pyindex afe151d4ed..d3f468cc38 100644--- a/libs/community/tests/unit_tests/chat_models/test_tongyi.py+++ b/libs/community/tests/unit_tests/chat_models/test_tongyi.py@@ -59,7 +59,7 @@ def test__convert_dict_to_message_function_call() -> None:expected_output = AIMessage(content="foo",additional_kwargs={"tool_calls": raw_function_calls},- tool_calls=tool_calls, # type: ignore[arg-type]+ tool_calls=tool_calls,invalid_tool_calls=[],)assert result == expected_outputdiff --git a/libs/community/tests/unit_tests/chat_models/test_yuan2.py b/libs/community/tests/unit_tests/chat_models/test_yuan2.pyindex 683b2a013c..dc1a298fc8 100644--- a/libs/community/tests/unit_tests/chat_models/test_yuan2.py+++ b/libs/community/tests/unit_tests/chat_models/test_yuan2.py@@ -16,7 +16,7 @@ from langchain_community.chat_models.yuan2 import (@pytest.mark.requires("openai")def test_yuan2_model_param() -> None:- chat = ChatYuan2(model="foo") # type: ignore[call-arg]+ chat = ChatYuan2(model="foo")assert chat.model_name == "foo"chat = ChatYuan2(model_name="foo") # type: ignore[call-arg]assert chat.model_name == "foo"@@ -26,7 +26,7 @@ def test_yuan2_model_param() -> None:def test_yuan2_timeout_param() -> None:chat = ChatYuan2(request_timeout=5) # type: ignore[call-arg]assert chat.request_timeout == 5- chat = ChatYuan2(timeout=10) # type: ignore[call-arg]+ chat = ChatYuan2(timeout=10)assert chat.request_timeout == 10@@ -34,7 +34,7 @@ def test_yuan2_timeout_param() -> None:def test_yuan2_stop_sequences_param() -> None:chat = ChatYuan2(stop=["<eod>"]) # type: ignore[call-arg]assert chat.stop == ["<eod>"]- chat = ChatYuan2(stop_sequences=["<eod>"]) # type: ignore[call-arg]+ chat = ChatYuan2(stop_sequences=["<eod>"])assert chat.stop == ["<eod>"]diff --git a/libs/community/tests/unit_tests/document_loaders/loaders/vendors/test_docugami.py b/libs/community/tests/unit_tests/document_loaders/loaders/vendors/test_docugami.pyindex 7b107f3278..6b002222bd 100644--- a/libs/community/tests/unit_tests/document_loaders/loaders/vendors/test_docugami.py+++ b/libs/community/tests/unit_tests/document_loaders/loaders/vendors/test_docugami.py@@ -12,7 +12,7 @@ DOCUGAMI_XML_PATH = Path(__file__).parent / "test_data" / "docugami-example.xml"@pytest.mark.requires("dgml_utils")def test_docugami_loader_local() -> None:"""Test DocugamiLoader."""- loader = DocugamiLoader(file_paths=[DOCUGAMI_XML_PATH]) # type: ignore[call-arg]+ loader = DocugamiLoader(file_paths=[DOCUGAMI_XML_PATH])docs = loader.load()assert len(docs) == 25diff --git a/libs/community/tests/unit_tests/embeddings/test_gpt4all.py b/libs/community/tests/unit_tests/embeddings/test_gpt4all.pyindex 19cfc134b5..066b3c1fd9 100644--- a/libs/community/tests/unit_tests/embeddings/test_gpt4all.py+++ b/libs/community/tests/unit_tests/embeddings/test_gpt4all.py@@ -20,7 +20,7 @@ class MockEmbed4All(MagicMock):n_threads: Optional[int] = None,device: Optional[str] = None,**kwargs: Any,- ): # type: ignore[no-untyped-def]+ ):assert model_name == _GPT4ALL_MODEL_NAMEdiff --git a/libs/community/tests/unit_tests/embeddings/test_oci_gen_ai_embedding.py b/libs/community/tests/unit_tests/embeddings/test_oci_gen_ai_embedding.pyindex 9b12444cac..32e63ba100 100644--- a/libs/community/tests/unit_tests/embeddings/test_oci_gen_ai_embedding.py+++ b/libs/community/tests/unit_tests/embeddings/test_oci_gen_ai_embedding.py@@ -20,7 +20,7 @@ class MockResponseDict(dict):def test_embedding_call(monkeypatch: MonkeyPatch, test_model_id: str) -> None:"""Test valid call to OCI Generative AI embedding service."""oci_gen_ai_client = MagicMock()- embeddings = OCIGenAIEmbeddings( # type: ignore[call-arg]+ embeddings = OCIGenAIEmbeddings(model_id=test_model_id,service_endpoint="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com",client=oci_gen_ai_client,diff --git a/libs/community/tests/unit_tests/embeddings/test_premai.py b/libs/community/tests/unit_tests/embeddings/test_premai.pyindex 8c75a67d20..e9861ace6b 100644--- a/libs/community/tests/unit_tests/embeddings/test_premai.py+++ b/libs/community/tests/unit_tests/embeddings/test_premai.py@@ -12,7 +12,7 @@ def test_api_key_is_string() -> None:llm = PremAIEmbeddings( # type: ignore[call-arg]premai_api_key="secret-api-key", # type: ignore[arg-type]project_id=8,- model="fake-model", # type: ignore[arg-type]+ model="fake-model",)assert isinstance(llm.premai_api_key, SecretStr)@@ -24,7 +24,7 @@ def test_api_key_masked_when_passed_via_constructor(llm = PremAIEmbeddings( # type: ignore[call-arg]premai_api_key="secret-api-key", # type: ignore[arg-type]project_id=8,- model="fake-model", # type: ignore[arg-type]+ model="fake-model",)print(llm.premai_api_key, end="") # noqa: T201captured = capsys.readouterr()diff --git a/libs/community/tests/unit_tests/indexes/test_sql_record_manager.py b/libs/community/tests/unit_tests/indexes/test_sql_record_manager.pyindex 01e77c5e7a..2de0f2676b 100644--- a/libs/community/tests/unit_tests/indexes/test_sql_record_manager.py+++ b/libs/community/tests/unit_tests/indexes/test_sql_record_manager.py@@ -73,7 +73,7 @@ def test_update_timestamp(manager: SQLRecordManager) -> None:records = (session.query(UpsertionRecord).filter(UpsertionRecord.namespace == manager.namespace)- .all() # type: ignore[attr-defined]+ .all())assert [@@ -102,7 +102,7 @@ def test_update_timestamp(manager: SQLRecordManager) -> None:records = (session.query(UpsertionRecord).filter(UpsertionRecord.namespace == manager.namespace)- .all() # type: ignore[attr-defined]+ .all())assert [@@ -131,7 +131,7 @@ def test_update_timestamp(manager: SQLRecordManager) -> None:records = (session.query(UpsertionRecord).filter(UpsertionRecord.namespace == manager.namespace)- .all() # type: ignore[attr-defined]+ .all())assert [diff --git a/libs/community/tests/unit_tests/llms/test_aleph_alpha.py b/libs/community/tests/unit_tests/llms/test_aleph_alpha.pyindex 1b3979fd67..4fa7d1a162 100644--- a/libs/community/tests/unit_tests/llms/test_aleph_alpha.py+++ b/libs/community/tests/unit_tests/llms/test_aleph_alpha.py@@ -29,7 +29,7 @@ def test_api_key_masked_when_passed_from_env(monkeypatch: MonkeyPatch, capsys: CaptureFixture) -> None:monkeypatch.setenv("ALEPH_ALPHA_API_KEY", "secret-api-key")- llm = AlephAlpha() # type: ignore[call-arg]+ llm = AlephAlpha()print(llm.aleph_alpha_api_key, end="") # noqa: T201captured = capsys.readouterr()diff --git a/libs/community/tests/unit_tests/llms/test_gooseai.py b/libs/community/tests/unit_tests/llms/test_gooseai.pyindex 6ec2f0aadc..13f851a931 100644--- a/libs/community/tests/unit_tests/llms/test_gooseai.py+++ b/libs/community/tests/unit_tests/llms/test_gooseai.py@@ -17,7 +17,7 @@ def _openai_v1_installed() -> bool:@pytest.mark.requires("openai")def test_api_key_is_secret_string() -> None:- llm = GooseAI(gooseai_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = GooseAI(gooseai_api_key="secret-api-key") # type: ignore[arg-type]assert isinstance(llm.gooseai_api_key, SecretStr)assert llm.gooseai_api_key.get_secret_value() == "secret-api-key"@@ -27,7 +27,7 @@ def test_api_key_is_secret_string() -> None:)@pytest.mark.requires("openai")def test_api_key_masked_when_passed_via_constructor() -> None:- llm = GooseAI(gooseai_api_key="secret-api-key") # type: ignore[arg-type, call-arg]+ llm = GooseAI(gooseai_api_key="secret-api-key") # type: ignore[arg-type]assert str(llm.gooseai_api_key) == "**********"assert "secret-api-key" not in repr(llm.gooseai_api_key)assert "secret-api-key" not in repr(llm)@@ -40,7 +40,7 @@ def test_api_key_masked_when_passed_via_constructor() -> None:def test_api_key_masked_when_passed_from_env() -> None:with MonkeyPatch.context() as mp:mp.setenv("GOOSEAI_API_KEY", "secret-api-key")- llm = GooseAI() # type: ignore[call-arg]+ llm = GooseAI()assert str(llm.gooseai_api_key) == "**********"assert "secret-api-key" not in repr(llm.gooseai_api_key)assert "secret-api-key" not in repr(llm)diff --git a/libs/community/tests/unit_tests/load/test_dump.py b/libs/community/tests/unit_tests/load/test_dump.pyindex ef86c65457..2786ebb20a 100644--- a/libs/community/tests/unit_tests/load/test_dump.py+++ b/libs/community/tests/unit_tests/load/test_dump.py@@ -113,7 +113,7 @@ def test_serialize_llmchain_env() -> None:if not has_env:os.environ["OPENAI_API_KEY"] = "env_variable"- llm_2 = OpenAI(model="davinci", temperature=0.5) # type: ignore[call-arg]+ llm_2 = OpenAI(model="davinci", temperature=0.5)prompt_2 = PromptTemplate.from_template("hello {name}!")chain_2 = LLMChain(llm=llm_2, prompt=prompt_2)@@ -140,7 +140,7 @@ def test_serialize_llmchain_chat(snapshot: Any) -> None:if not has_env:os.environ["OPENAI_API_KEY"] = "env_variable"- llm_2 = ChatOpenAI(model="davinci", temperature=0.5) # type: ignore[call-arg]+ llm_2 = ChatOpenAI(model="davinci", temperature=0.5)prompt_2 = ChatPromptTemplate.from_messages([HumanMessagePromptTemplate.from_template("hello {name}!")])@@ -237,7 +237,7 @@ def test_aliases_hidden() -> None:dumped = json.loads(dumps(test_class, pretty=True))# Check by alias- test_class = TestClass(my_favorite_secret_alias="hello", my_other_secret="world") # type: ignore[call-arg]+ test_class = TestClass(my_favorite_secret_alias="hello", my_other_secret="world")dumped = json.loads(dumps(test_class, pretty=True))expected_dump = {"lc": 1,diff --git a/libs/community/tests/unit_tests/retrievers/test_base.py b/libs/community/tests/unit_tests/retrievers/test_base.pyindex e8665ff202..a25f6debf5 100644--- a/libs/community/tests/unit_tests/retrievers/test_base.py+++ b/libs/community/tests/unit_tests/retrievers/test_base.py@@ -178,12 +178,12 @@ class FakeRetrieverV2(BaseRetriever):@pytest.fixturedef fake_retriever_v2() -> BaseRetriever:- return FakeRetrieverV2() # type: ignore[abstract]+ return FakeRetrieverV2()@pytest.fixturedef fake_erroring_retriever_v2() -> BaseRetriever:- return FakeRetrieverV2(throw_error=True) # type: ignore[abstract]+ return FakeRetrieverV2(throw_error=True)def test_fake_retriever_v2(diff --git a/libs/community/tests/unit_tests/tools/eden_ai/test_tools.py b/libs/community/tests/unit_tests/tools/eden_ai/test_tools.pyindex f32aec6955..117d3a0b8c 100644--- a/libs/community/tests/unit_tests/tools/eden_ai/test_tools.py+++ b/libs/community/tests/unit_tests/tools/eden_ai/test_tools.py@@ -5,7 +5,7 @@ import pytestfrom langchain_community.tools.edenai import EdenAiTextModerationTool-tool = EdenAiTextModerationTool( # type: ignore[call-arg]+tool = EdenAiTextModerationTool(providers=["openai"],language="en",edenai_api_key="fake_key", # type: ignore[arg-type]diff --git a/libs/community/tests/unit_tests/tools/test_you.py b/libs/community/tests/unit_tests/tools/test_you.pyindex 4c383a98d5..165b4c69e5 100644--- a/libs/community/tests/unit_tests/tools/test_you.py+++ b/libs/community/tests/unit_tests/tools/test_you.py@@ -22,7 +22,7 @@ class TestYouSearchTool:responses.GET, f"{TEST_ENDPOINT}/search", json=MOCK_RESPONSE_RAW, status=200)query = "Test query text"- you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test")) # type: ignore[call-arg]+ you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test"))results = you_tool.invoke(query)expected_result = MOCK_PARSED_OUTPUTassert results == expected_result@@ -33,7 +33,7 @@ class TestYouSearchTool:responses.GET, f"{TEST_ENDPOINT}/search", json=MOCK_RESPONSE_RAW, status=200)query = "Test query text"- you_tool = YouSearchTool( # type: ignore[call-arg]+ you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test", k=2))results = you_tool.invoke(query)@@ -46,7 +46,7 @@ class TestYouSearchTool:responses.GET, f"{TEST_ENDPOINT}/search", json=MOCK_RESPONSE_RAW, status=200)query = "Test query text"- you_tool = YouSearchTool( # type: ignore[call-arg]+ you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test", n_snippets_per_hit=1))results = you_tool.invoke(query)@@ -60,7 +60,7 @@ class TestYouSearchTool:)query = "Test news text"- you_tool = YouSearchTool( # type: ignore[call-arg]+ you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test", endpoint_type="news"))results = you_tool.invoke(query)@@ -68,7 +68,7 @@ class TestYouSearchTool:assert results == expected_resultasync def test_ainvoke(self) -> None:- you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test")) # type: ignore[call-arg]+ you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test"))# Mock response object to simulate aiohttp responsemock_response = AsyncMock()diff --git a/libs/community/tests/unit_tests/utilities/test_brave_search.py b/libs/community/tests/unit_tests/utilities/test_brave_search.pyindex e1c9bdc15a..8107eaa3fb 100644--- a/libs/community/tests/unit_tests/utilities/test_brave_search.py+++ b/libs/community/tests/unit_tests/utilities/test_brave_search.py@@ -18,7 +18,7 @@ def test_api_key_from_env(monkeypatch: Any) -> None:env_key = "env-api-key"monkeypatch.setenv("BRAVE_SEARCH_API_KEY", env_key)# Do not pass the api_key explicitly- wrapper = BraveSearchWrapper() # type: ignore[call-arg]+ wrapper = BraveSearchWrapper()assert wrapper.api_key.get_secret_value() == env_key@@ -29,4 +29,4 @@ def test_api_key_missing(monkeypatch: Any) -> None:monkeypatch.delenv("BRAVE_SEARCH_API_KEY", raising=False)with pytest.raises(ValueError):# This should raise an error because no api_key is available.- BraveSearchWrapper() # type: ignore[call-arg]+ BraveSearchWrapper()diff --git a/libs/community/tests/unit_tests/vectorstores/test_databricks_vector_search.py b/libs/community/tests/unit_tests/vectorstores/test_databricks_vector_search.pyindex e2b987245d..57fd474116 100644--- a/libs/community/tests/unit_tests/vectorstores/test_databricks_vector_search.py+++ b/libs/community/tests/unit_tests/vectorstores/test_databricks_vector_search.py@@ -426,7 +426,7 @@ def test_add_texts_with_metadata() -> None:DEFAULT_PRIMARY_KEY: id_,DEFAULT_TEXT_COLUMN: text,DEFAULT_VECTOR_COLUMN: vector,- **metadata, # type: ignore[arg-type]+ **metadata,}for text, vector, id_, metadata in zip(fake_texts, vectors, added_ids, metadatas