Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ if user_input:
|
|
| 44 |
message_placeholder = st.empty() # 応答の一時表示用の空要素
|
| 45 |
for chunk in response:
|
| 46 |
if "choices" in chunk:
|
| 47 |
-
chunk_text = chunk['choices'][0]['delta']
|
| 48 |
response_text += chunk_text
|
| 49 |
message_placeholder.text(response_text) # 部分的な応答を表示
|
| 50 |
|
|
@@ -57,4 +57,4 @@ if user_input:
|
|
| 57 |
# 会話履歴をリセットするボタン
|
| 58 |
if st.button("会話をリセット"):
|
| 59 |
st.session_state['conversation_history'] = []
|
| 60 |
-
st.
|
|
|
|
| 44 |
message_placeholder = st.empty() # 応答の一時表示用の空要素
|
| 45 |
for chunk in response:
|
| 46 |
if "choices" in chunk:
|
| 47 |
+
chunk_text = chunk['choices'][0]['delta'].get('content', '')
|
| 48 |
response_text += chunk_text
|
| 49 |
message_placeholder.text(response_text) # 部分的な応答を表示
|
| 50 |
|
|
|
|
| 57 |
# 会話履歴をリセットするボタン
|
| 58 |
if st.button("会話をリセット"):
|
| 59 |
st.session_state['conversation_history'] = []
|
| 60 |
+
st.query_params = {}
|