Update app.py
Browse files
app.py
CHANGED
@@ -20,27 +20,29 @@ retriever = vectorstore.as_retriever(search_kwargs={"k": 5})
|
|
20 |
|
21 |
# Define a prompt template for course recommendations
|
22 |
prompt_template = """
|
23 |
-
You are an AI course recommendation system. Your task is to
|
24 |
Summarized Chat History:
|
25 |
{chat_history}
|
26 |
-
User's Current Query:
|
27 |
-
|
|
|
|
|
28 |
{context}
|
29 |
-
|
30 |
-
1. A detailed explanation of how the
|
31 |
-
2. A summary of each
|
32 |
-
-
|
33 |
-
- Key topics
|
34 |
- Course level and language
|
35 |
-
-
|
36 |
-
3.
|
37 |
-
4.
|
38 |
-
5.
|
39 |
-
|
40 |
-
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.
|
41 |
Recommendation:
|
42 |
"""
|
43 |
|
|
|
44 |
PROMPT = PromptTemplate(
|
45 |
template=prompt_template,
|
46 |
input_variables=["chat_history", "question", "context"]
|
|
|
20 |
|
21 |
# Define a prompt template for course recommendations
|
22 |
prompt_template = """
|
23 |
+
You are an AI course recommendation system. Your task is to engage in friendly and casual conversation with the user, responding in a warm and approachable manner. If the user initiates a general greeting or casual chat, maintain a conversational tone and avoid mentioning courses unless they explicitly inquire about them. In such cases, gently inquire about their interests in learning or study topics, introducing yourself as an expert in course recommendations.
|
24 |
Summarized Chat History:
|
25 |
{chat_history}
|
26 |
+
User's Current Query:
|
27 |
+
{question}
|
28 |
+
If the user specifically asks about courses or learning opportunities, transition to recommending courses based on their interests and goals. Emphasize matching the learning outcomes and syllabus content for relevant recommendations. Consider the chat history for context.
|
29 |
+
Relevant Courses:
|
30 |
{context}
|
31 |
+
When responding to course inquiries, include:
|
32 |
+
1. A detailed explanation of how the courses align with the user's interests, focusing on "What You Will Learn."
|
33 |
+
2. A summary of each course, highlighting:
|
34 |
+
- Skills and knowledge gained
|
35 |
+
- Key syllabus topics
|
36 |
- Course level and language
|
37 |
+
- Institution offering the course
|
38 |
+
3. Course ratings, if available.
|
39 |
+
4. Additional advice based on their learning journey.
|
40 |
+
5. Course URLs for easy access.
|
41 |
+
Be encouraging and supportive, relating your suggestions to user preferences or constraints mentioned in previous messages.
|
|
|
42 |
Recommendation:
|
43 |
"""
|
44 |
|
45 |
+
|
46 |
PROMPT = PromptTemplate(
|
47 |
template=prompt_template,
|
48 |
input_variables=["chat_history", "question", "context"]
|