Spaces:
Running
Running
Update agent.py
Browse files
agent.py
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, WikipediaSearchTool,
|
2 |
import asyncio
|
3 |
|
4 |
class MagAgent:
|
5 |
def __init__(self):
|
6 |
"""Initialize the MagAgent with search tools."""
|
7 |
print("Initializing MagAgent with search tools...")
|
8 |
-
model =
|
|
|
|
|
|
|
|
|
9 |
# max_tokens=2096,
|
10 |
# temperature=0.5,
|
11 |
-
# # model_id="gemini/gemini-2.0-flash-lite-001",
|
12 |
-
# # api_key = os.environ["GEMINI_KEY"], #userdata.get("GEMINI_KEY")
|
13 |
# model_id="https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud/",
|
14 |
# custom_role_conversions=None,
|
15 |
)
|
|
|
1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, WikipediaSearchTool, LiteLLMModel # HfApiModel, OpenAIServerModel
|
2 |
import asyncio
|
3 |
|
4 |
class MagAgent:
|
5 |
def __init__(self):
|
6 |
"""Initialize the MagAgent with search tools."""
|
7 |
print("Initializing MagAgent with search tools...")
|
8 |
+
model = LiteLLMModel(
|
9 |
+
model_id="gemini/gemini-2.0-flash",
|
10 |
+
api_key=os.getenv("GEMINI_KEY"),
|
11 |
+
max_tokens=8192
|
12 |
+
# model = HfApiModel(
|
13 |
# max_tokens=2096,
|
14 |
# temperature=0.5,
|
|
|
|
|
15 |
# model_id="https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud/",
|
16 |
# custom_role_conversions=None,
|
17 |
)
|