benjamin5607 commited on
Commit
4c2b05c
ยท
verified ยท
1 Parent(s): e84ddda

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +73 -158
main.py CHANGED
@@ -1,240 +1,155 @@
1
  import streamlit as st
2
  import time
3
- from utils import tarot, prompts, llm, calculations
4
 
5
  # --- [1. ์•ฑ ์„ค์ •] ---
6
- st.set_page_config(page_title="AI ๋งŒ์‹ ์ „", page_icon="๐Ÿ”ฎ", layout="wide")
7
 
8
- # --- [2. ํ…Œ๋งˆ ์Šคํƒ€์ผ๋ง ์—”์ง„] ---
9
  def apply_theme(mode):
10
- # ๊ตฌ๊ธ€ ํฐํŠธ ๋กœ๋“œ
 
11
  st.markdown("""
12
  <style>
13
- @import url('https://fonts.googleapis.com/css2?family=Nanum+Myeongjo:wght@700&family=Nanum+Pen+Script&family=Noto+Sans+KR:wght@400;700&display=swap');
14
  </style>
15
  """, unsafe_allow_html=True)
16
-
17
- themes = {
18
- "tarot": """
19
- /* ๐Ÿ”ฎ ํƒ€๋กœ ํ…Œ๋งˆ */
20
- .stApp {
21
- background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 100%);
22
- color: #e0d4fc;
23
- }
24
- h1, h2, h3 {
25
- font-family: 'Nanum Myeongjo', serif;
26
- color: #d4af37 !important;
27
- text-shadow: 0 0 10px #d4af37;
28
- }
29
- .stButton>button {
30
- background: linear-gradient(45deg, #4b0082, #8a2be2);
31
- color: white;
32
- border: 1px solid #d4af37;
33
- }
34
- .stTextInput>div>div>input, .stTextArea>div>div>textarea {
35
- background-color: #2d1b4e;
36
- color: white;
37
- border: 1px solid #d4af37;
38
- }
39
- """,
40
- "fengshui": """
41
- /* ๐Ÿก ํ’์ˆ˜ ํ…Œ๋งˆ */
42
- .stApp {
43
- background-color: #f5f5f0;
44
- background-image: url("https://www.transparenttextures.com/patterns/rice-paper.png");
45
- color: #3e2723;
46
- }
47
- h1, h2, h3 {
48
- font-family: 'Nanum Myeongjo', serif;
49
- color: #2e7d32 !important;
50
- }
51
- .stButton>button {
52
- background-color: #5d4037;
53
- color: #fff8e1;
54
- border-radius: 0px;
55
- }
56
- .stChatMessage {
57
- background-color: #ffffff;
58
- border: 1px solid #d7ccc8;
59
- }
60
- """,
61
- "shaman": """
62
- /* ๐Ÿ‘น ์ ์ง‘ ํ…Œ๋งˆ */
63
- .stApp {
64
- background-color: #1a0505;
65
- color: #ffcccc;
66
- }
67
- h1, h2, h3 {
68
- font-family: 'Nanum Pen Script', cursive;
69
- font-size: 3.5rem !important;
70
- color: #ff0000 !important;
71
- text-shadow: 2px 2px 0px #ffff00;
72
- }
73
- .stButton>button {
74
- background-color: #b71c1c;
75
- color: #ffff00;
76
- border: 2px solid #ffff00;
77
- font-family: 'Nanum Pen Script', cursive;
78
- font-size: 1.5rem;
79
- }
80
- .stTextInput>div>div>input {
81
- background-color: #330000;
82
- color: yellow;
83
- border: 2px solid red;
84
- }
85
- """
86
- }
87
 
88
- style = themes.get(mode, themes["tarot"])
89
- st.markdown(f"<style>{style}</style>", unsafe_allow_html=True)
90
 
91
  # --- [3. ์ƒํƒœ ์ดˆ๊ธฐํ™”] ---
