Sakalti commited on
Commit
cb7950c
·
verified ·
1 Parent(s): c4df4e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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
- # レスポンスを history に追加
44
- history.append(("チャットボット", response))
 
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