File size: 599 Bytes
34e35ba 9b5b26a 8fe992b 34e35ba 9b5b26a 34e35ba 9b5b26a 8c01ffb 34e35ba 8c01ffb 34e35ba ae7a494 34e35ba ae7a494 8c01ffb 34e35ba 8c01ffb 8fe992b 9b5b26a 8c01ffb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, load_tool, tool
import datetime
@tool
def get_today_(date)
"""return's today's_date"""
return datetime.datetime.now().strftime("%Y-%m-%d")
model = InferenceClientModel( model_id="HuggingFaceH4/zephyr-7b-beta")
tools = [ DuckDuckGoSearchTool(), get_today_date, FinalAnswerTool() ]
agent = CodeAgentmodel=model,(model=model, tools=tools, max_steps=5 )
response = agent.run( "What is Bitcoin and what is today's date?" )
print(response)
GradioUI(agent).launch() |