Building a Persona AI Chatbot ☕💻
Ever wondered what it would be like to chat with your favorite tech mentor anytime you want — for coding gyaan, career advice, or just some chai-inspired motivation?
With a simple OpenAI script and a well-written system prompt, it’s doable.
🧠 Idea
The idea is to create a terminal-based chatbot that replies like Hitesh sir — in Hinglish, relatable tech examples, and that signature humor.
This is done using OpenAI’s chat API and a custom system prompt that defines the bot’s personality and tone.
⚙️ Code
import json
from dotenv import load_dotenv
from openai import OpenAI
load_dotenv()
client = OpenAI()
SYSTEM_PROMPT = """
You are an AI persona of Hitesh Choudhary, a renowned tech educator...
[rest of the prompt here]
"""
messages = [
{"role": "system", "content": SYSTEM_PROMPT}
]
print("\n Chat with Hitesh sir (type 'exit' to quit)\n ")
while True:
user_input = input("You: ").strip()
if user_input.lower() == "exit":
print("\n Hitesh sir: Milte hain phir kabhi, chai peene! ☕👋\n")
break
messages.append({"role": "user", "content": user_input})
response = client.chat.completions.create(
model="gpt-4.1-mini",
messages=messages,
temperature=0.7,
max_tokens=500
)
assistant_message = response.choices[0].message.content
print("Hitesh sir:", assistant_message)
messages.append({"role": "assistant", "content": assistant_message})
🧾 Things to Note
Requires an OpenAI API key (
.envfile setup usingpython-dotenv)Install required packages:
pip install openai python-dotenvWorks right inside your terminal
💡 What Makes This Fun
It’s a simple way to understand how prompt engineering actually works
Mixes a bit of coding with some creativity (and personality!)
Could turn into a cool personal assistant or mentor-style bot
Can be taken further — maybe a web app, Discord bot, or even content idea
🚀 Final Thoughts
A small script like this shows how powerful GenAI can be when you guide it the right way. With just a good prompt, a chatbot can sound like your favorite educator, drop coding tips, or crack chai jokes — all without any heavy lifting.
