openfree commited on
Commit
b672d97
ยท
verified ยท
1 Parent(s): 2ce4a52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -34
app.py CHANGED
@@ -1120,8 +1120,7 @@ if st.session_state.generation_complete:
1120
  </style>
1121
  """, unsafe_allow_html=True)
1122
 
1123
- # ์ถ”๊ฐ€๋œ ํƒญ: ์ „์ฒด ์ผ์ •, ์ƒ์„ธ ์ •๋ณด, ๋‹ค์šด๋กœ๋“œ/๊ณต์œ , ์ง€๋„ ๋ฐ ์‹œ๊ฐํ™”, AI ์ฑ—๋ด‡ ์ธํ„ฐํŽ˜์ด์Šค
1124
-
1125
  itinerary_tab, details_tab, download_tab, map_tab, chatbot_tab = st.tabs([
1126
  "๐Ÿ—’๏ธ " + t("full_itinerary"),
1127
  "๐Ÿ’ผ " + t("details"),
@@ -1171,9 +1170,8 @@ if st.session_state.generation_complete:
1171
  with col2:
1172
  st.markdown("### " + t("save_for_mobile"))
1173
  st.markdown("*Coming soon: QR code for easy access on your phone*")
1174
-
1175
-
1176
-
1177
  with map_tab:
1178
  st.markdown("### ๋ชฉ์ ์ง€ ์ง€๋„")
1179
  # session_state์—์„œ ๋ชฉ์ ์ง€ ๊ฐ’์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. (์—†์„ ๊ฒฝ์šฐ ๊ธฐ๋ณธ๊ฐ’ "Paris")
@@ -1217,38 +1215,37 @@ if st.session_state.generation_complete:
1217
  deck_chart = pdk.Deck(layers=[layer], initial_view_state=view_state)
1218
  st.pydeck_chart(deck_chart)
1219
 
1220
-
1221
- with chatbot_tab:
1222
- st.markdown("### AI ์ฑ—๋ด‡ ์ธํ„ฐํŽ˜์ด์Šค")
1223
-
1224
- # ๋Œ€ํ™” ๊ธฐ๋ก์„ ์„ธ์…˜ ์ƒํƒœ์— ์ €์žฅ (๋ฉ”์‹œ์ง€, ๋ฐœ์‹ ์ž, ํƒ€์ž„์Šคํƒฌํ”„)
1225
- if "chat_history" not in st.session_state:
1226
- st.session_state.chat_history = []
1227
 
1228
- # ์‚ฌ์šฉ์ž ์ž…๋ ฅ์ฐฝ ๋ฐ ์ „์†ก ๋ฒ„ํŠผ
1229
- user_message = st.text_input("๋ฉ”์‹œ์ง€๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”:", key="chat_input")
1230
- if st.button("์ „์†ก", key="send_button"):
1231
- if user_message:
1232
- # ์ œ๋ฏธ๋‚˜์ด ๊ธฐ๋ฐ˜ ์ฑ—๋ด‡ ์‘๋‹ต: run_task()๋ฅผ ํ™œ์šฉํ•˜์—ฌ chatbot_task์— ์งˆ์˜
1233
- response = run_task(chatbot_task, user_message)
1234
- st.session_state.chat_history.append({
1235
- "speaker": "์‚ฌ์šฉ์ž",
1236
- "message": user_message,
1237
- "time": datetime.now()
1238
- })
1239
- st.session_state.chat_history.append({
1240
- "speaker": "AI",
1241
- "message": response,
1242
- "time": datetime.now()
1243
- })
1244
 
1245
- # ๋Œ€ํ™” ๊ธฐ๋ก ์ถœ๋ ฅ (ํƒ€์ž„์Šคํƒฌํ”„ ํฌํ•จ, ์Šคํฌ๋กค ๊ฐ€๋Šฅํ•œ ์˜์—ญ)
1246
- st.markdown("<div style='max-height:400px; overflow-y:auto; padding:10px; border:1px solid #eaeaea; border-radius:6px;'>", unsafe_allow_html=True)
1247
- for chat in st.session_state.chat_history:
1248
- time_str = chat["time"].strftime("%H:%M:%S")
1249
- st.markdown(f"**{chat['speaker']}** ({time_str}): {chat['message']}")
1250
- st.markdown("</div>", unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
1251
 
 
 
 
 
 
 
1252
 
1253
  st.markdown("""
