agents_gaia / agents /utils.py
Isics's picture
fixed some shit
6aef72f
raw
history blame contribute delete
833 Bytes
import pandas as pd
from smolagents import CodeAgent, Model, tool, SpeechToTextTool
from config import authorized_libraries
@tool
def reverse_string(string: str) -> str:
"""
Given a string and return it reversed.
For example, given "siht dnatsrednu uoy fI" will return "If you understand this"
Args:
string (str): String to reverse
"""
return string[::-1]
def create_utils(model: Model) -> CodeAgent:
return CodeAgent(
model=model,
tools=[
reverse_string,
SpeechToTextTool(),
],
add_base_tools=True,
additional_authorized_imports=authorized_libraries,
name="utils_manager",
description="Have a bunch of useful utilities, like functions to reverse string.",
verbosity_level=0,
max_steps=8,
)