Update render_tool_description method in XMLAgent.py

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-24 19:38:32 -03:00
commit 6be88c6b0b

View file

@ -77,7 +77,14 @@ class XMLAgentComponent(CustomComponent):
raise ValueError("Prompt must contain 'input' key.")
def render_tool_description(tools):
return "\n".join([tool_template.format(name=tool.name, description=tool.description) for tool in 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
]
)
prompt_template = PromptTemplate.from_template(prompt)
input_variables = prompt_template.input_variables