🐛 fix(custom.py): remove unnecessary type ignore comments

The type ignore comments are unnecessary as the code is already type annotated. Removing them improves code readability and maintainability.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-13 15:04:23 -03:00
commit 188fd4ad0a

View file

@ -83,8 +83,8 @@ class JsonAgent(CustomAgentExecutor):
prompt=prompt,
)
agent = ZeroShotAgent(
llm_chain=llm_chain, allowed_tools=tool_names
) # type: ignore
llm_chain=llm_chain, allowed_tools=tool_names # type: ignore
)
return cls.from_agent_and_tools(agent=agent, tools=tools, verbose=True)
def run(self, *args, **kwargs):
@ -132,8 +132,8 @@ class CSVAgent(CustomAgentExecutor):
)
tool_names = {tool.name for tool in tools}
agent = ZeroShotAgent(
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs
) # type: ignore
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs # type: ignore
)
return cls.from_agent_and_tools(agent=agent, tools=tools, verbose=True)
@ -171,8 +171,8 @@ class VectorStoreAgent(CustomAgentExecutor):
)
tool_names = {tool.name for tool in tools}
agent = ZeroShotAgent(
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs
) # type: ignore
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs # type: ignore
)
return AgentExecutor.from_agent_and_tools(
agent=agent, tools=tools, verbose=True
)
@ -241,8 +241,8 @@ class SQLAgent(CustomAgentExecutor):
)
tool_names = {tool.name for tool in tools} # type: ignore
agent = ZeroShotAgent(
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs
) # type: ignore
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs # type: ignore
)
return AgentExecutor.from_agent_and_tools(
agent=agent,
tools=tools, # type: ignore
@ -286,8 +286,8 @@ class VectorStoreRouterAgent(CustomAgentExecutor):
)
tool_names = {tool.name for tool in tools}
agent = ZeroShotAgent(
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs
) # type: ignore
llm_chain=llm_chain, allowed_tools=tool_names, **kwargs # type: ignore
)
return AgentExecutor.from_agent_and_tools(
agent=agent, tools=tools, verbose=True
)