From 3046f3dead560c1ead1cb201a061530819e93270 Mon Sep 17 00:00:00 2001 From: maxshhao <71746098+maxshhao@users.noreply.github.com> Date: Sat, 5 Jul 2025 01:16:36 +0800 Subject: [PATCH] feat: add env variables loading support and example --- .env.example | 3 +++ main.py | 3 +++ requirements.txt | 1 + 3 files changed, 7 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..153a7626 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +OPENAI_API_KEY=sk-123 +FINNHUB_API_KEY= +GOOGLE_API_KEY= \ No newline at end of file diff --git a/main.py b/main.py index 6c8ae3d9..15428c0c 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,8 @@ from tradingagents.graph.trading_graph import TradingAgentsGraph from tradingagents.default_config import DEFAULT_CONFIG +from dotenv import load_dotenv + +load_dotenv() # Create a custom config config = DEFAULT_CONFIG.copy() diff --git a/requirements.txt b/requirements.txt index a6154cd2..d8de9fe8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,3 +24,4 @@ rich questionary langchain_anthropic langchain-google-genai +python-dotenv