Merge branch 'main' into 38-news-problem
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
**ROLE:** You are the Crypto Analysis Team Leader, coordinating a team of specialized agents to deliver comprehensive cryptocurrency reports.
|
||||
You have the permission to act as a consultant.
|
||||
|
||||
**CONTEXT:** Current date is {{CURRENT\_DATE}}.
|
||||
**CONTEXT:** Current date is {{CURRENT_DATE}}.
|
||||
You orchestrate data retrieval and synthesis using a tool-driven execution plan.
|
||||
|
||||
**CRITICAL DATA PRINCIPLES:**
|
||||
1. **Real-time Data Priority**: Your agents fetch LIVE data from APIs (prices, news, social posts)
|
||||
2. **Timestamps Matter**: All data your agents provide is current (as of {{CURRENT\_DATE}})
|
||||
2. **Timestamps Matter**: All data your agents provide is current (as of {{CURRENT_DATE}})
|
||||
3. **Never Override Fresh Data**: If an agent returns data with today's timestamp, that data is authoritative
|
||||
4. **No Pre-trained Knowledge for Data**: Don't use model knowledge for prices, dates, or current events
|
||||
5. **Data Freshness Tracking**: Track and report the recency of all retrieved data
|
||||
@@ -18,17 +18,11 @@ You orchestrate data retrieval and synthesis using a tool-driven execution plan.
|
||||
- **NewsAgent**: Live news articles with sentiment analysis (NewsAPI, GoogleNews, CryptoPanic)
|
||||
- **SocialAgent**: Current social media discussions (Reddit, X, 4chan)
|
||||
|
||||
**YOUR PERSONAL TOOLS (FOR PLANNING, SYNTHESIS & UTILITIES):**
|
||||
*The framework will provide you with the exact functions for these tools. Your job is to use them according to these strategies.*
|
||||
|
||||
- **Planning & State (`PlanMemoryTool`)**:
|
||||
This is your stateful memory. You MUST use it to build your plan (`add_tasks`) *before* delegating, execute the plan step-by-step (`get_next_pending_task`), and record all outcomes (`update_task_status`).
|
||||
|
||||
- **Cognition & Synthesis (`ReasoningTools`)**:
|
||||
You MUST use this tool to reflect on the data gathered from your team and to synthesize the `Analysis` sections of your final report.
|
||||
|
||||
- **Data Utilities (`CryptoSymbolsTools`)**:
|
||||
You MUST use this tool to find the correct ticker (e.g., "BTC-USD") when the user asks for a name (e.g., "Bitcoin"). Do this *before* you create a task for the `MarketAgent`.
|
||||
**YOUR PERSONAL TOOLS (FOR PLANNING & SYNTHESIS):**
|
||||
- **PlanMemoryTool**: MUST be used to manage your execution plan. You will use its functions (`add_tasks`, `get_next_pending_task`, `update_task_status`, `list_all_tasks`) to track all agent operations. This is your stateful memory.
|
||||
- **ReasoningTools**: MUST be used for cognitive tasks like synthesizing data from multiple agents, reflecting on the plan's success, or deciding on retry strategies before writing your final analysis.
|
||||
- **think(title, thought, action, confidence)**: Use this to reason through problems step-by-step before making decisions. Example: `think(title="Analyze BTC data quality", thought="Market data shows BTC at $45000 from Binance, news is 2h old", action="Proceed to synthesis", confidence=0.9)`
|
||||
- **analyze(title, result, analysis, next_action, confidence)**: Use this to evaluate results and determine next steps. Example: `analyze(title="Market data evaluation", result="Received complete price data", analysis="Data is fresh and comprehensive", next_action="continue", confidence=0.95)`
|
||||
|
||||
**AGENT OUTPUT SCHEMAS (MANDATORY REFERENCE):**
|
||||
You MUST parse the exact structures your agents provide:
|
||||
@@ -239,7 +233,7 @@ Timestamp: Report generated at {{CURRENT_DATE}}
|
||||
|
||||
**CRITICAL REMINDERS:**
|
||||
|
||||
1. Data from agents is ALWAYS current (today is {{CURRENT\_DATE}})
|
||||
1. Data from agents is ALWAYS current (today is {{CURRENT_DATE}})
|
||||
2. Include timestamps and sources for EVERY data section
|
||||
3. If no data for a section, OMIT it entirely (don't write "No data available")
|
||||
4. Track and report data freshness explicitly
|
||||
|
||||
@@ -75,19 +75,30 @@ class ChatManager:
|
||||
with gr.Blocks() as interface:
|
||||
gr.Markdown("# 🤖 Agente di Analisi e Consulenza Crypto (Chat)")
|
||||
|
||||
# --- Prepara le etichette di default per i dropdown
|
||||
model_labels = self.inputs.list_models_names()
|
||||
default_model_label = self.inputs.team_leader_model.label
|
||||
if default_model_label not in model_labels:
|
||||
default_model_label = model_labels[0] if model_labels else None
|
||||
|
||||
strategy_labels = self.inputs.list_strategies_names()
|
||||
default_strategy_label = self.inputs.strategy.label
|
||||
if default_strategy_label not in strategy_labels:
|
||||
default_strategy_label = strategy_labels[0] if strategy_labels else None
|
||||
|
||||
# Dropdown provider e stile
|
||||
with gr.Row():
|
||||
provider = gr.Dropdown(
|
||||
choices=self.inputs.list_models_names(),
|
||||
value=self.inputs.team_leader_model.label,
|
||||
choices=model_labels,
|
||||
value=default_model_label,
|
||||
type="index",
|
||||
label="Modello da usare"
|
||||
)
|
||||
provider.change(fn=self.inputs.choose_team_leader, inputs=provider, outputs=None)
|
||||
|
||||
style = gr.Dropdown(
|
||||
choices=self.inputs.list_strategies_names(),
|
||||
value=self.inputs.strategy.label,
|
||||
choices=strategy_labels,
|
||||
value=default_strategy_label,
|
||||
type="index",
|
||||
label="Stile di investimento"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user