Spaces:
Runtime error
Runtime error
| # -*- 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) | |