mirror of
https://github.com/farcasclaudiu/TradingAgents.git
synced 2026-06-28 15:01:13 +03:00
fix: preserve exchange-qualified tickers across agent prompts
This commit is contained in:
@@ -19,6 +19,16 @@ from tradingagents.agents.utils.news_data_tools import (
|
||||
get_global_news
|
||||
)
|
||||
|
||||
|
||||
def build_instrument_context(ticker: str) -> str:
|
||||
"""Describe the exact instrument so agents avoid cross-exchange symbol mixups."""
|
||||
return (
|
||||
f"The exact listed instrument to analyze is `{ticker}`. "
|
||||
"Use this exact ticker in every tool call, report, and recommendation. "
|
||||
"If it includes an exchange suffix such as `.TO`, `.L`, `.HK`, or `.T`, preserve that suffix and do not mix in companies from other exchanges that share the same root symbol. "
|
||||
"If it does not include a suffix, do not invent one."
|
||||
)
|
||||
|
||||
def create_msg_delete():
|
||||
def delete_messages(state):
|
||||
"""Clear messages and add placeholder for Anthropic compatibility"""
|
||||
@@ -35,4 +45,4 @@ def create_msg_delete():
|
||||
return delete_messages
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user