92
- if "messages" not in st.session_state:
93
- st.session_state.messages = []
94
- if "tarot_stage" not in st.session_state:
95
- st.session_state.tarot_stage = "input"
96
- if "picked_cards" not in st.session_state:
97
- st.session_state.picked_cards = []
98
-
99
- # --- [4. ์‚ฌ์ด๋“œ๋ฐ” UI] ---
100
- st.sidebar.title("โ›ฉ๏ธ ๋งŒ์‹ ์ „ ์ž…์žฅ")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  selected_mode = st.sidebar.radio(
102
- "๋ˆ„๊ตฌ๋ฅผ ์ฐพ์œผ์…จ์Šต๋‹ˆ๊นŒ?",
103
  ("tarot", "fengshui", "shaman"),
104
- format_func=lambda x: prompts.get_persona(x)["name"]
105
  )
106
 
107
- # ํ…Œ๋งˆ ์ ์šฉ ๋ฐ ํŽ˜๋ฅด์†Œ๋‚˜ ๋กœ๋“œ
108
  apply_theme(selected_mode)
109
  current_persona = prompts.get_persona(selected_mode)
110
 
111
  st.sidebar.markdown("---")
112
- st.sidebar.success(f"ํ˜„์žฌ ์ ‘์†: **{current_persona['name']}**")
113
- st.sidebar.info(current_persona["description"])
114
 
115
  # --- [5. ๋ฉ”์ธ UI ๋กœ์ง] ---
116
- st.title(f"{current_persona['icon']} {current_persona['name']}")
117
  st.markdown("---")
118
 
119
  # ==========================================
120
- # ๐Ÿƒ ๋ชจ๋“œ A: ํƒ€๋กœ (Tarot)
121
  # ==========================================
122
  if selected_mode == "tarot":
123
- # 1๋‹จ๊ณ„: ์ž…๋ ฅ
124
  if st.session_state.tarot_stage == "input":
125
  with st.form("tarot_form"):
126
- st.subheader("๋ฌด์—‡์ด ๋‹น์‹ ์„ ๋ฒˆ๋‡Œํ•˜๊ฒŒ ํ•ฉ๋‹ˆ๊นŒ?")
127
- topic = st.selectbox("๊ณ ๋ฏผ ์ฃผ์ œ", ["๐Ÿ’˜ ์—ฐ์• /์‚ฌ๋ž‘", "๐Ÿ’ฐ ๊ธˆ์ „/์‚ฌ์—…", "๐ŸŽ“ ํ•™์—…/์ง„๋กœ", "๐Ÿซ‚ ์ธ๊ฐ„๊ด€๊ณ„"])
128
- query = st.text_area("๊ตฌ์ฒด์ ์ธ ๊ณ ๋ฏผ์„ ์ ์–ด์ฃผ์„ธ์š”", placeholder="์˜ˆ: ์ธํƒ€๋Š” ์‚ฌ๋žŒ์ด ์žˆ๋Š”๋ฐ ์—ฐ๋ฝ์ด ์•ˆ ์™€์š”.")
129
- submitted = st.form_submit_button("์šด๋ช…์˜ ์นด๋“œ ๋ฝ‘์œผ๋Ÿฌ ๊ฐ€๊ธฐ")
130
 
131
  if submitted and query:
132
- st.session_state.user_query = f"[{topic}] {query}"
133
  st.session_state.tarot_stage = "picking"
134
  st.rerun()
135
 
136
- # 2๋‹จ๊ณ„: ๋ฝ‘๊ธฐ
137
  elif st.session_state.tarot_stage == "picking":
138
- st.info(f"๋‹น์‹ ์˜ ๊ณ ๋ฏผ: **{st.session_state.user_query}**")
139
- st.write("โ–ผ ์•„๋ž˜ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ์šด๋ช…์„ ํ™•์ธํ•˜์„ธ์š” โ–ผ")
140
- if st.button("๐ŸŽด ์‹ ์ค‘ํ•˜๊ฒŒ ์นด๋“œ 3์žฅ ๋ฝ‘๊ธฐ", type="primary", use_container_width=True):
141
- with st.spinner("์šด๋ช…์„ ์ ์ง€ํ•˜๋Š” ์ค‘..."):
142
  time.sleep(1.5)
143
  st.session_state.picked_cards = tarot.draw_tarot_cards(3)
144
  st.session_state.tarot_stage = "result"
145
  st.rerun()
146
 
147
- # 3๋‹จ๊ณ„: ๊ฒฐ๊ณผ
148
  elif st.session_state.tarot_stage == "result":
149
  cols = st.columns(3)
