Spaces:
Running
Running
Upload streamlit_app.py with huggingface_hub
Browse files- streamlit_app.py +21 -18
streamlit_app.py
CHANGED
|
@@ -1,21 +1,24 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
**Evet, veri analizi yapabilirim!** 📊
|
| 5 |
|
| 6 |
-
|
| 7 |
-
- 📈 Statistical analysis
|
| 8 |
-
- 📊 Data visualization
|
| 9 |
-
- 🔍 Pattern detection
|
| 10 |
-
- 📋 Report generation
|
| 11 |
-
- 🗂️ Data cleaning
|
| 12 |
-
- 🔄 Data transformation
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
- Matplotlib, Seaborn
|
| 17 |
-
- Scikit-learn
|
| 18 |
-
- SQL queries
|
| 19 |
-
- Excel/CSV processing
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import time
|
| 3 |
+
from datetime import datetime
|
|
|
|
| 4 |
|
| 5 |
+
st.set_page_config(page_title="AI Asistan", page_icon="🤖")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
if 'messages' not in st.session_state:
|
| 8 |
+
st.session_state.messages = []
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
st.title("🤖 AI Asistan")
|
| 11 |
+
|
| 12 |
+
if prompt := st.chat_input("Sorunuzu yazın..."):
|
| 13 |
+
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 14 |
+
|
| 15 |
+
with st.spinner("Düşünüyorum..."):
|
| 16 |
+
time.sleep(0.5)
|
| 17 |
+
response = f"**Cevap:** {prompt} hakkında bilgi verebilirim!"
|
| 18 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 19 |
+
|
| 20 |
+
st.rerun()
|
| 21 |
+
|
| 22 |
+
for msg in st.session_state.messages:
|
| 23 |
+
with st.chat_message(msg["role"):
|
| 24 |
+
st.markdown(msg["content"])
|