Skip to content

Commit fab4484

Browse files
committed
Enhance README and news.py with personalized configuration examples
1 parent a87ff92 commit fab4484

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

agents/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,38 @@ Agents use LLMs to take action or provide curated reports.
44

55
## News Bot
66

7-
The [news.py](news.py) script will use an OpenAI API based LLM to process raw weather payloads, stock prices and top news items into a curated news report. This can be set up as a scheduled cron job to send you the news.
7+
The [news.py](news.py) script will use an OpenAI API based LLM to process raw weather payloads, stock prices and top news items into a curated news report. This can be set up as a scheduled cron job to send a personalized news update (see [news-cron.sh](news-cron.sh)).
88

99
```bash
10-
# Update environmental variables for your use case
11-
ALPHA_KEY=ABC123 OPENAI_API_BASE=http://localhost:8000/v1 COMPANY=MyCompany python3 news.py
10+
echo "Gathering the news for you..."
11+
12+
# Update these configurations
13+
export ABOUT_ME="I'm a 35 year old woman who lives in Los Angeles. I work at Acme in technology and AI. I have 2 boys."
14+
export COMPANY="MyCompany"
15+
export ALPHA_KEY="alpha-key" # Get Alpha Advantage API Key for Stock Prices - https://www.alphavantage.co/
16+
export OPENAI_API_BASE="http://localhost:4000/v1"
17+
export OPENAI_API_KEY="sk-3-laws-safe"
18+
export LLM_MODEL="llama"
19+
export CITY="Los Angeles"
20+
export CITY_WEEKEND="Ventura"
21+
export EMAIL_FORMAT=true
22+
23+
echo ""
24+
python3 ./news.py
1225
```
1326

1427
## Movie Bot
1528

1629
The [movie.py](movie.py) script uses an LLM to make a movie suggestion. It records previous recommendations to prevent repeating suggestions. Outputs a single line recommendation and writes a full detailed recommendation to MESSAGE_FILE. This can be set up as a scheduled cron job to send you a text or email you a recommendation.
1730

1831
```bash
32+
echo "Thinking about a movie recommendation for you..."
33+
34+
# Update these configurations
1935
export OPENAI_API_BASE="http://localhost:4000/v1"
2036
export OPENAI_API_KEY="sk-3-laws-safe"
2137
export LLM_MODEL="llama"
38+
export ABOUT_ME="We love movies! Action, adventure, sci-fi and feel good movies are our favorites."
2239
export DATABASE="./movie.db"
2340
export MESSAGE_FILE="./message.txt"
2441

agents/news.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def error(text):
4343
TEMPERATURE = float(os.environ.get("TEMPERATURE", 0.0)) # LLM temperature
4444
USE_SYSTEM = os.environ.get("USE_SYSTEM", "false").lower() == "true" # Use system in chat prompt if True
4545
RESULTS = int(os.environ.get("RESULTS", 10)) # Number of results to return from Weaviate
46-
ALPHA_KEY = os.environ.get("ALPHA_KEY", "alpha-key") # Alpha Vantage API Key
46+
ALPHA_KEY = os.environ.get("ALPHA_KEY", "alpha-key") # Alpha Vantage API Key - https://www.alphavantage.co
4747
COMPANY = os.environ.get("COMPANY", "Google") # Company to use for stock news
4848
CITY = os.environ.get("CITY", "Los Angeles") # City to use for weather news
4949
CITY_WEEKEND = os.environ.get("CITY_WEEKEND", "Ventura") # City to use for weather news on weekends

0 commit comments

Comments
 (0)