150
- positions = ["๊ณผ๊ฑฐ", "ํ˜„์žฌ", "๋ฏธ๋ž˜"]
151
  for idx, card in enumerate(st.session_state.picked_cards):
152
  with cols[idx]:
153
- st.caption(positions[idx])
154
  st.image(tarot.get_card_image(card["name"]), caption=card["name"])
155
 
156
  if "ai_response" not in st.session_state:
157
- with st.spinner("ํ•ด์„ ์ค‘..."):
 
158
  st.session_state.ai_response = llm.get_ai_response(
159
- st.session_state.user_query, current_persona, st.session_state.picked_cards
 
 
 
160
  )
 
161
  st.markdown(st.session_state.ai_response)
162
 
163
- if st.button("๐Ÿ”„ ๋‹ค์‹œ ํ•˜๊ธฐ"):
164
  st.session_state.tarot_stage = "input"
165
  del st.session_state["ai_response"]
166
  st.rerun()
167
 
168
  # ==========================================
169
- # ๐Ÿก ๋ชจ๋“œ B: ํ’์ˆ˜์ง€๋ฆฌ (Feng Shui)
170
  # ==========================================
171
  elif selected_mode == "fengshui":
172
  with st.container():
173
- st.info("์ •ํ†ต ๋ณธ๋ช…๊ถ๋ฒ•(Life Gua)์— ์˜ํ•ด ๊ท€ํ•˜์˜ ๊ธธํ‰ ๋ฐฉ์œ„๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.")
174
-
175
  c1, c2 = st.columns(2)
176
  with c1:
177
- birth_year = st.number_input("๊ฐ€์žฅ(์ง‘์ฃผ์ธ) ์ถœ์ƒ์—ฐ๋„", 1950, 2025, 1990)
178
- gender = st.radio("์„ฑ๋ณ„", ["๋‚จ์„ฑ", "์—ฌ์„ฑ"])
179
  with c2:
180
- direction = st.selectbox("ํ˜„์žฌ ํ˜„๊ด€ ๋ฐฉํ–ฅ", ["๋ถ", "๋ถ๋™", "๋™", "๋‚จ๋™", "๋‚จ", "๋‚จ์„œ", "์„œ", "๋ถ์„œ"])
181
- room_type = st.selectbox("์ง„๋‹จํ•  ๊ณต๊ฐ„", ["์นจ์‹ค", "๊ฑฐ์‹ค", "์„œ์žฌ"])
182
-
183
- if prompt := st.chat_input("๊ตฌ์กฐ์— ๋Œ€ํ•ด ๋ฌผ์–ด๋ณด์„ธ์š” (์˜ˆ: ํ˜„๊ด€์— ๊ฑฐ์šธ์ด ์žˆ์–ด)"):
184
- # 1. ๊ณ„์‚ฐ ์‹คํ–‰
185
  fengshui_data = calculations.get_fengshui_info(birth_year, gender)
186
 
187
- # 2. AI์—๊ฒŒ ๋„˜๊ธธ ์ •๋ณด ๊ตฌ์„ฑ
188
- sys_msg = f"""
189
- [๋ฐ์ดํ„ฐ ๋ถ„์„]
190
- - ๋ณธ๋ช…๊ถ: {fengshui_data['gua_number']} ({fengshui_data['group']})
191
- - ๊ธธ(Good) ๋ฐฉ์œ„: {fengshui_data['good_direction']}
192
- - ํ‰(Bad) ๋ฐฉ์œ„: {fengshui_data['bad_direction']}
193
- - ํ˜„์žฌ ํ˜„๊ด€: {direction}์ชฝ
194
- """
195
- full_query = f"{sys_msg}\n์‚ฌ์šฉ์ž ์งˆ๋ฌธ: {prompt}\n\n์œ„ ๋ฐ์ดํ„ฐ๋ฅผ ๊ทผ๊ฑฐ๋กœ ๋…ผ๋ฆฌ์ ์œผ๋กœ ์กฐ์–ธํ•ด."
196
 
197
  with st.chat_message("user"): st.write(prompt)
198
  with st.chat_message("assistant"):
199
- with st.spinner("๋ฐฉ์œ„๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ์ค‘..."):
200
- response = llm.get_ai_response(full_query, current_persona)
201
  st.write(response)
