fix: main.py no longer hardcodes LLM models
Remove hardcoded 'gpt-5-mini' overrides so that LLM settings from DEFAULT_CONFIG (and thus .env) are properly respected.
This commit is contained in:
parent
01bd138f84
commit
b405cd6209
27
main.py
27
main.py
|
|
@ -1,31 +1,20 @@
|
||||||
from tradingagents.graph.trading_graph import TradingAgentsGraph
|
from tradingagents.graph.trading_graph import TradingAgentsGraph
|
||||||
from tradingagents.default_config import DEFAULT_CONFIG
|
from tradingagents.default_config import DEFAULT_CONFIG
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
# DEFAULT_CONFIG already loads .env via python-dotenv
|
||||||
|
# All LLM settings can be overridden via environment variables:
|
||||||
# Load environment variables from .env file
|
# LLM_PROVIDER, BACKEND_URL, DEEP_THINK_LLM, QUICK_THINK_LLM
|
||||||
load_dotenv()
|
|
||||||
|
|
||||||
# Create a custom config
|
|
||||||
config = DEFAULT_CONFIG.copy()
|
config = DEFAULT_CONFIG.copy()
|
||||||
config["deep_think_llm"] = "gpt-5-mini" # Use a different model
|
config["max_debate_rounds"] = 1
|
||||||
config["quick_think_llm"] = "gpt-5-mini" # Use a different model
|
|
||||||
config["max_debate_rounds"] = 1 # Increase debate rounds
|
|
||||||
|
|
||||||
# Configure data vendors (default uses yfinance, no extra API keys needed)
|
# Configure data vendors (default uses yfinance, no extra API keys needed)
|
||||||
config["data_vendors"] = {
|
config["data_vendors"] = {
|
||||||
"core_stock_apis": "yfinance", # Options: alpha_vantage, yfinance
|
"core_stock_apis": "yfinance",
|
||||||
"technical_indicators": "yfinance", # Options: alpha_vantage, yfinance
|
"technical_indicators": "yfinance",
|
||||||
"fundamental_data": "yfinance", # Options: alpha_vantage, yfinance
|
"fundamental_data": "yfinance",
|
||||||
"news_data": "yfinance", # Options: alpha_vantage, yfinance
|
"news_data": "yfinance",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize with custom config
|
|
||||||
ta = TradingAgentsGraph(debug=True, config=config)
|
ta = TradingAgentsGraph(debug=True, config=config)
|
||||||
|
|
||||||
# forward propagate
|
|
||||||
_, decision = ta.propagate("NVDA", "2024-05-10")
|
_, decision = ta.propagate("NVDA", "2024-05-10")
|
||||||
print(decision)
|
print(decision)
|
||||||
|
|
||||||
# Memorize mistakes and reflect
|
|
||||||
# ta.reflect_and_remember(1000) # parameter is the position returns
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue