Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
import random
|
|
|
4 |
|
5 |
# -----------------------------
|
6 |
# ๐ง ํจ์ ์ ์ ์์ญ
|
@@ -47,6 +48,8 @@ def chat_with_solar(user_question, history, api_key):
|
|
47 |
# -----------------------------
|
48 |
# ๐ฅ๏ธ Streamlit UI ์์ญ
|
49 |
# -----------------------------
|
|
|
|
|
50 |
|
51 |
st.set_page_config(page_title="Decision Tree Chatbot Activity", layout="wide")
|
52 |
|
@@ -96,6 +99,7 @@ with col1:
|
|
96 |
with col2:
|
97 |
st.subheader("๐ ๋ฉ๋ชจ์ฅ: ๋์ ์ดํด ๊ธฐ๋ก")
|
98 |
notes = st.text_area("์ค๋ ์๊ฒ ๋ ์ ์ด๋ ๊ถ๊ธํ ์ ์ ์ ๋ฆฌํด๋ณด์ธ์:")
|
|
|
99 |
if st.button("๋๋ค ์ง๋ฌธ ์ ์๋ฐ๊ธฐ"):
|
100 |
sample_questions = [
|
101 |
"์์ฌ๊ฒฐ์ ๋๋ฌด๊ฐ ๋ญ์ผ?",
|
@@ -106,5 +110,13 @@ with col2:
|
|
106 |
]
|
107 |
st.info(f"์์ ์ง๋ฌธ: '{random.choice(sample_questions)}'")
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
st.markdown("---")
|
110 |
st.markdown("Made with โค๏ธ using Solar Pro API ยท Upstage ยท Streamlit")
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
import random
|
4 |
+
from datetime import datetime
|
5 |
|
6 |
# -----------------------------
|
7 |
# ๐ง ํจ์ ์ ์ ์์ญ
|
|
|
48 |
# -----------------------------
|
49 |
# ๐ฅ๏ธ Streamlit UI ์์ญ
|
50 |
# -----------------------------
|
51 |
+
today = datetime.now().strftime("%Y-%m-%d")
|
52 |
+
filename= f"{today}_studynote.txt"
|
53 |
|
54 |
st.set_page_config(page_title="Decision Tree Chatbot Activity", layout="wide")
|
55 |
|
|
|
99 |
with col2:
|
100 |
st.subheader("๐ ๋ฉ๋ชจ์ฅ: ๋์ ์ดํด ๊ธฐ๋ก")
|
101 |
notes = st.text_area("์ค๋ ์๊ฒ ๋ ์ ์ด๋ ๊ถ๊ธํ ์ ์ ์ ๋ฆฌํด๋ณด์ธ์:")
|
102 |
+
|
103 |
if st.button("๋๋ค ์ง๋ฌธ ์ ์๋ฐ๊ธฐ"):
|
104 |
sample_questions = [
|
105 |
"์์ฌ๊ฒฐ์ ๋๋ฌด๊ฐ ๋ญ์ผ?",
|
|
|
110 |
]
|
111 |
st.info(f"์์ ์ง๋ฌธ: '{random.choice(sample_questions)}'")
|
112 |
|
113 |
+
if notes:
|
114 |
+
st.download_button(
|
115 |
+
label="๐ฅ ๋ฉ๋ชจ ๋ค์ด๋ก๋(txt)",
|
116 |
+
data=notes,
|
117 |
+
file_name= filename
|
118 |
+
mime="text/plain"
|
119 |
+
)
|
120 |
+
|
121 |
st.markdown("---")
|
122 |
st.markdown("Made with โค๏ธ using Solar Pro API ยท Upstage ยท Streamlit")
|