202
-
203
- # ๋ถ„์„ํ‘œ ์ถœ๋ ฅ
204
- with st.expander("๐Ÿ“Š ์ •๋ฐ€ ๋ถ„์„ํ‘œ ๋ณด๊ธฐ", expanded=True):
205
- st.success(f"โœ… ์ถ”์ฒœ ๋ฐฉํ–ฅ: {fengshui_data['good_direction']}")
206
- st.error(f"๐Ÿšซ ํ”ผํ•  ๋ฐฉํ–ฅ: {fengshui_data['bad_direction']}")
207
 
208
  # ==========================================
209
- # ๐Ÿ‘น ๋ชจ๋“œ C: ์‹ ์  (Shaman)
210
  # ==========================================
211
  elif selected_mode == "shaman":
212
  with st.container():
213
- st.warning("๊ฑฐ์ง“์œผ๋กœ ์ ์œผ๋ฉด ์ ๊ด˜ ์•ˆ ๋‚˜์˜จ๋‹ค! ๋˜‘๋ฐ”๋กœ ์ ์–ด๋ผ.")
214
-
215
  c1, c2 = st.columns(2)
216
  with c1:
217
- birth_year = st.number_input("ํƒœ์–ด๋‚œ ์—ฐ๋„", 1960, 2025, 1995)
218
  with c2:
219
- prompt_input = st.text_input("๋ญ๊ฐ€ ๊ถ๊ธˆํ•˜๋ƒ?", placeholder="์˜ฌํ•ด ๊ฒฐํ˜ผ์šด ์–ด๋•Œ?")
220
 
221
- if st.button("์ ๊ด˜ ํ™•์ธ") and prompt_input:
222
- # 1. ์‚ฌ์ฃผ ๊ณ„์‚ฐ ์‹คํ–‰
223
  saju_data = calculations.get_ganji(birth_year)
224
 
225
- # 2. AI ํ”„๋กฌํ”„ํŠธ ๊ตฌ์„ฑ
226
- sys_msg = f"""
227
- [๋‚ด๋‹ด์ž ์‚ฌ์ฃผ]
228
- - {saju_data['year_ganji']} ({saju_data['animal']}๋ )
229
- - ํƒ€๊ณ ๋‚œ ๊ธฐ์šด: {saju_data['element']} ({saju_data['color']}์ƒ‰)
230
- """
231
- full_query = f"{sys_msg}\n๊ณ ๋ฏผ: {prompt_input}\n\n๋‚ด๋‹ด์ž๋Š” '{saju_data['element']}' ๊ธฐ์šด์ด๋‹ค. ์ด์— ๋น—๋Œ€์–ด ํ˜ธํ†ต์น˜๋ฉฐ ์กฐ์–ธํ•ด๋ผ."
232
 
233
  st.divider()
234
- st.write(f"๐Ÿ—ฃ๏ธ **๋‚˜:** {prompt_input}")
235
-
236
- with st.spinner("๋ฐฉ์šธ ํ”๋“œ๋Š” ์ค‘... ๐Ÿ””"):
237
- response = llm.get_ai_response(full_query, current_persona)
238
- st.markdown(f"**๐Ÿ‘น ๋ฌด๋‹น:** {response}")
239
-
240
- st.info(f"๐Ÿ“œ ๋ช…์‹: **{saju_data['year_ganji']} ({saju_data['animal']})** - ๋„ˆ๋Š” **{saju_data['element']}**์˜ ๊ธฐ์šด์ด์•ผ!")
 
1
  import streamlit as st
2
  import time
3
+ from utils import tarot, prompts, llm, calculations, lang # <--- lang ์ถ”๊ฐ€
4
 
5
  # --- [1. ์•ฑ ์„ค์ •] ---
6
+ st.set_page_config(page_title="Global AI Pantheon", page_icon="๐Ÿ”ฎ", layout="wide")
7
 
8
+ # --- [2. ํ…Œ๋งˆ ์Šคํƒ€์ผ๋ง] (๊ธฐ์กด ์ฝ”๋“œ ์œ ์ง€ - ์ƒ๋žต) ---
9
  def apply_theme(mode):
