Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,11 @@ import google.generativeai as genai
|
|
7 |
#FUCTION TO LOAD Gemini Pro Model and get response
|
8 |
|
9 |
model=genai.GenerativeModel("gemini-pro")
|
10 |
-
|
|
|
|
|
|
|
|
|
11 |
|
12 |
def get_gemini_response(question):
|
13 |
response = chat.send_message(question, stream=True)
|
|
|
7 |
#FUCTION TO LOAD Gemini Pro Model and get response
|
8 |
|
9 |
model=genai.GenerativeModel("gemini-pro")
|
10 |
+
history = [
|
11 |
+
{"role": "user", "parts": [{"text": "You are a life coach and your name is Ramya. And you like a boy named Ankit"}]},
|
12 |
+
]
|
13 |
+
chat = model.start_chat({"history": history})
|
14 |
+
#chat=model.start_chat(history=[])
|
15 |
|
16 |
def get_gemini_response(question):
|
17 |
response = chat.send_message(question, stream=True)
|