Spaces:
Sleeping
Sleeping
add new tools
Browse files8 unmodified lines9101112121314151617141519161718192013 unmodified lines34353637384039404143444546424344454647485 unmodified lines54555658575859608 unmodified lines
# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return typedef get_random_animal()-> str: #it's import to specify the return type #Keep this format for the description / args / args description but feel free to modify the tool """A tool that does nothing yet Args: arg1: the first argument arg2: the second argument """A tool that selects a random animal name. """ return "What magic will you build ?" return "Dog"
@tooldef get_current_time_in_timezone(timezone: str) -> str:13 unmodified lines
final_answer = FinalAnswerTool()
model_id = 'Qwen/Qwen2.5-Coder-32B-Instruct' # it is possible that this model may be overloaded# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud' # model_id = 'https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
model = HfApiModel(max_tokens=2096,temperature=0.5,model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloadedcustom_role_conversions=None, max_tokens=2096, temperature=0.5, model_id=model_id, custom_role_conversions=None,)
5 unmodified lines agent = CodeAgent( model=model, tools=[final_answer], ## add your tools here (don't remove final answer) tools=[final_answer, image_generation_tool, get_current_time_in_timezone, get_random_animal], ## add your tools here (don't remove final answer) max_steps=6, verbosity_level=1, grammar=None,app.py+11-12