Skip to content

Commit e9dba84

Browse files
authored
carry over 30816 (#7)
1 parent 5226231 commit e9dba84

File tree

346 files changed

+795
-821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+795
-821
lines changed

libs/community/langchain_community/adapters/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def convert_dict_to_message(_dict: Mapping[str, Any]) -> BaseMessage:
104104
additional_kwargs["name"] = _dict["name"]
105105
return ToolMessage(
106106
content=_dict.get("content", ""),
107-
tool_call_id=_dict.get("tool_call_id"), # type: ignore[arg-type]
107+
tool_call_id=_dict.get("tool_call_id"),
108108
additional_kwargs=additional_kwargs,
109109
)
110110
else:

libs/community/langchain_community/agent_toolkits/azure_ai_services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_tools(self) -> List[BaseTool]:
2222

2323
tools: List[BaseTool] = [
2424
AzureAiServicesDocumentIntelligenceTool(), # type: ignore[call-arg]
25-
AzureAiServicesImageAnalysisTool(), # type: ignore[call-arg]
25+
AzureAiServicesImageAnalysisTool(),
2626
AzureAiServicesSpeechToTextTool(), # type: ignore[call-arg]
2727
AzureAiServicesTextToSpeechTool(), # type: ignore[call-arg]
2828
AzureAiServicesTextAnalyticsForHealthTool(), # type: ignore[call-arg]

libs/community/langchain_community/agent_toolkits/file_management/toolkit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def get_tools(self) -> List[BaseTool]:
8181
tools: List[BaseTool] = []
8282
for tool in allowed_tools:
8383
tool_cls = _FILE_TOOLS_MAP[tool]
84-
tools.append(tool_cls(root_dir=self.root_dir)) # type: ignore[call-arg]
84+
tools.append(tool_cls(root_dir=self.root_dir))
8585
return tools
8686

8787

libs/community/langchain_community/agent_toolkits/nla/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from langchain_community.utilities.requests import Requests
1414

1515

16-
class NLATool(Tool): # type: ignore[override]
16+
class NLATool(Tool):
1717
"""Natural Language API Tool."""
1818

1919
@classmethod

libs/community/langchain_community/agent_toolkits/openapi/planner.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _get_default_llm_chain_factory(
6464
return partial(_get_default_llm_chain, prompt)
6565

6666

67-
class RequestsGetToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]
67+
class RequestsGetToolWithParsing(BaseRequestsTool, BaseTool):
6868
"""Requests GET tool with LLM-instructed extraction of truncated responses."""
6969

7070
name: str = "requests_get"
@@ -98,7 +98,7 @@ async def _arun(self, text: str) -> str:
9898
raise NotImplementedError()
9999

100100

101-
class RequestsPostToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]
101+
class RequestsPostToolWithParsing(BaseRequestsTool, BaseTool):
102102
"""Requests POST tool with LLM-instructed extraction of truncated responses."""
103103

104104
name: str = "requests_post"
@@ -129,7 +129,7 @@ async def _arun(self, text: str) -> str:
129129
raise NotImplementedError()
130130

131131

132-
class RequestsPatchToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]
132+
class RequestsPatchToolWithParsing(BaseRequestsTool, BaseTool):
133133
"""Requests PATCH tool with LLM-instructed extraction of truncated responses."""
134134

135135
name: str = "requests_patch"
@@ -162,7 +162,7 @@ async def _arun(self, text: str) -> str:
162162
raise NotImplementedError()
163163

164164

165-
class RequestsPutToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]
165+
class RequestsPutToolWithParsing(BaseRequestsTool, BaseTool):
166166
"""Requests PUT tool with LLM-instructed extraction of truncated responses."""
167167

168168
name: str = "requests_put"
@@ -193,7 +193,7 @@ async def _arun(self, text: str) -> str:
193193
raise NotImplementedError()
194194

195195

196-
class RequestsDeleteToolWithParsing(BaseRequestsTool, BaseTool): # type: ignore[override]
196+
class RequestsDeleteToolWithParsing(BaseRequestsTool, BaseTool):
197197
"""Tool that sends a DELETE request and parses the response."""
198198

