| import os |
| from smolagents import CodeAgent, HfHubProvider, GradioUI |
|
|
| |
| provider = HfHubProvider(model_id="Qwen/Qwen2.5-Coder-32B-Instruct") |
|
|
| |
| def web_search_mock(query: str) -> str: |
| """A search tool that helps the agent find information. |
| Args: |
| query: The search query string. |
| """ |
| return f"Search result for '{query}': This is a placeholder response for the agent evaluation." |
|
|
| |
| agent = CodeAgent( |
| tools=[web_search_mock], |
| model=provider, |
| additional_authorized_imports=["requests", "bs4", "math"] |
| ) |
|
|
| |
| if __name__ == "__main__": |
| GradioUI(agent).launch() |
|
|