Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,19 @@ import scipy.io.wavfile as wavfile # For writing WAV data to in-memory file
|
|
7 |
import numpy as np # To handle the audio array
|
8 |
import datetime # For logging timestamps if needed (not directly used in this version, but good practice)
|
9 |
|
10 |
-
system_prompt = """
|
11 |
-
|
12 |
-
|
13 |
-
-
|
14 |
-
-
|
15 |
-
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# Initialize the SpeechRecognition Recognizer
|
19 |
r = sr.Recognizer()
|
@@ -26,8 +32,7 @@ def transcribe_audio_and_chat(audio_tuple, history, api_key):
|
|
26 |
|
27 |
if audio_tuple is None:
|
28 |
# If no audio is received, add an assistant message to history and reset audio input
|
29 |
-
|
30 |
-
return history, history, None
|
31 |
|
32 |
# Ensure history is a list, even if it somehow became None (defensive programming)
|
33 |
if history is None:
|
|
|
7 |
import numpy as np # To handle the audio array
|
8 |
import datetime # For logging timestamps if needed (not directly used in this version, but good practice)
|
9 |
|
10 |
+
system_prompt = """
|
11 |
+
You are a voice bot representing Krishnavamshi Thumma. When responding to questions, answer as if you are:
|
12 |
+
|
13 |
+
- A Generative AI and Data Engineering enthusiast with 1.5+ years of experience in data pipelines, automation, and scalable solutions
|
14 |
+
- Currently working as a Data Engineer at Wishkarma in Hyderabad, where you've optimized ETL pipelines processing 10K+ records daily and developed an image-based product similarity search engine using CLIP-ViT-L/14
|
15 |
+
- Previously worked as a Data Engineer Intern at DeepThought Growth Management System, where you processed 700+ data records and mentored 400+ students
|
16 |
+
- Skilled in Python, SQL, JavaScript (Node.js), OpenAI GPT-4o, LangChain, MongoDB Vector Search, FAISS, Apache Airflow, AWS Lambda, and FastAPI
|
17 |
+
- Experienced in building GenAI products including conversational AI chatbots, RAG pipelines, and AI-powered tools
|
18 |
+
- A Computer Science graduate from Neil Gogte Institute of Technology with a CGPA of 7.5/10
|
19 |
+
- Passionate about solving real-world problems at the intersection of AI and software engineering
|
20 |
+
|
21 |
+
Answer questions about your background, experience, projects, and skills based on this resume. Keep responses professional but engaging (2-3 sentences max for most questions).
|
22 |
+
"""
|
23 |
|
24 |
# Initialize the SpeechRecognition Recognizer
|
25 |
r = sr.Recognizer()
|
|
|
32 |
|
33 |
if audio_tuple is None:
|
34 |
# If no audio is received, add an assistant message to history and reset audio input
|
35 |
+
raise gr.Error("No audio received. Please speak into the microphone.")
|
|
|
36 |
|
37 |
# Ensure history is a list, even if it somehow became None (defensive programming)
|
38 |
if history is None:
|