Decouple friendly tool descriptions via registry
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from agno.tools import Toolkit
|
||||
|
||||
from app.agents.action_registry import register_friendly_actions
|
||||
from app.api.wrapper_handler import WrapperHandler
|
||||
from app.api.core.markets import MarketWrapper, Price, ProductInfo
|
||||
from app.api.markets import BinanceWrapper, CoinBaseWrapper, CryptoCompareWrapper, YFinanceWrapper
|
||||
@@ -127,3 +129,11 @@ class MarketAPIsTool(MarketWrapper, Toolkit):
|
||||
"""
|
||||
all_prices = self.handler.try_call_all(lambda w: w.get_historical_prices(asset_id, limit))
|
||||
return Price.aggregate(all_prices)
|
||||
|
||||
register_friendly_actions({
|
||||
"get_product": "🔍 Recupero le informazioni sul prodotto richiesto...",
|
||||
"get_products": "📦 Recupero i dati su più asset...",
|
||||
"get_historical_prices": "📊 Recupero i dati storici dei prezzi...",
|
||||
"get_products_aggregated": "🧩 Aggrego le informazioni da più fonti...",
|
||||
"get_historical_prices_aggregated": "📈 Creo uno storico aggregato dei prezzi...",
|
||||
})
|
||||
@@ -1,4 +1,6 @@
|
||||
from agno.tools import Toolkit
|
||||
|
||||
from app.agents.action_registry import register_friendly_actions
|
||||
from app.api.wrapper_handler import WrapperHandler
|
||||
from app.api.core.news import NewsWrapper, Article
|
||||
from app.api.news import NewsApiWrapper, GoogleNewsWrapper, CryptoPanicWrapper, DuckDuckGoWrapper
|
||||
@@ -111,3 +113,10 @@ class NewsAPIsTool(NewsWrapper, Toolkit):
|
||||
Exception: If all providers fail to return results.
|
||||
"""
|
||||
return self.handler.try_call_all(lambda w: w.get_latest_news(query, limit))
|
||||
|
||||
register_friendly_actions({
|
||||
"get_top_headlines": "📰 Cerco le notizie principali...",
|
||||
"get_latest_news": "🔎 Cerco notizie recenti su un argomento...",
|
||||
"get_top_headlines_aggregated": "🗞️ Raccolgo le notizie principali da tutte le fonti...",
|
||||
"get_latest_news_aggregated": "📚 Raccolgo notizie specifiche da tutte le fonti...",
|
||||
})
|
||||
@@ -1,4 +1,6 @@
|
||||
from agno.tools import Toolkit
|
||||
|
||||
from app.agents.action_registry import register_friendly_actions
|
||||
from app.api.wrapper_handler import WrapperHandler
|
||||
from app.api.core.social import SocialPost, SocialWrapper
|
||||
from app.api.social import *
|
||||
@@ -73,3 +75,8 @@ class SocialAPIsTool(SocialWrapper, Toolkit):
|
||||
Exception: If all providers fail to return results.
|
||||
"""
|
||||
return self.handler.try_call_all(lambda w: w.get_top_crypto_posts(limit_per_wrapper))
|
||||
|
||||
register_friendly_actions({
|
||||
"get_top_crypto_posts": "📱 Cerco i post più popolari sui social...",
|
||||
"get_top_crypto_posts_aggregated": "🌐 Raccolgo i post da tutte le piattaforme social...",
|
||||
})
|
||||
Reference in New Issue
Block a user