Lista di cryptovalute #36

Merged
Berack96 merged 9 commits from 31-lista-di-cryptovalute into main 2025-10-21 15:58:42 +02:00
4 changed files with 9575 additions and 4 deletions
Showing only changes of commit f627868923 - Show all commits

9570
resources/cryptos.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -120,7 +120,7 @@ class Pipeline:
logging.info(f"[{run_id}] Pipeline query: {self.inputs.user_query}") logging.info(f"[{run_id}] Pipeline query: {self.inputs.user_query}")
# Step 1: Crea gli agenti e il team # Step 1: Crea gli agenti e il team
market_tool, news_tool, social_tool = self.get_tools() market_tool, news_tool, social_tool = self.get_api_tools()
market_agent = self.inputs.team_model.get_agent(instructions=MARKET_INSTRUCTIONS, name="MarketAgent", tools=[market_tool]) market_agent = self.inputs.team_model.get_agent(instructions=MARKET_INSTRUCTIONS, name="MarketAgent", tools=[market_tool])
news_agent = self.inputs.team_model.get_agent(instructions=NEWS_INSTRUCTIONS, name="NewsAgent", tools=[news_tool]) news_agent = self.inputs.team_model.get_agent(instructions=NEWS_INSTRUCTIONS, name="NewsAgent", tools=[news_tool])
social_agent = self.inputs.team_model.get_agent(instructions=SOCIAL_INSTRUCTIONS, name="SocialAgent", tools=[social_tool]) social_agent = self.inputs.team_model.get_agent(instructions=SOCIAL_INSTRUCTIONS, name="SocialAgent", tools=[social_tool])
@@ -157,7 +157,7 @@ class Pipeline:
# ====================== # ======================
# Helpers # Helpers
# ===================== # =====================
def get_tools(self) -> tuple[MarketAPIsTool, NewsAPIsTool, SocialAPIsTool]: def get_api_tools(self) -> tuple[MarketAPIsTool, NewsAPIsTool, SocialAPIsTool]:
""" """
Restituisce la lista di tools disponibili per gli agenti. Restituisce la lista di tools disponibili per gli agenti.
""" """

View File

@@ -1,5 +1,6 @@
from app.api.tools.market_tool import MarketAPIsTool from app.api.tools.market_tool import MarketAPIsTool
from app.api.tools.social_tool import SocialAPIsTool from app.api.tools.social_tool import SocialAPIsTool
from app.api.tools.news_tool import NewsAPIsTool from app.api.tools.news_tool import NewsAPIsTool
from app.api.tools.symbols_tool import CryptoSymbols
__all__ = ["MarketAPIsTool", "NewsAPIsTool", "SocialAPIsTool"] __all__ = ["MarketAPIsTool", "NewsAPIsTool", "SocialAPIsTool", "CryptoSymbols"]

View File

@@ -18,7 +18,7 @@ class CryptoSymbols(Toolkit):
Classe per ottenere i simboli delle criptovalute tramite Yahoo Finance. Classe per ottenere i simboli delle criptovalute tramite Yahoo Finance.
""" """
def __init__(self, cache_file: str = 'cryptos.csv'): def __init__(self, cache_file: str = 'resources/cryptos.csv'):
self.cache_file = cache_file self.cache_file = cache_file
self.final_table = pd.read_csv(self.cache_file) if os.path.exists(self.cache_file) else pd.DataFrame() # type: ignore self.final_table = pd.read_csv(self.cache_file) if os.path.exists(self.cache_file) else pd.DataFrame() # type: ignore
copilot-pull-request-reviewer[bot] commented 2025-10-21 13:23:20 +02:00 (Migrated from github.com)
Review

[nitpick] This line is overly complex with multiple operations. Consider splitting it into separate lines for better readability: check file existence, then read CSV or create empty DataFrame.

        if os.path.exists(self.cache_file):
            self.final_table = pd.read_csv(self.cache_file) # type: ignore
        else:
            self.final_table = pd.DataFrame() # type: ignore
[nitpick] This line is overly complex with multiple operations. Consider splitting it into separate lines for better readability: check file existence, then read CSV or create empty DataFrame. ```suggestion if os.path.exists(self.cache_file): self.final_table = pd.read_csv(self.cache_file) # type: ignore else: self.final_table = pd.DataFrame() # type: ignore ```
Toolkit.__init__(self, # type: ignore Toolkit.__init__(self, # type: ignore