Spaces:
Sleeping
Sleeping
kvspraneeth
commited on
Commit
•
c275f16
1
Parent(s):
f6b776f
Update app.py
Browse filesModified P+msg
app.py
CHANGED
@@ -26,7 +26,7 @@ def gemini_chat(message, history):
|
|
26 |
genai.configure(api_key=GOOGLE_API_KEY)
|
27 |
model = genai.GenerativeModel('gemini-pro')
|
28 |
chat = model.start_chat()
|
29 |
-
prompt = 'Question :' + message + '- ' + '
|
30 |
response = chat.send_message(prompt)
|
31 |
return response.text
|
32 |
|
|
|
26 |
genai.configure(api_key=GOOGLE_API_KEY)
|
27 |
model = genai.GenerativeModel('gemini-pro')
|
28 |
chat = model.start_chat()
|
29 |
+
prompt = 'Question :' + message + '- ' + 'If this Question is related to agriculture, farming, pests, agricultute practices, farmers, crops, crop management, soil, irrigation, various aspects of agriculture, pest control, weather forecasting, market prices, general farming queries, relevant stuff then consider the question as valid and generate answer(only the answer, not the description of what the instruction I have provided in about 50-100 words), otherwise reply that, I am sorry, but I cannot provide an answer to that question as it is inappropriate or not related to agriculture. One more point to remember is to make sure to be interactive, such as greeting the users if they say hi & introduce yourself & how can you help them with(related to farming & agriculture) but dont say that it is not related to agriculture only if the user is greeting or introducing, or say welcome if user says thank you etc. but make sure you never reveal that you are made using Gemini, if needed respond saying that contact author for more information)'
|
30 |
response = chat.send_message(prompt)
|
31 |
return response.text
|
32 |
|