feat: add .env support for API keys, update docs, and add python-dotenv
This commit is contained in:
parent
a438acdbbd
commit
6b03425e8c
|
|
@ -0,0 +1,14 @@
|
|||
# Finnhub API Key
|
||||
FINNHUB_API_KEY="YOUR_FINNHUB_API_KEY"
|
||||
|
||||
# OpenAI API Key
|
||||
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
|
||||
|
||||
# Data directory
|
||||
DATA_DIR="/Users/yluo/Documents/Code/ScAI/FR1-data"
|
||||
|
||||
# LLM settings
|
||||
LLM_PROVIDER="openai"
|
||||
DEEP_THINK_LLM="o4-mini"
|
||||
QUICK_THINK_LLM="gpt-4o-mini"
|
||||
BACKEND_URL="https://api.openai.com/v1"
|
||||
12
README.md
12
README.md
|
|
@ -114,15 +114,15 @@ pip install -r requirements.txt
|
|||
|
||||
### Required APIs
|
||||
|
||||
You will also need the FinnHub API for financial data. All of our code is implemented with the free tier.
|
||||
You will need API keys from FinnHub and OpenAI. You can provide them by creating a `.env` file in the root of the project. Rename the `.env.sample` file to `.env` and add your API keys:
|
||||
|
||||
```bash
|
||||
export FINNHUB_API_KEY=$YOUR_FINNHUB_API_KEY
|
||||
# .env
|
||||
FINNHUB_API_KEY="YOUR_FINNHUB_API_KEY"
|
||||
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
|
||||
```
|
||||
|
||||
You will need the OpenAI API for all the agents.
|
||||
```bash
|
||||
export OPENAI_API_KEY=$YOUR_OPENAI_API_KEY
|
||||
```
|
||||
The application will automatically load these keys. Alternatively, you can still use environment variables if you prefer.
|
||||
|
||||
### CLI Usage
|
||||
|
||||
|
|
|
|||
|
|
@ -24,3 +24,5 @@ rich
|
|||
questionary
|
||||
langchain_anthropic
|
||||
langchain-google-genai
|
||||
|
||||
python-dotenv
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
DEFAULT_CONFIG = {
|
||||
"project_dir": os.path.abspath(os.path.join(os.path.dirname(__file__), ".")),
|
||||
|
|
|
|||
Loading…
Reference in New Issue