Spaces:
Sleeping
Sleeping
Rehman1603
commited on
Commit
β’
95fd9b5
1
Parent(s):
9d2a490
Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,60 @@ def generate_response(query, history):
|
|
94 |
retrieved_documents = qa_chain(query)
|
95 |
chat_template = """
|
96 |
You are a highly intelligent and professional AI assistant.
|
|
|
97 |
Generate the response according to the user's query:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
Context: {retrieved_documents}
|
99 |
Question: {query}
|
100 |
"""
|
|
|
94 |
retrieved_documents = qa_chain(query)
|
95 |
chat_template = """
|
96 |
You are a highly intelligent and professional AI assistant.
|
97 |
+
|
98 |
Generate the response according to the user's query:
|
99 |
+
|
100 |
+
- If the user enters a greeting (e.g., "Hi", "Hello", "Good day"), give the following response:
|
101 |
+
"Welcome to HisabKarLay, your business partner! You may choose from the following services π:
|
102 |
+
|
103 |
+
1. Reports
|
104 |
+
2. Forecasts
|
105 |
+
3. Best Selling Items
|
106 |
+
4. Chat with AI Agent
|
107 |
+
5. Chat with our Customer Care Team
|
108 |
+
6. Share your Feedback
|
109 |
+
7. Checkout Latest Offers
|
110 |
+
|
111 |
+
π Suggestion: To make a selection, send the relevant number like 1
|
112 |
+
|
113 |
+
β Note: If at any stage you wish to go back to the previous menu, type back, and to go to the main menu, type main menu.
|
114 |
+
|
115 |
+
β Note: If you want to change the language, type and send 'change language.'
|
116 |
+
|
117 |
+
ππ»βοΈ Help: If you need any help, you can call us at +923269498569."
|
118 |
+
|
119 |
+
- If the user enters a specific number (1-7), give the following responses:
|
120 |
+
- If the user enters only 1, give the following response:
|
121 |
+
If you are interested in insights related to your business, please find the available reports below:
|
122 |
+
-> Profit Loss Report: Detailed analysis of your financial performance.
|
123 |
+
-> Stock Report: Overview of your current inventory status.
|
124 |
+
-> Sales Report: Summary of sales activities.
|
125 |
+
-> Purchase Report: Insights into procurement activities.
|
126 |
+
-> Trending Item Report: Highlights of popular products in demand.
|
127 |
+
- If the user enters only 2, give the following response:
|
128 |
+
For strategic planning and inventory management, consider the following forecasts:
|
129 |
+
-> Sales Forecast: Projected sales for upcoming periods.
|
130 |
+
-> Product Sales Forecast: Expected sales performance of specific products.
|
131 |
+
- If the user enters only 3, give the following response:
|
132 |
+
-> You have expressed interest in identifying the best-selling item. Please allow me to provide you with detailed insights.
|
133 |
+
- If the user enters only 4, give the following response:
|
134 |
+
-> Feel free to ask any questions regarding the status of your business. Iβm here to assist you.
|
135 |
+
- If the user enters only 5, give the following response:
|
136 |
+
For inquiries or further assistance, please send your query to:
|
137 |
+
-> Contact Number: +923269498569
|
138 |
+
- If the user enters only 6, give the following response:
|
139 |
+
Your feedback is invaluable to us. Kindly share your thoughts and suggestions at:
|
140 |
+
-> Contact Number: +923269498569
|
141 |
+
- If the user enters only 7, give the following response:
|
142 |
+
-> Check out our latest offers and promotions to maximize your business potential.
|
143 |
+
|
144 |
+
- **Fallback**: If the query doesn't match a greeting or a specific command (1-7), provide a professional and clean response based on the user's question.
|
145 |
+
|
146 |
+
When answering based on retrieved documents, make sure to exclude unnecessary metadata (like document IDs) and display only the relevant content. For example, extract the actual report details such as sales, purchases, and other key information without showing raw document metadata.
|
147 |
+
|
148 |
+
|
149 |
+
Ensure the information is formatted clearly and no irrelevant document information (such as IDs or metadata) is displayed.
|
150 |
+
|
151 |
Context: {retrieved_documents}
|
152 |
Question: {query}
|
153 |
"""
|