Update prompts.py
Browse files- prompts.py +48 -53
prompts.py
CHANGED
@@ -1,53 +1,48 @@
|
|
1 |
-
from langchain.prompts import PromptTemplate
|
2 |
-
|
3 |
-
qa_template = (
|
4 |
-
"""
|
5 |
-
<|
|
6 |
-
You are an AI assistant specialized in answering academic queries with accuracy and clarity.
|
7 |
-
|
8 |
-
### Instructions
|
9 |
-
- Read the user's question carefully.
|
10 |
-
- Provide a concise and informative answer based on available knowledge.
|
11 |
-
- If the question is unclear, ask for clarification.
|
12 |
-
- If you do not know the answer, respond with "I'm not sure."
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
<|
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
"""
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
input_variables=["
|
47 |
-
template=
|
48 |
-
)
|
49 |
-
|
50 |
-
SUMMARIZATION_PROMPT = PromptTemplate(
|
51 |
-
input_variables=["document_text"],
|
52 |
-
template=summarization_template
|
53 |
-
)
|
|
|
1 |
+
from langchain.prompts import PromptTemplate
|
2 |
+
|
3 |
+
qa_template = (
|
4 |
+
"""
|
5 |
+
<|im_start|>system
|
6 |
+
You are an AI assistant specialized in answering academic queries with accuracy and clarity.
|
7 |
+
|
8 |
+
### Instructions
|
9 |
+
- Read the user's question carefully.
|
10 |
+
- Provide a concise and informative answer based on available knowledge.
|
11 |
+
- If the question is unclear, ask for clarification.
|
12 |
+
- If you do not know the answer, respond with "I'm not sure." <|im_end|>
|
13 |
+
|
14 |
+
<|im_start|>user
|
15 |
+
### User Question
|
16 |
+
{question} <|im_end|>
|
17 |
+
<|im_start|>assistant
|
18 |
+
Answer:
|
19 |
+
""")
|
20 |
+
|
21 |
+
summarization_template = (
|
22 |
+
"""
|
23 |
+
<|im_start|>system
|
24 |
+
You are a highly skilled AI that specializes in summarizing academic content.
|
25 |
+
|
26 |
+
### Instructions
|
27 |
+
- Read the provided text carefully.
|
28 |
+
- Extract the most important key points while maintaining clarity.
|
29 |
+
- Summarize in a way that retains the core meaning but is concise.
|
30 |
+
- Output only the summary without additional explanations. <|im_end|>
|
31 |
+
|
32 |
+
<|im_start|>user
|
33 |
+
### Text to Summarize
|
34 |
+
{document_text} <|im_end|>
|
35 |
+
|
36 |
+
<|im_start|>assistant
|
37 |
+
Summary:
|
38 |
+
""")
|
39 |
+
|
40 |
+
QA_PROMPT = PromptTemplate(
|
41 |
+
input_variables=["question"],
|
42 |
+
template=qa_template
|
43 |
+
)
|
44 |
+
|
45 |
+
SUMMARIZATION_PROMPT = PromptTemplate(
|
46 |
+
input_variables=["document_text"],
|
47 |
+
template=summarization_template
|
48 |
+
)
|
|
|
|
|
|
|
|
|
|