Sanchit Verma
commited on
Commit
Β·
37ececc
1
Parent(s):
60d960d
Initial project structure setup with configuration files and core modules
Browse files- .env +0 -0
- README.md +22 -0
- app.py +23 -0
- config.py +13 -0
- main.py +0 -6
- prompts.py +8 -0
- requirements.txt +0 -0
- utils.py +0 -0
.env
ADDED
File without changes
|
README.md
CHANGED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# π€ LLMates β Chat with Custom AI Personas
|
2 |
+
|
3 |
+
LLMates is a minimalist, persona-driven chatbot interface built using **Gradio** and **OpenAI's GPT-3.5**.
|
4 |
+
It lets you switch between assistant "personalities" like a **Python Tutor**, **Regex Helper**, or **Startup Coach**, all powered by curated prompt templates.
|
5 |
+
|
6 |
+
## π Features
|
7 |
+
- Predefined assistant personas (via prompt injection)
|
8 |
+
- Seamless Gradio chat interface with session memory
|
9 |
+
- Easy to extend with new roles or APIs
|
10 |
+
- Clean and modular code
|
11 |
+
|
12 |
+
## π§ Stack
|
13 |
+
- Gradio UI
|
14 |
+
- OpenAI Chat API (GPT-4.1)
|
15 |
+
- Python + dotenv
|
16 |
+
|
17 |
+
## π¦ Coming Soon
|
18 |
+
- Deploy on Hugging Face Spaces
|
19 |
+
- Add real-time persona switching
|
20 |
+
- Save/export chat sessions
|
21 |
+
|
22 |
+
---
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
"""
|
4 |
+
llmates.py
|
5 |
+
This module contains the main entry point for the llmates program.
|
6 |
+
It initializes the application and displays a welcome message.
|
7 |
+
"""
|
8 |
+
|
9 |
+
|
10 |
+
def main():
|
11 |
+
"""
|
12 |
+
The main entry point for the llmates program.
|
13 |
+
This function initializes the llmates application and displays a welcome message.
|
14 |
+
Returns:
|
15 |
+
None
|
16 |
+
"""
|
17 |
+
|
18 |
+
print("Hello from llmates!")
|
19 |
+
|
20 |
+
|
21 |
+
if __name__ == "__main__":
|
22 |
+
X = "Hello from the llama!"
|
23 |
+
main()
|
config.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
|
4 |
+
load_dotenv() # load .env variables
|
5 |
+
|
6 |
+
# β
LLM model config
|
7 |
+
MODEL_NAME = os.getenv("OPENAI_MODEL", "gpt-4o")
|
8 |
+
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
9 |
+
|
10 |
+
# β
System-wide constants
|
11 |
+
DEFAULT_PERSONA = "Python Tutor"
|
12 |
+
MAX_HISTORY_TURNS = 10 # truncate if needed
|
13 |
+
TEMPERATURE = 0.7
|
main.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
def main():
|
2 |
-
print("Hello from llmates!")
|
3 |
-
|
4 |
-
|
5 |
-
if __name__ == "__main__":
|
6 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prompts.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# prompts.py
|
2 |
+
|
3 |
+
PERSONAS = {
|
4 |
+
"Python Tutor": "You are a helpful Python programming tutor. Explain things simply with examples.",
|
5 |
+
"Regex Helper": "You are an expert in regular expressions. Help the user write and debug regex patterns.",
|
6 |
+
"Motivational Coach": "You are a high-energy motivational coach. Encourage and inspire the user.",
|
7 |
+
"Startup Advisor": "You are a seasoned startup advisor. Offer pragmatic, real-world advice concisely.",
|
8 |
+
}
|
requirements.txt
ADDED
File without changes
|
utils.py
ADDED
File without changes
|