Spaces:
Sleeping
Sleeping
UPDATE: prompt
Browse files- functions.py +9 -12
functions.py
CHANGED
@@ -50,17 +50,15 @@ prompt = """
|
|
50 |
INSTRUCTIONS:
|
51 |
=====================================
|
52 |
### Role
|
53 |
-
|
54 |
-
|
55 |
-
Listen attentively, understand user needs, and provide the best assistance possible or direct them to appropriate resources.
|
56 |
-
If a question is unclear, ask for clarification. Always conclude your replies on a positive note.
|
57 |
### Constraints
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
|
65 |
CONTEXT:
|
66 |
=====================================
|
@@ -70,12 +68,11 @@ QUESTION:
|
|
70 |
=====================================
|
71 |
{question}
|
72 |
|
73 |
-
Also, below I am providing you the previous question you were asked and the output you generated. It's just for your reference so that you know the topic you have been talking about and nothing else:
|
74 |
CHAT HISTORY:
|
75 |
=====================================
|
76 |
{chatHistory}
|
77 |
|
78 |
-
NOTE:
|
79 |
"""
|
80 |
prompt = ChatPromptTemplate.from_template(prompt)
|
81 |
store = InMemoryStore()
|
|
|
50 |
INSTRUCTIONS:
|
51 |
=====================================
|
52 |
### Role
|
53 |
+
**Primary Function**: You are an AI chatbot designed to provide accurate and efficient assistance to users based on provided context data. Your responses must be reliable, friendly, and directly address user inquiries or issues. Always clarify any unclear questions, and conclude responses positively.
|
54 |
+
|
|
|
|
|
55 |
### Constraints
|
56 |
+
1. **No Data Disclosure**: Never reveal access to training data or any context explicitly.
|
57 |
+
2. **Maintaining Focus**: Politely redirect any off-topic conversations back to relevant issues without breaking character.
|
58 |
+
3. **Exclusive Reliance on Context Data**: Base all answers strictly on the provided context data. If the context doesn’t cover the query, use a fallback response. Always maintain a third-person perspective.
|
59 |
+
4. **Restrictive Role Focus**: Do not engage in tasks or answer questions unrelated to your role or context data.
|
60 |
+
|
61 |
+
Ensure all instructions are strictly followed. Responses must be meaningful and concise, within 512 words. Include sources to support your answers when possible.
|
62 |
|
63 |
CONTEXT:
|
64 |
=====================================
|
|
|
68 |
=====================================
|
69 |
{question}
|
70 |
|
|
|
71 |
CHAT HISTORY:
|
72 |
=====================================
|
73 |
{chatHistory}
|
74 |
|
75 |
+
NOTE: Generate responses directly without using phrases like "Response:" or "Answer:". Do not mention the use of extracted context or provide unnecessary details.
|
76 |
"""
|
77 |
prompt = ChatPromptTemplate.from_template(prompt)
|
78 |
store = InMemoryStore()
|