From 78208f19b56971b715054a36aa8aa2e41e4fd310 Mon Sep 17 00:00:00 2001 From: Berack96 Date: Thu, 9 Oct 2025 16:55:52 +0200 Subject: [PATCH] Rimosso codice commentato e import non utilizzati nella classe Pipeline per semplificare la struttura --- src/app/agents/pipeline.py | 41 +------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/src/app/agents/pipeline.py b/src/app/agents/pipeline.py index b6d50b4..0d4aa4b 100644 --- a/src/app/agents/pipeline.py +++ b/src/app/agents/pipeline.py @@ -1,9 +1,7 @@ import logging -from agno.run.agent import RunOutput from app.agents.models import AppModels from app.agents.team import create_team_with -from app.agents.predictor import PREDICTOR_INSTRUCTIONS, PredictorInput, PredictorOutput, PredictorStyle -from app.base.markets import ProductInfo +from app.agents.predictor import PREDICTOR_INSTRUCTIONS, PredictorOutput, PredictorStyle logging = logging.getLogger(__name__) @@ -79,40 +77,3 @@ class Pipeline: raise ValueError("Team output is not a string") logging.info(f"Team finished") return team_outputs.content - - # # Step 2: aggregazione output strutturati - # all_products: list[ProductInfo] = [] - # sentiments: list[str] = [] - - # for agent_output in team_outputs.member_responses: - # if isinstance(agent_output, RunOutput) and agent_output.metadata is not None: - # keys = agent_output.metadata.keys() - # if "products" in keys: - # all_products.extend(agent_output.metadata["products"]) - # if "sentiment_news" in keys: - # sentiments.append(agent_output.metadata["sentiment_news"]) - # if "sentiment_social" in keys: - # sentiments.append(agent_output.metadata["sentiment_social"]) - - # aggregated_sentiment = "\n".join(sentiments) - - # # Step 3: invocazione Predictor - # predictor_input = PredictorInput( - # data=all_products, - # style=self.style, - # sentiment=aggregated_sentiment - # ) - - # result = self.predictor.run(predictor_input) # type: ignore - # if not isinstance(result.content, PredictorOutput): - # return "❌ Errore: il modello non ha restituito un output valido." - # prediction: PredictorOutput = result.content - - # Step 4: restituzione strategia finale - # portfolio_lines = "\n".join( - # [f"{item.asset} ({item.percentage}%): {item.motivation}" for item in prediction.portfolio] - # ) - # return ( - # f"📊 Strategia ({self.style.value}): {prediction.strategy}\n\n" - # f"💼 Portafoglio consigliato:\n{portfolio_lines}" - # )