Update app.py
Browse files
app.py
CHANGED
|
@@ -34,14 +34,12 @@ def get_response(prompt, system_message, temperature, top_p, max_tokens):
|
|
| 34 |
return f"エラーが発生しました: {response.status_code} {response.text}"
|
| 35 |
|
| 36 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
| 37 |
-
# ユーザーからの入力を history に追加
|
| 38 |
-
history.append(("あなた", message))
|
| 39 |
-
|
| 40 |
# レスポンスを取得
|
| 41 |
response = get_response(message, system_message, temperature, top_p, max_tokens)
|
| 42 |
|
| 43 |
-
#
|
| 44 |
-
history.append(
|
|
|
|
| 45 |
|
| 46 |
return history, history
|
| 47 |
|
|
|
|
| 34 |
return f"エラーが発生しました: {response.status_code} {response.text}"
|
| 35 |
|
| 36 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
|
|
|
|
|
|
|
|
| 37 |
# レスポンスを取得
|
| 38 |
response = get_response(message, system_message, temperature, top_p, max_tokens)
|
| 39 |
|
| 40 |
+
# ヒストリに追加
|
| 41 |
+
history.append({"message": message, "label": "あなた"})
|
| 42 |
+
history.append({"message": response, "label": "チャットボット"})
|
| 43 |
|
| 44 |
return history, history
|
| 45 |
|