199199
name: str = "requests_delete"
@@ -266,7 +266,7 @@ def _create_api_controller_agent(
266266
if "GET" in allowed_operations:
267267
get_llm_chain = LLMChain(llm=llm, prompt=PARSING_GET_PROMPT)
268268
tools.append(
269-
RequestsGetToolWithParsing( # type: ignore[call-arg]
269+
RequestsGetToolWithParsing(
270270
requests_wrapper=requests_wrapper,
271271
llm_chain=get_llm_chain,
272272
allow_dangerous_requests=allow_dangerous_requests,
@@ -275,7 +275,7 @@ def _create_api_controller_agent(
275275
if "POST" in allowed_operations:
276276
post_llm_chain = LLMChain(llm=llm, prompt=PARSING_POST_PROMPT)
277277
tools.append(
278-
RequestsPostToolWithParsing( # type: ignore[call-arg]
278+
RequestsPostToolWithParsing(
279279
requests_wrapper=requests_wrapper,
280280
llm_chain=post_llm_chain,
281281
allow_dangerous_requests=allow_dangerous_requests,
@@ -284,7 +284,7 @@ def _create_api_controller_agent(
284284
if "PUT" in allowed_operations:
285285
put_llm_chain = LLMChain(llm=llm, prompt=PARSING_PUT_PROMPT)
286286
tools.append(
287-
RequestsPutToolWithParsing( # type: ignore[call-arg]
287+
RequestsPutToolWithParsing(
288288
requests_wrapper=requests_wrapper,
289289
llm_chain=put_llm_chain,
290290
allow_dangerous_requests=allow_dangerous_requests,
@@ -293,7 +293,7 @@ def _create_api_controller_agent(
293293
if "DELETE" in allowed_operations:
294294
delete_llm_chain = LLMChain(llm=llm, prompt=PARSING_DELETE_PROMPT)
295295
tools.append(
296-
RequestsDeleteToolWithParsing( # type: ignore[call-arg]
296+
RequestsDeleteToolWithParsing(
297297
requests_wrapper=requests_wrapper,
298298
llm_chain=delete_llm_chain,
299299
allow_dangerous_requests=allow_dangerous_requests,
@@ -302,7 +302,7 @@ def _create_api_controller_agent(
302302
if "PATCH" in allowed_operations:
303303
patch_llm_chain = LLMChain(llm=llm, prompt=PARSING_PATCH_PROMPT)
304304
tools.append(
305-
RequestsPatchToolWithParsing( # type: ignore[call-arg]
305+
RequestsPatchToolWithParsing(
306306
requests_wrapper=requests_wrapper,
307307
llm_chain=patch_llm_chain,
308308
allow_dangerous_requests=allow_dangerous_requests,

libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_tools(self) -> List[BaseTool]:
7575
powerbi=self.powerbi,
7676
examples=self.examples,
7777
max_iterations=self.max_iterations,
78-
output_token_limit=self.output_token_limit, # type: ignore[arg-type]
78+
output_token_limit=self.output_token_limit,
7979
tiktoken_model_name=self.tiktoken_model_name,
8080
),
8181
InfoPowerBITool(powerbi=self.powerbi),

libs/community/langchain_community/agents/openai_assistant/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def create_assistant(
289289
name=name,
290290
instructions=instructions,
291291
tools=[_get_assistants_tool(tool) for tool in tools],
292-
tool_resources=tool_resources, # type: ignore[arg-type]
292+
tool_resources=tool_resources,
293293
model=model,
294294
extra_body=extra_body,
295295
**model_kwargs,
@@ -431,7 +431,7 @@ async def acreate_assistant(
431431
name=name,
432432
instructions=instructions,
433433
tools=openai_tools,
434-
tool_resources=tool_resources, # type: ignore[arg-type]
434+
tool_resources=tool_resources,
435435
model=model,
436436
)
437437
return cls(assistant_id=assistant.id, async_client=async_client, **kwargs)

libs/community/langchain_community/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ async def aupdate(
579579
try:
580580
async with self.redis.pipeline() as pipe:
581581
self._configure_pipeline_for_update(key, pipe, return_val, self.ttl)
582-
await pipe.execute() # type: ignore[attr-defined]
582+
await pipe.execute()
583583
except Exception as e:
584584
logger.error(f"Redis async update failed: {e}")
585585

libs/community/langchain_community/chains/ernie_functions/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def create_ernie_fn_chain(
378378
output_key: str = "function",
379379
output_parser: Optional[BaseLLMOutputParser] = None,
380380
**kwargs: Any,
381-
) -> LLMChain: # type: ignore[valid-type]
381+
) -> LLMChain:
382382
"""[Legacy] Create an LLM chain that uses Ernie functions.
383383
384384
Args:
@@ -455,7 +455,7 @@ class RecordDog(BaseModel):
455455
}
456456
if len(ernie_functions) == 1:
457457
llm_kwargs["function_call"] = {"name": ernie_functions[0]["name"]}
458-
llm_chain = LLMChain( # type: ignore[misc]
458+
llm_chain = LLMChain(
459459
llm=llm,
460460
prompt=prompt,
461461
output_parser=output_parser,
@@ -474,7 +474,7 @@ def create_structured_output_chain(
474474
output_key: str = "function",
475475
output_parser: Optional[BaseLLMOutputParser] = None,
476476
**kwargs: Any,
477-
) -> LLMChain: # type: ignore[valid-type]
477+
) -> LLMChain:
478478
"""[Legacy] Create an LLMChain that uses an Ernie function to get a structured output.
479479
480480
Args:

libs/community/langchain_community/chains/graph_qa/cypher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def from_llm(
324324

325325
cypher_generation_chain = LLMChain(
326326
llm=cypher_llm or llm, # type: ignore[arg-type]
327-
**use_cypher_llm_kwargs, # type: ignore[arg-type]
327+
**use_cypher_llm_kwargs,
328328
)
329329

330330
if exclude_types and include_types:

0 commit comments

Comments
 (0)