Update app.py
Browse files
app.py
CHANGED
|
@@ -95,6 +95,11 @@ def respond(user_input):
|
|
| 95 |
except Exception as e:
|
| 96 |
st.session_state.history[-1]["ai"] = f"에러 발생: {str(e)}"
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
# 채팅 메시지 출력 영역
|
| 99 |
response_container = st.container()
|
| 100 |
with response_container:
|
|
@@ -104,13 +109,7 @@ with response_container:
|
|
| 104 |
if "ai" in chat:
|
| 105 |
message(chat["ai"], is_user=False)
|
| 106 |
|
| 107 |
-
# 응답 생성 및 출력
|
| 108 |
-
if user_input:
|
| 109 |
-
respond(user_input)
|
| 110 |
-
st.session_state.user_input = "" # 입력창 내용 초기화
|
| 111 |
-
|
| 112 |
-
|
| 113 |
# 초기화 버튼 클릭 시
|
| 114 |
if st.button("초기화"):
|
| 115 |
start_new_chat_session()
|
| 116 |
-
st.session_state.history = []
|
|
|
|
| 95 |
except Exception as e:
|
| 96 |
st.session_state.history[-1]["ai"] = f"에러 발생: {str(e)}"
|
| 97 |
|
| 98 |
+
# 응답 생성 및 출력
|
| 99 |
+
if user_input:
|
| 100 |
+
respond(user_input)
|
| 101 |
+
st.session_state.user_input = "" # 입력창 내용 초기화
|
| 102 |
+
|
| 103 |
# 채팅 메시지 출력 영역
|
| 104 |
response_container = st.container()
|
| 105 |
with response_container:
|
|
|
|
| 109 |
if "ai" in chat:
|
| 110 |
message(chat["ai"], is_user=False)
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
# 초기화 버튼 클릭 시
|
| 113 |
if st.button("초기화"):
|
| 114 |
start_new_chat_session()
|
| 115 |
+
st.session_state.history = []
|