Spaces:
Paused
Paused
Svetlana
commited on
Commit
·
41d1a24
1
Parent(s):
7e97ca8
chore: change model
Browse files- .env.example +2 -1
- agent.py +2 -2
.env.example
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
SPACE_ID=
|
| 2 |
-
SPACE_HOST=
|
|
|
|
|
|
| 1 |
SPACE_ID=
|
| 2 |
+
SPACE_HOST=
|
| 3 |
+
OPENROUTER_KEY=
|
agent.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
import os
|
| 4 |
-
from smolagents import DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool,
|
| 5 |
from tools import DownloadTaskAttachmentTool, VisitWebpageTool
|
| 6 |
|
| 7 |
|
| 8 |
class MyAgent:
|
| 9 |
def __init__(self):
|
| 10 |
self.agent = CodeAgent(
|
| 11 |
-
model=
|
| 12 |
tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), VisitWebpageTool(), DownloadTaskAttachmentTool()],
|
| 13 |
add_base_tools=True,
|
| 14 |
additional_authorized_imports=['pandas', 'numpy', 'csv', 'subprocess', 'exec']
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
import os
|
| 4 |
+
from smolagents import DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, LiteLLMModel
|
| 5 |
from tools import DownloadTaskAttachmentTool, VisitWebpageTool
|
| 6 |
|
| 7 |
|
| 8 |
class MyAgent:
|
| 9 |
def __init__(self):
|
| 10 |
self.agent = CodeAgent(
|
| 11 |
+
model=LiteLLMModel(model_id="openrouter/meta-llama/llama-4-maverick:free", api_key=os.getenv("OPENROUTER_KEY")),
|
| 12 |
tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), VisitWebpageTool(), DownloadTaskAttachmentTool()],
|
| 13 |
add_base_tools=True,
|
| 14 |
additional_authorized_imports=['pandas', 'numpy', 'csv', 'subprocess', 'exec']
|