Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,8 @@ import requests
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
|
7 |
-
from smolagents import CodeAgent,
|
|
|
8 |
|
9 |
# (Сохраните константы как есть)
|
10 |
# --- Константы ---
|
@@ -26,13 +27,19 @@ try:
|
|
26 |
except Exception as e:
|
27 |
print(f"Не удалось войти в Hugging Face Hub: {e}")
|
28 |
|
|
|
|
|
|
|
29 |
# --- Основное определение агента ---
|
30 |
# ----- ЗДЕСЬ ВЫ МОЖЕТЕ СОЗДАТЬ ТО, ЧТО ХОТИТЕ ------
|
31 |
class BasicAgent:
|
32 |
def __init__(self):
|
33 |
print("BasicAgent initialized.")
|
34 |
|
35 |
-
self.agent = CodeAgent(tools=[
|
|
|
|
|
|
|
36 |
|
37 |
print("Agent initialized successfully.")
|
38 |
|
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
|
7 |
+
from smolagents import load_tool, CodeAgent, InferenceClientModel, DuckDuckGoSearchTool
|
8 |
+
from dotenv import load_dotenv
|
9 |
|
10 |
# (Сохраните константы как есть)
|
11 |
# --- Константы ---
|
|
|
27 |
except Exception as e:
|
28 |
print(f"Не удалось войти в Hugging Face Hub: {e}")
|
29 |
|
30 |
+
search_tool = DuckDuckGoSearchTool()
|
31 |
+
# ----------------------
|
32 |
+
|
33 |
# --- Основное определение агента ---
|
34 |
# ----- ЗДЕСЬ ВЫ МОЖЕТЕ СОЗДАТЬ ТО, ЧТО ХОТИТЕ ------
|
35 |
class BasicAgent:
|
36 |
def __init__(self):
|
37 |
print("BasicAgent initialized.")
|
38 |
|
39 |
+
self.agent = agent = CodeAgent(tools=[search_tool],
|
40 |
+
model=InferenceClientModel(model_id="Qwen/Qwen2.5-72B-Instruct"),
|
41 |
+
planning_interval=3
|
42 |
+
)
|
43 |
|
44 |
print("Agent initialized successfully.")
|
45 |
|