Refactor XMLAgentComponent.render_tool_description() method

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-24 20:05:07 -03:00
commit 26612b643d

View file

@ -78,12 +78,7 @@ class XMLAgentComponent(CustomComponent):
def render_tool_description(tools):
return "\n".join(
[
tool_template.format(
name=tool.name, description=tool.description, args_schema=tool.args_schema, args=tool.args
)
for tool in tools
]
[tool_template.format(name=tool.name, description=tool.description, args=tool.args) for tool in tools]
)
prompt_template = PromptTemplate.from_template(prompt)