Skip to content

Commit 2b2d685

Browse files
committed
fix(prompts): put the current date at the top of analyst prompts
The date hint sat at the end of each analyst's system prompt, after a long indicator block, so weaker models anchored to their training cutoff when generating tool-call date ranges. Lead each prompt with it instead.
1 parent a0120e1 commit 2b2d685

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

tradingagents/agents/analysts/fundamentals_analyst.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ def fundamentals_analyst_node(state):
3939
" will help where you left off. Execute what you can to make progress."
4040
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
4141
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
42-
" You have access to the following tools: {tool_names}.\n{system_message}"
43-
"For your reference, the current date is {current_date}. {instrument_context}",
42+
" You have access to the following tools: {tool_names}."
43+
" Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}\n"
44+
"{system_message}",
4445
),
4546
MessagesPlaceholder(variable_name="messages"),
4647
]

tradingagents/agents/analysts/market_analyst.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ def market_analyst_node(state):
6565
" will help where you left off. Execute what you can to make progress."
6666
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
6767
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
68-
" You have access to the following tools: {tool_names}.\n{system_message}"
69-
"For your reference, the current date is {current_date}. {instrument_context}",
68+
" You have access to the following tools: {tool_names}."
69+
" Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}\n"
70+
"{system_message}",
7071
),
7172
MessagesPlaceholder(variable_name="messages"),
7273
]

tradingagents/agents/analysts/news_analyst.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ def news_analyst_node(state):
4040
" will help where you left off. Execute what you can to make progress."
4141
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
4242
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
43-
" You have access to the following tools: {tool_names}.\n{system_message}"
44-
"For your reference, the current date is {current_date}. {instrument_context}",
43+
" You have access to the following tools: {tool_names}."
44+
" Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}\n"
45+
"{system_message}",
4546
),
4647
MessagesPlaceholder(variable_name="messages"),
4748
]

tradingagents/agents/analysts/sentiment_analyst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def sentiment_analyst_node(state):
8686
"You are a helpful AI assistant, collaborating with other assistants."
8787
" If you or any other assistant has the FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** or deliverable,"
8888
" prefix your response with FINAL TRANSACTION PROPOSAL: **BUY/HOLD/SELL** so the team knows to stop."
89-
"\n{system_message}\n"
90-
"For your reference, the current date is {current_date}. {instrument_context}",
89+
" Today's date is {current_date}; treat it as 'now' for all analysis and tool-call date ranges. {instrument_context}"
90+
"\n{system_message}",
9191
),
9292
MessagesPlaceholder(variable_name="messages"),
9393
]

0 commit comments

Comments
 (0)