Skip to content
Python

fix(prompts): put the current date at the top of analyst prompts

Yijia-Xiao2b2d685df669
diff --git a/tradingagents/agents/analysts/fundamentals_analyst.py b/tradingagents/agents/analysts/fundamentals_analyst.py
index 0428e676b..76e6bed4c 100644
--- a/tradingagents/agents/analysts/fundamentals_analyst.py
+++ b/tradingagents/agents/analysts/fundamentals_analyst.py
@@ -39,8 +39,9 @@ def create_fundamentals_analyst(llm):
" will help where you left off. Execute what you can to make progress."
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
- " You have access to the following tools: {tool_names}.\n{system_message}"
- "For your reference, the current date is {current_date}. {instrument_context}",
+ " You have access to the following tools: {tool_names}."
+ " Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}\n"
+ "{system_message}",
),
MessagesPlaceholder(variable_name="messages"),
]
diff --git a/tradingagents/agents/analysts/market_analyst.py b/tradingagents/agents/analysts/market_analyst.py
index d41a28db3..a8f1ecb8a 100644
--- a/tradingagents/agents/analysts/market_analyst.py
+++ b/tradingagents/agents/analysts/market_analyst.py
@@ -65,8 +65,9 @@ Write a very detailed and nuanced report of the trends you observe. Provide spec
" will help where you left off. Execute what you can to make progress."
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
- " You have access to the following tools: {tool_names}.\n{system_message}"
- "For your reference, the current date is {current_date}. {instrument_context}",
+ " You have access to the following tools: {tool_names}."
+ " Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}\n"
+ "{system_message}",
),
MessagesPlaceholder(variable_name="messages"),
]
diff --git a/tradingagents/agents/analysts/news_analyst.py b/tradingagents/agents/analysts/news_analyst.py
index a0d7fde86..34aaf511f 100644
--- a/tradingagents/agents/analysts/news_analyst.py
+++ b/tradingagents/agents/analysts/news_analyst.py
@@ -40,8 +40,9 @@ def create_news_analyst(llm):
" will help where you left off. Execute what you can to make progress."
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
- " You have access to the following tools: {tool_names}.\n{system_message}"
- "For your reference, the current date is {current_date}. {instrument_context}",
+ " You have access to the following tools: {tool_names}."
+ " Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}\n"
+ "{system_message}",
),
MessagesPlaceholder(variable_name="messages"),
]
diff --git a/tradingagents/agents/analysts/sentiment_analyst.py b/tradingagents/agents/analysts/sentiment_analyst.py
index c79741507..68bb8c5f8 100644
--- a/tradingagents/agents/analysts/sentiment_analyst.py
+++ b/tradingagents/agents/analysts/sentiment_analyst.py
@@ -86,8 +86,8 @@ def create_sentiment_analyst(llm):
"You are a helpful AI assistant, collaborating with other assistants."
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
- "\n{system_message}\n"
- "For your reference, the current date is {current_date}. {instrument_context}",
+ " Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}"
+ "\n{system_message}",
),
MessagesPlaceholder(variable_name="messages"),
]