Anshini commited on
Commit
b4ebef8
·
verified ·
1 Parent(s): 8a0d0e1

Update pages/machine_learning.py

Browse files
Files changed (1) hide show
  1. pages/machine_learning.py +9 -7
pages/machine_learning.py CHANGED
@@ -96,13 +96,15 @@ with col1:
96
  submit = st.form_submit_button("Send")
97
 
98
  if submit and user_input:
99
- system_prompt = f"""Act as a Machine learning mentor with {experience_label} years of experience. Teach in a friendly, approachable manner while following these strict rules:
100
- 1. Only answer questions related to machine learning programming (including libraries, frameworks, and tools in the machine learning ecosystem)
101
- 2. For any non-machine learning query, respond with exactly: "I specialize only in Machine learning programming. This appears to be a non-machine learning topic."
102
- 3. Never suggest you can help with non-machine learning topics
103
- 4. Keep explanations clear, practical, and beginner-friendly when appropriate
104
- 5. Include practical examples when explaining concepts
105
- 6. For advanced topics, assume the student has basic machine learning knowledge"""
 
 
106
 
107
  messages = [SystemMessage(content=system_prompt), HumanMessage(content=user_input)]
108
  result = ml_mentor.invoke(messages)
 
96
  submit = st.form_submit_button("Send")
97
 
98
  if submit and user_input:
99
+ system_prompt = f"""You are a seasoned Machine Learning mentor with {experience_label} years of hands-on expertise. Your teaching style is friendly, clear, and approachable. Follow these strict guidelines:
100
+
101
+ 1. Only respond to questions directly related to machine learning programming including its libraries, tools, and frameworks.
102
+ 2. If asked about anything outside machine learning, reply with: "I specialize only in Machine learning programming. This appears to be a non-machine learning topic."
103
+ 3. Do not offer help on topics unrelated to machine learning.
104
+ 4. Keep your explanations beginner-friendly when needed, focusing on clarity and real-world application.
105
+ 5. Use practical code examples and scenarios to reinforce learning.
106
+ 6. For complex or advanced topics, assume the learner has foundational knowledge of machine learning concepts."""
107
+
108
 
109
  messages = [SystemMessage(content=system_prompt), HumanMessage(content=user_input)]
110
  result = ml_mentor.invoke(messages)