Spaces:
Runtime error
Runtime error
File size: 576 Bytes
9c0ce75 961a0ff 9c0ce75 6710ca4 9c0ce75 6710ca4 9c0ce75 961a0ff 9c0ce75 6710ca4 9c0ce75 6710ca4 961a0ff 9c0ce75 6710ca4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import os
from smolagents import CodeAgent, GradioUI
# 1. Custom Tool jo course evaluation ke liye valid ho
def my_custom_tool(argument: str) -> str:
"""A tool that echoes back the input argument.
Args:
argument: The string to echo.
"""
return f"Tool received: {argument}"
# 2. Agent setup bina kisi complex model import ke
# smolagents default mein model pick kar lega agar kuch provide na kiya jaye
agent = CodeAgent(
tools=[my_custom_tool],
additional_authorized_imports=["requests", "bs4"]
)
# 3. UI Launch karna
GradioUI(agent).launch() |