venkat23 commited on
Commit
ee1f013
·
verified ·
1 Parent(s): 38705af

Update src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +51 -27
src/app.py CHANGED
@@ -19,22 +19,42 @@ from langchain.prompts import PromptTemplate
19
 
20
  # --- Prompt Engineering ---
21
  prompt_template = """""
22
- You are Venkatraman G, responding as a candidate in a job interview. Your goal is to be professional, confident, and concise.
23
-
24
- Use the following pieces of context, sourced from your resume, GitHub, LinkedIn, and portfolio website, to answer the question at the end.
25
-
26
- - Keep your answers concise and to the point, aiming for 3-4 lines.
27
- - Synthesize information from the different sources into a single, coherent answer.
28
- - When asked to rate your experience or skills (e.g., on a scale of 1-10), provide a confident self-assessment based on the projects and experience in the context, and briefly explain your reasoning.
29
- - If the question is irrelevant to your professional skills or experience, politely decline to answer and pivot back to your qualifications. For example, if asked about your favorite hobby, you could say: 'While I enjoy my personal time, I'm most passionate about applying my skills in data science to solve challenging problems. I'd be happy to discuss one of my recent projects if you're interested.'
30
- - If you don't know the answer from the context provided, state that you don't have direct experience with that topic but express a willingness to learn.
31
-
32
- Context:
33
- {context}
34
-
35
- Question: {question}
36
-
37
- Interview Answer:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  """""
39
  QA_CHAIN_PROMPT = PromptTemplate.from_template(prompt_template)
40
 
@@ -91,9 +111,9 @@ def qa_llm(_llm):
91
  # --- Main App Logic ---
92
 
93
  def main():
94
- st.set_page_config(page_title="Venky's Interactive Resume", layout="centered")
95
- st.markdown("<h1 style='text-align:center;color:blue;'>Explore Venky's Experience 🤖</h1>", unsafe_allow_html=True)
96
- st.markdown("### Ask me anything about Venky's skills, projects, and background!")
97
 
98
  # --- Sidebar for Actions ---
99
  with st.sidebar:
@@ -107,9 +127,7 @@ def main():
107
 
108
  st.markdown("---_")
109
  st.markdown("**Sources:**")
110
- st.markdown("- [GitHub](https://github.com/VenkatramanG45)")
111
- st.markdown("- [LinkedIn](https://www.linkedin.com/in/venkatramang2003/)")
112
- st.markdown("- Resume PDF(s) in `docs/` folder")
113
 
114
  # --- Main Chat Interface ---
115
  if not os.path.exists(PERSIST_DIR):
@@ -125,12 +143,18 @@ def main():
125
 
126
  # Pre-defined questions
127
  example_prompts = [
128
- "What is Venky's primary tech stack?",
129
- "Summarize Venky's professional experience.",
130
- "Show me some of Venky's key projects from GitHub.",
131
- "What is Venky's educational background?",
132
- "Does Venky have any certifications?"
 
 
 
 
 
133
  ]
 
134
  cols = st.columns(2)
135
  for i, prompt in enumerate(example_prompts):
136
  if cols[i % 2].button(prompt):
 
19
 
20
  # --- Prompt Engineering ---
21
  prompt_template = """""
22
+ You are Python programmer, assisting a user in coding choosing algorithms explaining concepts as a assistant and tutor, confident, and concise.
23
+
24
+
25
+ You said:
26
+ You are PyTutor, an expert Python programmer and teaching assistant.
27
+ Your role is to help users understand, design, and debug Python code confidently and clearly.
28
+
29
+ Guidelines:
30
+
31
+ Be concise, precise, and technically accurate.
32
+
33
+ Always explain the reasoning behind your code or solution.
34
+
35
+ When relevant, compare alternative approaches and explain why one is preferred.
36
+
37
+ Use simple language when explaining complex algorithms.
38
+
39
+ Prioritize clarity, correctness, and performance in code examples.
40
+
41
+ Provide step-by-step explanations for concepts or algorithms.
42
+
43
+ When teaching, use small, runnable Python snippets.
44
+
45
+ Avoid unnecessary verbosity or overgeneralization — keep answers focused and confident.
46
+
47
+ Always assume the user is learning Python actively and wants to understand, not just copy.
48
+
49
+ Tone:
50
+
51
+ Confident, concise, and instructive — like a skilled mentor guiding a student through real code.
52
+ Context:
53
+ {context}
54
+
55
+ Question: {question}
56
+
57
+ Interview Answer:
58
  """""
59
  QA_CHAIN_PROMPT = PromptTemplate.from_template(prompt_template)
60
 
 
111
  # --- Main App Logic ---
112
 
113
  def main():
114
+ st.set_page_config(page_title="Python DSA Tutor", layout="centered")
115
+ st.markdown("<h1 style='text-align:center;color:blue;'> Python DSA Tutor 🤖</h1>", unsafe_allow_html=True)
116
+ st.markdown("### Ask me anything about Python Programming and DSA")
117
 
118
  # --- Sidebar for Actions ---
119
  with st.sidebar:
 
127
 
128
  st.markdown("---_")
129
  st.markdown("**Sources:**")
130
+ st.markdown("- PDF(s) in `docs/` folder")
 
 
131
 
132
  # --- Main Chat Interface ---
133
  if not os.path.exists(PERSIST_DIR):
 
143
 
144
  # Pre-defined questions
145
  example_prompts = [
146
+ "Explain the difference between time and space complexity with examples.",
147
+ "Write an optimized Python solution for the Two Sum problem and explain your approach.",
148
+ "Can you walk me through how to solve a problem using dynamic programming?",
149
+ "Show me how to implement binary search and analyze its complexity.",
150
+ "Compare BFS and DFS in terms of use cases and efficiency.",
151
+ "What are the most common sorting algorithms used in interviews?",
152
+ "Explain how to detect a cycle in a linked list using Floyd’s algorithm.",
153
+ "Give me the Python code for merging two sorted arrays efficiently.",
154
+ "Walk me through solving a problem with recursion and then optimizing it with memoization.",
155
+ "How do I explain my approach to an interviewer for a graph traversal problem?"
156
  ]
157
+
158
  cols = st.columns(2)
159
  for i, prompt in enumerate(example_prompts):
160
  if cols[i % 2].button(prompt):