Spaces:
Runtime error
Runtime error
| 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() |