File size: 637 Bytes
8afb52b
ee1ba96
 
8afb52b
 
 
ee1ba96
 
 
 
 
 
 
 
 
8afb52b
ee1ba96
8afb52b
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from huggingface_hub import login
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, WikipediaSearchTool
from smolagents import tool



@tool
def reverse_string(input_string: str) -> str:
    """This is a tool that given a string, returns the reversed string.
    
    Args:
        input_string (str): The string to reverse.
    
    """
    return input_string[::-1]

agent = CodeAgent(tools=[DuckDuckGoSearchTool(),reverse_string,WikipediaSearchTool()], model=InferenceClientModel())


if __name__ == "__main__":
    agent.run("Search for the best music recommendations for a party at the Wayne's mansion.")