sylaork commited on
Commit
db2e5aa
·
verified ·
1 Parent(s): d5a5d3a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ # coding: utf-8
3
+
4
+ # In[ ]:
5
+
6
+
7
+ import streamlit as st
8
+ import google.generativeai as genai
9
+
10
+ genai.configure(api_key='AIzaSyDmDtBz5Q96JzzJHojpyR2m0KJ44TKaZm8')
11
+
12
+ st.title('Chat with Me')
13
+ model = genai.GenerativeModel('gemini-1.5-pro-latest')
14
+ chat = model.start_chat(history=[])
15
+
16
+ soru = st.text_input('Sen:')
17
+
18
+ if st.button('Sor'):
19
+ response = chat.send_message(soru)
20
+ st.write(response.text)
21
+ st.write(chat.history)
22
+
23
+ if st.button('Yeni Sohbet'):
24
+ chat = model.start_chat(history=chat.history)