mavinsao commited on
Commit
2614653
·
verified ·
1 Parent(s): cae2161

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -21,21 +21,18 @@ retriever = vectorstore.as_retriever(search_kwargs={"k": 5})
21
 
22
  # Define a prompt template for course recommendations
23
  prompt_template = """
24
- You are an AI course recommendation system. Your task is to assist users by engaging them in conversation and providing course recommendations only when they explicitly ask for it.
25
-
26
- If the user does not indicate interest in receiving course recommendations, focus on engaging them in conversation and understanding their interests.
27
-
28
- Consider the summarized chat history to provide more relevant and personalized recommendations when requested.
29
 
30
  Summarized Chat History:
31
  {chat_history}
32
 
33
  User's Current Query: {question}
34
 
35
- If the user has asked for course recommendations, provide a list of relevant courses based on their interests and goals, emphasizing how the courses match the learning outcomes and syllabus content.
 
36
 
37
- Your response should include:
38
- 1. A detailed explanation of how the recommended courses align with the user's interests and previous queries, focusing on the "What You Will Learn" section and the syllabus content.
39
  2. A summary of each recommended course, highlighting:
40
  - The specific skills and knowledge the user will gain (from "What You Will Learn")
41
  - Key topics covered in the syllabus
@@ -45,7 +42,9 @@ Your response should include:
45
  4. Any additional advice or suggestions for the user's learning journey, based on the syllabus progression and their conversation history.
46
  5. Provide the course URLs for easy access.
47
 
48
- If the user has not explicitly requested course recommendations, respond in a conversational manner, encouraging them to share more about their interests or asking follow-up questions to better understand their needs.
 
 
49
 
50
  Recommendation:
51
  """
@@ -134,4 +133,4 @@ if prompt := st.chat_input("What are you looking to learn?"):
134
  # Optional: Add a button to clear the chat history
135
  if st.button("Clear Chat History"):
136
  st.session_state.messages.clear()
137
- st.experimental_rerun()
 
21
 
22
  # Define a prompt template for course recommendations
23
  prompt_template = """
24
+ You are an AI course recommendation system. Your task is to recommend courses based on the user's description of their interests and goals, with a strong emphasis on matching the learning outcomes and syllabus content. Consider the summarized chat history to provide more relevant and personalized recommendations.
 
 
 
 
25
 
26
  Summarized Chat History:
27
  {chat_history}
28
 
29
  User's Current Query: {question}
30
 
31
+ Based on the user's current query and chat history summary, here are some relevant courses from our database:
32
+ {context}
33
 
34
+ Please provide a personalized course recommendation. Your response should include:
35
+ 1. A detailed explanation of how the recommended courses match the user's interests and previous queries, focusing primarily on the "What You Will Learn" section and the syllabus content.
36
  2. A summary of each recommended course, highlighting:
37
  - The specific skills and knowledge the user will gain (from "What You Will Learn")
38
  - Key topics covered in the syllabus
 
42
  4. Any additional advice or suggestions for the user's learning journey, based on the syllabus progression and their conversation history.
43
  5. Provide the course URLs for easy access.
44
 
45
+ Prioritize courses that have the most relevant learning outcomes and syllabus content matching the user's description and previous interactions. If multiple courses are similarly relevant, you may suggest a learning path combining complementary courses.
46
+
47
+ Remember to be encouraging and supportive in your recommendation, and relate your suggestions to any preferences or constraints the user has mentioned in previous messages.
48
 
49
  Recommendation:
50
  """
 
133
  # Optional: Add a button to clear the chat history
134
  if st.button("Clear Chat History"):
135
  st.session_state.messages.clear()
136
+ st.experimental_rerun()