Skip to content

Commit a87ff92

Browse files
committed
Add movie bot functionality
1 parent ceed0ba commit a87ff92

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

agents/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,33 @@ 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.
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.
88

99
```bash
1010
# Update environmental variables for your use case
1111
ALPHA_KEY=ABC123 OPENAI_API_BASE=http://localhost:8000/v1 COMPANY=MyCompany python3 news.py
1212
```
1313

14+
## Movie Bot
15+
16+
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.
17+
18+
```bash
19+
export OPENAI_API_BASE="http://localhost:4000/v1"
20+
export OPENAI_API_KEY="sk-3-laws-safe"
21+
export LLM_MODEL="llama"
22+
export DATABASE="./movie.db"
23+
export MESSAGE_FILE="./message.txt"
24+
25+
python3 ./movie.py
26+
```
27+
28+
## Conversational Agent
29+
30+
The [conversational.py](conversational.py) script uses an LLM (or two LLMs) to create a back and forth conversation.
31+
This script sets up a teacher and student identities. The teacher and student LLMs take turns responding to each other.
32+
The conversation continues until a stop prompt is given or a maximum number of rounds is reached. The teacher LLM then provides a summary of the conversation and an evaluation of the student.
33+
34+
```bash
35+
python3 conversational.py
36+
```

agents/judge.py renamed to agents/conversational.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
# This is a an example agent that communicates with two LLMs
2-
# to create a conversation.
3-
#
4-
# The first LLM is a teacher and the second LLM is a student.
1+
#!/usr/bin/python3
2+
"""
3+
Conversational Agent - Example of an agent that uses two LLMs to create a conversation.
4+
This agent is a teacher and student conversation.
5+
6+
* Currently set up to use one LLM but can be easily modified to use two LLMs.
7+
* The first LLM is the teacher and the second LLM is the student.
8+
* The teacher and student LLMs take turns responding to each other.
9+
* The conversation continues until a stop prompt is given or a maximum number of rounds is reached.
10+
* The teacher LLM then provides a summary of the conversation and an evaluation of the student.
11+
12+
Author: Jason A. Cox
13+
1 Feb 2025
14+
https://github.com/jasonacox/TinyLLM
15+
16+
"""
517

618
import openai
719

0 commit comments

Comments
 (0)