Update app.py
Browse files
app.py
CHANGED
|
@@ -11,26 +11,15 @@ def get_gemini_response(question):
|
|
| 11 |
response=chat.send_message(question,stream=True)
|
| 12 |
return response
|
| 13 |
|
| 14 |
-
st.set_page_config(page_title="Q&A
|
| 15 |
|
| 16 |
st.header("Gemini LLM Application")
|
| 17 |
|
| 18 |
-
# # Initialize session state for chat history if it doesn't exist
|
| 19 |
-
# if 'chat_history' not in st.session_state:
|
| 20 |
-
# st.session_state['chat_history'] = []
|
| 21 |
-
|
| 22 |
input=st.text_input("Input: ",key="input")
|
| 23 |
submit=st.button("Ask the question")
|
| 24 |
|
| 25 |
if submit and input:
|
| 26 |
response=get_gemini_response(input)
|
| 27 |
-
|
| 28 |
-
# st.session_state['chat_history'].append(("You", input))
|
| 29 |
-
st.subheader("The Response is")
|
| 30 |
for chunk in response:
|
| 31 |
-
st.write(chunk.text)
|
| 32 |
-
# st.session_state['chat_history'].append(("Bot", chunk.text))
|
| 33 |
-
# st.subheader("The Chat History is")
|
| 34 |
-
|
| 35 |
-
# for role, text in st.session_state['chat_history']:
|
| 36 |
-
# st.write(f"{role}: {text}")
|
|
|
|
| 11 |
response=chat.send_message(question,stream=True)
|
| 12 |
return response
|
| 13 |
|
| 14 |
+
st.set_page_config(page_title="Q&A with Gemini")
|
| 15 |
|
| 16 |
st.header("Gemini LLM Application")
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
input=st.text_input("Input: ",key="input")
|
| 19 |
submit=st.button("Ask the question")
|
| 20 |
|
| 21 |
if submit and input:
|
| 22 |
response=get_gemini_response(input)
|
| 23 |
+
st.subheader("Response: ")
|
|
|
|
|
|
|
| 24 |
for chunk in response:
|
| 25 |
+
st.write(chunk.text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|