Spaces:
Sleeping
Sleeping
add new tools
Browse files8 unmodified lines91011121314151617181920212213 unmodified lines36373839404142434445464748495 unmodified lines555657585960618 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 type#Keep this format for the description / args / args description but feel free to modify the tool"""A tool that does nothing yetArgs:arg1: the first argumentarg2: the second argument"""return "What magic will you build ?"@tooldef get_current_time_in_timezone(timezone: str) -> str:13 unmodified linesfinal_answer = FinalAnswerTool()# 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 = 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,)5 unmodified linesagent = CodeAgent(model=model,tools=[final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,8 unmodified lines9101112131415161718192013 unmodified lines3435363738394041424344454647485 unmodified lines545556575859608 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef 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 selects a random animal name."""return "Dog"@tooldef get_current_time_in_timezone(timezone: str) -> str:13 unmodified linesfinal_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 = HfApiModel(max_tokens=2096,temperature=0.5,model_id=model_id,custom_role_conversions=None,)5 unmodified linesagent = CodeAgent(model=model,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