1254
  <div style="margin-top: 50px; text-align: center; padding: 20px; color: #6c757d; font-size: 0.8rem;">
 
1120
  </style>
1121
  """, unsafe_allow_html=True)
1122
 
1123
+ # ํƒญ ์ƒ์„ฑ (์ฑ—๋ด‡ ํƒญ ํฌํ•จ)
 
1124
  itinerary_tab, details_tab, download_tab, map_tab, chatbot_tab = st.tabs([
1125
  "๐Ÿ—’๏ธ " + t("full_itinerary"),
1126
  "๐Ÿ’ผ " + t("details"),
 
1170
  with col2:
1171
  st.markdown("### " + t("save_for_mobile"))
1172
  st.markdown("*Coming soon: QR code for easy access on your phone*")
1173
+
1174
+ # ์ง€๋„ ๋ฐ ์‹œ๊ฐํ™” ํƒญ
 
1175
  with map_tab:
1176
  st.markdown("### ๋ชฉ์ ์ง€ ์ง€๋„")
1177
  # session_state์—์„œ ๋ชฉ์ ์ง€ ๊ฐ’์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. (์—†์„ ๊ฒฝ์šฐ ๊ธฐ๋ณธ๊ฐ’ "Paris")
 
1215
  deck_chart = pdk.Deck(layers=[layer], initial_view_state=view_state)
1216
  st.pydeck_chart(deck_chart)
1217
 
1218
+ # ์ฑ—๋ด‡ ์ธํ„ฐํŽ˜์ด์Šค ํƒญ (Clear ๋ฒ„ํŠผ ์ œ๊ฑฐ๋จ)
1219
+ with chatbot_tab:
1220
+ st.markdown("### AI ์ฑ—๋ด‡ ์ธํ„ฐํŽ˜์ด์Šค")
 
 
 
 
1221
 
1222
+ # ๋Œ€ํ™” ๊ธฐ๋ก์„ ์„ธ์…˜ ์ƒํƒœ์— ์ €์žฅ (๋ฉ”์‹œ์ง€, ๋ฐœ์‹ ์ž, ํƒ€์ž„์Šคํƒฌํ”„)
1223
+ if "chat_history" not in st.session_state:
1224
+ st.session_state.chat_history = []
 
 
 
 
 
 
 
 
 
 
 
 
 
1225
 
1226
+ # ์‚ฌ์šฉ์ž ์ž…๋ ฅ์ฐฝ ๋ฐ ์ „์†ก ๋ฒ„ํŠผ
1227
+ user_message = st.text_input("๋ฉ”์‹œ์ง€๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”:", key="chat_input")
1228
+ if st.button("์ „์†ก", key="send_button"):
1229
+ if user_message:
1230
+ # ์ œ๋ฏธ๋‚˜์ด ๊ธฐ๋ฐ˜ ์ฑ—๋ด‡ ์‘๋‹ต: run_task()๋ฅผ ํ™œ์šฉํ•˜์—ฌ chatbot_task์— ์งˆ์˜
1231
+ response = run_task(chatbot_task, user_message)
1232
+ st.session_state.chat_history.append({
1233
+ "speaker": "์‚ฌ์šฉ์ž",
1234
+ "message": user_message,
1235
+ "time": datetime.now()
1236
+ })
1237
+ st.session_state.chat_history.append({
1238
+ "speaker": "AI",
1239
+ "message": response,
1240
+ "time": datetime.now()
1241
+ })
1242
 
1243
+ # ๋Œ€ํ™” ๊ธฐ๋ก ์ถœ๋ ฅ (ํƒ€์ž„์Šคํƒฌํ”„ ํฌํ•จ, ์Šคํฌ๋กค ๊ฐ€๋Šฅํ•œ ์˜์—ญ)
1244
+ st.markdown("<div style='max-height:400px; overflow-y:auto; padding:10px; border:1px solid #eaeaea; border-radius:6px;'>", unsafe_allow_html=True)
1245
+ for chat in st.session_state.chat_history:
1246
+ time_str = chat["time"].strftime("%H:%M:%S")
1247
+ st.markdown(f"**{chat['speaker']}** ({time_str}): {chat['message']}")
1248
+ st.markdown("</div>", unsafe_allow_html=True)
1249
 
1250
  st.markdown("""
1251
  <div style="margin-top: 50px; text-align: center; padding: 20px; color: #6c757d; font-size: 0.8rem;">