Spaces:
Runtime error
Runtime error
File size: 708 Bytes
42e73b8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# -*- coding: utf-8 -*-
"""chatMe.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1UoKqF9Ve7YWhkkF-Zd-opjO6y98Abd6q
"""
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import streamlit as st
import google.generativeai as genai
genai.configure(api_key='AIzaSyCuQrYVURvgQiqAV-pSX9C3cOT_K7Cj7CA')
st.title('Chat with Me')
model = genai.GenerativeModel('gemini-1.5-pro-latest')
chat = model.start_chat(history=[])
soru = st.text_input('Sen:')
if st.button('Sor'):
response = chat.send_message(soru)
st.write(response.text)
st.write(chat.history)
if st.button('Yeni Sohbet'):
chat = model.start_chat(history=chat.history)
|