Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -158,16 +158,71 @@ Context: {context}
|
|
158 |
Chat History: {chat_history}
|
159 |
Question: {question}
|
160 |
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
Answer:"""
|
164 |
|
|
|
165 |
fallback_template = """As an expert organic farming consultant with specialization in Agro-Homeopathy, analyze the following context and question to provide a clear, structured response.
|
166 |
|
167 |
Chat History: {chat_history}
|
168 |
Question: {question}
|
169 |
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
Answer:"""
|
173 |
|
@@ -215,8 +270,8 @@ if submit_button and query:
|
|
215 |
|
216 |
# Get response with memory context
|
217 |
result = qa({
|
218 |
-
|
219 |
-
|
220 |
})
|
221 |
|
222 |
if result['result'].strip() == "":
|
|
|
158 |
Chat History: {chat_history}
|
159 |
Question: {question}
|
160 |
|
161 |
+
Provide your response in the following format:
|
162 |
+
Analysis: Analyze the described plant condition
|
163 |
+
Treatment: Recommend relevant organic farming principles and specific homeopathic medicine(s) with exact potency and repetition frequency. Suggest a maximum of 4 medicines in the order of relevance for any single problem.
|
164 |
+
Instructions for Use:
|
165 |
+
Small Plots or Gardens: Make sure your dispensing equipment is not contaminated with
|
166 |
+
other chemicals or fertilisers as these may antidote the energetic effects of the treatment—
|
167 |
+
rinse well with hot water before use if necessary. Add one pill to each 200 ml of water, shake
|
168 |
+
vigorously, and then spray or water your plants. Avoid using other chemicals or fertilisers for
|
169 |
+
10 days following treatment so that the energetic effects of the treatment are not antidoted.
|
170 |
+
(One vial of 100 pills makes 20 litres. Plants remain insect or disease free for up to 3 months
|
171 |
+
following one treatment.)
|
172 |
+
Large Plots or Farms: Add the remedy to water and apply with the dispensing device of
|
173 |
+
your choice: watering can, backpack sprayer, boomspray, reticulation systems (add to tanks
|
174 |
+
or pumps). Make sure your dispensing equipment is not contaminated with other chemicals
|
175 |
+
or fertilisers as these may antidote the energetic effects of the treatment—rinse with hot
|
176 |
+
water or steam clean before use if necessary. Avoid using other chemicals or fertilisers for
|
177 |
+
10 days following treatment.
|
178 |
+
Dosage rates are approximate and may vary according to different circumstances and
|
179 |
+
experiences. Suggested doses are:
|
180 |
+
10 pills or 10ml/10 litre on small areas,
|
181 |
+
500 pills or 125ml/500l per hectare,
|
182 |
+
1000 pills or 250ml/500l per hectare,
|
183 |
+
2500 pills or 500ml/500l per hectare,
|
184 |
+
Add pills or liquid to your water and mix (with a stick if necessary for large containers).
|
185 |
+
|
186 |
+
Recommendations: Provide couple of key pertinent recommendations based on the query
|
187 |
+
|
188 |
+
Remember to maintain a professional, clear tone and ensure all medicine recommendations include specific potency.
|
189 |
|
190 |
Answer:"""
|
191 |
|
192 |
+
|
193 |
fallback_template = """As an expert organic farming consultant with specialization in Agro-Homeopathy, analyze the following context and question to provide a clear, structured response.
|
194 |
|
195 |
Chat History: {chat_history}
|
196 |
Question: {question}
|
197 |
|
198 |
+
Provide your response in the following format:
|
199 |
+
Analysis: Analyze the described plant condition
|
200 |
+
Treatment: Recommend relevant organic farming principles and specific homeopathic medicine(s) with exact potency and repetition frequency. Suggest a maximum of 4 medicines in the order of relevance for any single problem.
|
201 |
+
Instructions for Use:
|
202 |
+
Small Plots or Gardens: Make sure your dispensing equipment is not contaminated with
|
203 |
+
other chemicals or fertilisers as these may antidote the energetic effects of the treatment—
|
204 |
+
rinse well with hot water before use if necessary. Add one pill to each 200 ml of water, shake
|
205 |
+
vigorously, and then spray or water your plants. Avoid using other chemicals or fertilisers for
|
206 |
+
10 days following treatment so that the energetic effects of the treatment are not antidoted.
|
207 |
+
(One vial of 100 pills makes 20 litres. Plants remain insect or disease free for up to 3 months
|
208 |
+
following one treatment.)
|
209 |
+
Large Plots or Farms: Add the remedy to water and apply with the dispensing device of
|
210 |
+
your choice: watering can, backpack sprayer, boomspray, reticulation systems (add to tanks
|
211 |
+
or pumps). Make sure your dispensing equipment is not contaminated with other chemicals
|
212 |
+
or fertilisers as these may antidote the energetic effects of the treatment—rinse with hot
|
213 |
+
water or steam clean before use if necessary. Avoid using other chemicals or fertilisers for
|
214 |
+
10 days following treatment.
|
215 |
+
Dosage rates are approximate and may vary according to different circumstances and
|
216 |
+
experiences. Suggested doses are:
|
217 |
+
10 pills or 10ml/10 litre on small areas,
|
218 |
+
500 pills or 125ml/500l per hectare,
|
219 |
+
1000 pills or 250ml/500l per hectare,
|
220 |
+
2500 pills or 500ml/500l per hectare,
|
221 |
+
Add pills or liquid to your water and mix (with a stick if necessary for large containers).
|
222 |
+
|
223 |
+
Recommendations: Provide couple of key pertinent recommendations based on the query
|
224 |
+
|
225 |
+
Remember to maintain a professional, clear tone and ensure all medicine recommendations include specific potency.
|
226 |
|
227 |
Answer:"""
|
228 |
|
|
|
270 |
|
271 |
# Get response with memory context
|
272 |
result = qa({
|
273 |
+
"question": query,
|
274 |
+
"chat_history": st.session_state.memory.chat_memory.messages if st.session_state.memory else []
|
275 |
})
|
276 |
|
277 |
if result['result'].strip() == "":
|