10
+ # (์ด์ „ ๋‹ต๋ณ€์˜ CSS ์ฝ”๋“œ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜์„ธ์š”)
11
+ # ํฐํŠธ ๋กœ๋“œ ๋ถ€๋ถ„๋งŒ ์กฐ๊ธˆ ๋ณด๊ฐ•ํ•ด์„œ ๋‹ค๊ตญ์–ด ์ง€์›ํ•˜๊ฒŒ
12
  st.markdown("""
13
  <style>
14
+ @import url('https://fonts.googleapis.com/css2?family=Nanum+Myeongjo:wght@700&family=Noto+Serif+SC:wght@600&family=Noto+Serif+JP:wght@600&family=Nanum+Pen+Script&display=swap');
15
  </style>
16
  """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
+ # ... (๋‚˜๋จธ์ง€ CSS ํ…Œ๋งˆ ์ฝ”๋“œ๋Š” ๋™์ผํ•˜๋ฏ€๋กœ ์ƒ๋žต) ...
19
+ pass
20
 
21
  # --- [3. ์ƒํƒœ ์ดˆ๊ธฐํ™”] ---
22
+ if "messages" not in st.session_state: st.session_state.messages = []
23
+ if "tarot_stage" not in st.session_state: st.session_state.tarot_stage = "input"
24
+ if "picked_cards" not in st.session_state: st.session_state.picked_cards = []
25
+
26
+ # ==========================================
27
+ # ๐ŸŒ ์–ธ์–ด ์„ ํƒ (์‚ฌ์ด๋“œ๋ฐ” ์ตœ์ƒ๋‹จ)
28
+ # ==========================================
29
+ st.sidebar.markdown("### ๐ŸŒ Language")
30
+ current_lang = st.sidebar.selectbox(
31
+ "Select Language",
32
+ ["ํ•œ๊ตญ์–ด", "English", "ไธญๆ–‡", "ๆ—ฅๆœฌ่ชž"],
33
+ label_visibility="collapsed"
34
+ )
35
+ # ์„ ํƒ๋œ ์–ธ์–ด ํŒฉ ๊ฐ€์ ธ์˜ค๊ธฐ
36
+ TXT = lang.STRINGS[current_lang]
37
+
38
+ # --- [4. ๋ชจ๋“œ ์„ ํƒ UI] ---
39
+ st.sidebar.title(TXT["sidebar_title"])
40
+
41
+ # ํŽ˜๋ฅด์†Œ๋‚˜ ์ด๋ฆ„๋„ ์–ธ์–ด๋ณ„๋กœ ๋ณด์—ฌ์ฃผ๊ธฐ
42
+ def get_persona_name(key):
43
+ return TXT["personas"][key]
44
+
45
  selected_mode = st.sidebar.radio(
46
+ TXT["select_persona"],
47
  ("tarot", "fengshui", "shaman"),
48
+ format_func=get_persona_name
49
  )
50
 
 
51
  apply_theme(selected_mode)
52
  current_persona = prompts.get_persona(selected_mode)
53
 
54
  st.sidebar.markdown("---")
55
+ # ์„ค๋ช…๋„ ๋ฒˆ์—ญ๋œ ๊ฑธ๋กœ ํ‘œ์‹œ
56
+ st.sidebar.info(TXT["desc"][selected_mode])
57
 
58
  # --- [5. ๋ฉ”์ธ UI ๋กœ์ง] ---
59
+ st.title(f"{current_persona['icon']} {get_persona_name(selected_mode)}")
60
  st.markdown("---")
61
 
62
  # ==========================================
63
+ # ๐Ÿƒ ๋ชจ๋“œ A: ํƒ€๋กœ
64
  # ==========================================
65
  if selected_mode == "tarot":
 
66
  if st.session_state.tarot_stage == "input":
67
  with st.form("tarot_form"):
68
+ query = st.text_area(TXT["input_label"])
69
+ submitted = st.form_submit_button(TXT["btn_submit"])
 
 
70
 
71
  if submitted and query:
72
+ st.session_state.user_query = query
73
  st.session_state.tarot_stage = "picking"
74
  st.rerun()
75
 
 
76
  elif st.session_state.tarot_stage == "picking":
77
+ st.info(f"Your Worry: **{st.session_state.user_query}**")
78
+ if st.button("๐ŸŽด Draw 3 Cards", type="primary", use_container_width=True):
79
+ with st.spinner(TXT["loading"]):
 
80
  time.sleep(1.5)
81
  st.session_state.picked_cards = tarot.draw_tarot_cards(3)
82
  st.session_state.tarot_stage = "result"
83
  st.rerun()
84
 
 
85
  elif st.session_state.tarot_stage == "result":
86
  cols = st.columns(3)
 
87
  for idx, card in enumerate(st.session_state.picked_cards):
88
  with cols[idx]:
 
89
  st.image(tarot.get_card_image(card["name"]), caption=card["name"])
90
 
91
  if "ai_response" not in st.session_state:
92
+ with st.spinner(TXT["analyzing"]):
93
+ # ์–ธ์–ด ์ •๋ณด(current_lang)๋ฅผ ํ•จ๊ป˜ ๋„˜๊น€
94
  st.session_state.ai_response = llm.get_ai_response(
95
+ st.session_state.user_query,
96
+ current_persona,
97
+ st.session_state.picked_cards,
98
+ user_lang=current_lang
99
  )
100
+ st.subheader(TXT["result_title"])
101
  st.markdown(st.session_state.ai_response)
102
 
103
+ if st.button("๐Ÿ”„ Retry"):
104
  st.session_state.tarot_stage = "input"
105
  del st.session_state["ai_response"]
106
  st.rerun()
107
 
108
  # ==========================================
109
+ # ๐Ÿก ๋ชจ๋“œ B: ํ’์ˆ˜์ง€๋ฆฌ
110
  # ==========================================
111
  elif selected_mode == "fengshui":
112
  with st.container():
 
 
113
  c1, c2 = st.columns(2)
114
  with c1:
115
+ birth_year = st.number_input("Year of Birth", 1950, 2025, 1990)
116
+ gender = st.radio("Gender", ["๋‚จ์„ฑ", "์—ฌ์„ฑ"]) # ๊ณ„์‚ฐ์‹ ๋•Œ๋ฌธ์— ๊ฐ’์€ ํ•œ๊ธ€๋กœ ์œ ์ง€ํ•˜๋˜ ํ‘œ์‹œ๋Š” ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Œ
117
  with c2:
118
+ direction = st.selectbox("Door Direction", ["๋ถ", "๋ถ๋™", "๋™", "๋‚จ๋™", "๋‚จ", "๋‚จ์„œ", "์„œ", "๋ถ์„œ"])
119
+
120
+ if prompt := st.chat_input(TXT["input_label"]):
 
 
121
  fengshui_data = calculations.get_fengshui_info(birth_year, gender)
122
 
123
+ # ์‹œ์Šคํ…œ ํ”„๋กฌํ”„ํŠธ์šฉ ๋ฐ์ดํ„ฐ ๊ตฌ์„ฑ
124
+ sys_msg = f"[Data]: {fengshui_data}, Current Door: {direction}"
125
+ full_query = f"{sys_msg}\nUser Question: {prompt}"
 
 
 
 
 
 
126
 
127
  with st.chat_message("user"): st.write(prompt)
128
  with st.chat_message("assistant"):
129
+ with st.spinner(TXT["analyzing"]):
130
+ response = llm.get_ai_response(full_query, current_persona, user_lang=current_lang)
131
  st.write(response)
 
 
 
 
 
132
 
133
  # ==========================================
134
+ # ๐Ÿ‘น ๋ชจ๋“œ C: ์‹ ์ 
135
  # ==========================================
136
  elif selected_mode == "shaman":
137
  with st.container():
 
 
138
  c1, c2 = st.columns(2)
139
  with c1:
140
+ birth_year = st.number_input("Birth Year", 1960, 2025, 1995)
141
  with c2:
142
+ prompt_input = st.text_input(TXT["input_label"])
143
 
144
+ if st.button(TXT["btn_submit"]) and prompt_input:
 
145
  saju_data = calculations.get_ganji(birth_year)
146
 
147
+ sys_msg = f"[Saju Data]: Year {saju_data['year_ganji']}, Element {saju_data['element']}"
148
+ full_query = f"{sys_msg}\nUser Worry: {prompt_input}"
 
 
 
 
 
149
 
150
  st.divider()
151
+ with st.chat_message("user"): st.write(prompt_input)
152
+ with st.chat_message("assistant"):
153
+ with st.spinner(TXT["loading"]):
154
+ response = llm.get_ai_response(full_query, current_persona, user_lang=current_lang)
155
+ st.markdown(response)