# Create custom tool
@tool
def check_model_exists(model_name: str) -> str:
"""
Tool to check if specific model exists in repository
Args:
model_name: The model to be searched for in the local repository
"""
return "Model exists" #dummy return
When invoking this tool using agent.run(query), I get the error message:
Error in tool call execution: check_model_exists() got an unexpected keyword argument ‘sanitize_inputs_outputs’
You should only use this tool with a correct input.
As a reminder, this tool’s description is the following:
check_model_exists: Tool to check if specific model exists in ollama repository
Takes inputs: {‘model_name’: {‘type’: ‘string’, ‘description’: ‘The model to be searched for in the local ollama
repository’}}
Returns an output of type: string
How can I resolve this? The library seems to be inserting ‘sanitize_inputs_outputs’ automatically
Did you end up figuring this out? My previously working app has started throwing this error on delegation :\
Error in calling team member: MultiStepAgent.run() got an unexpected keyword argument 'sanitize_inputs_outputs'
You should only ask this team member with a correct request.
As a reminder, this team member's description is the following:
<smolagents.agents.ManagedAgent object at 0x140350d90>
@aamanlambda could you provide more detail on your error?
I tried:
from smolagents import tool
@tool
def check_model_exists(model_name: str) -> str:
"""
Tool to check if specific model exists in repository
Args:
model_name: The model to be searched for in the local repository
"""
return "Model exists" #dummy return
from smolagents import tool, CodeAgent, HfApiModel
agent = CodeAgent(tools=[check_model_exists], model=HfApiModel(), add_base_tools=True)
agent.run("Does the model 'a' exist in repository?")
i am having the same issue. i logged it and i am sending and receiving string so idk what the issue is. the function works inside my agent since it receives the stuff but smolagents acts like it failed so it doesnt execute the output from the function in my agent.