-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.py
More file actions
43 lines (36 loc) · 1.3 KB
/
agent.py
File metadata and controls
43 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Configuração e criação do Agente Vercel
"""
import os
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.tools.telegram import TelegramTools
from tools.search_deployments import search_deployments
from tools.search_projects import search_projects
from config.agent_config import AGENT_CONFIG, MODEL_CONFIG
def create_agent() -> Agent:
"""
Cria e configura o agente Vercel
Returns:
Agent: Agente configurado e pronto para uso
"""
# Carrega variáveis de ambiente
telegram_token = os.getenv("TELEGRAM_BOT_TOKEN")
telegram_chat_id = os.getenv("TELEGRAM_CHAT_ID")
# Configura o banco de dados
db = SqliteDb(db_file="/tmp/database.db")
# Instância das tools
telegram_tool = TelegramTools(token=telegram_token, chat_id=telegram_chat_id)
# Cria o agente
agent = Agent(
model=MODEL_CONFIG["model"],
name=AGENT_CONFIG["name"],
description=AGENT_CONFIG.get("description", "A agent that can help you with your tasks"),
role=AGENT_CONFIG["role"],
db=db,
enable_agentic_memory=True,
tools=[search_deployments, search_projects, telegram_tool],
instructions=AGENT_CONFIG["instructions"],
markdown=AGENT_CONFIG["markdown"]
)
return agent