Aggiunta cartella per i modelli, agenti e team

This commit is contained in:
2025-10-04 00:46:03 +02:00
parent cc0cae52db
commit e5e38d0a6d
6 changed files with 51 additions and 62 deletions

35
src/app/agents/team.py Normal file
View File

@@ -0,0 +1,35 @@
from agno.team import Team
from app.agents import AppModels
from app.markets import MARKET_INSTRUCTIONS, MarketAPIsTool
from app.news import NEWS_INSTRUCTIONS, NewsAPIsTool
from app.social import SOCIAL_INSTRUCTIONS, SocialAPIsTool
def create_team_with(models: AppModels, coordinator: AppModels | None = None) -> Team:
market_agent = models.get_agent(
instructions=MARKET_INSTRUCTIONS,
name="MarketAgent",
tools=[MarketAPIsTool()]
)
news_agent = models.get_agent(
instructions=NEWS_INSTRUCTIONS,
name="NewsAgent",
tools=[NewsAPIsTool()]
)
social_agent = models.get_agent(
instructions=SOCIAL_INSTRUCTIONS,
name="SocialAgent",
tools=[SocialAPIsTool()]
)
coordinator = coordinator or models
return Team(
model=coordinator.get_model(COORDINATOR_INSTRUCTIONS),
name="CryptoAnalysisTeam",
members=[market_agent, news_agent, social_agent],
)
# TODO: migliorare le istruzioni del team
COORDINATOR_INSTRUCTIONS = """
Agisci come coordinatore: smista le richieste tra MarketAgent, NewsAgent e SocialAgent.
"""