TradingAgents/tradingagents/dataflows/README.md

835 B

Dataflows

To add a new data source

  1. create a file with filename [sth]_utils.py and fetch data in it
  2. go to interface.py and wrap your utility in a function returning a str
  3. go to __init__.py and expose your function in interface.py
  4. go to agent_utils.py and wrap your function in class Toolkit with the following template:
    @staticmethod
    @tool
    def get_sth(params: Annotated[type, "comments"]):
        """docs"""
        return interface.your_func(params)
    
  5. modify _create_tool_nodes in trading_graph.py and news_analyst_node in each analyst creation file in tradingagents/agents/analysts/[sth]_analyst.py
  6. (OPTIONAL) modify prompts to tell models when to use the utility