hchsuk commited on
Commit
5285588
·
verified ·
1 Parent(s): 7b25707

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -41,14 +41,12 @@ def chatbot_response(user_message, chat_history):
41
  temperature=1,
42
  max_tokens=1024,
43
  top_p=1,
44
- stream=True,
45
  stop=None,
46
  )
47
 
48
- # 合併 Groq 的回應
49
- bot_response = ""
50
- for chunk in completion:
51
- bot_response += chunk.choices[0].delta.content or ""
52
 
53
  # 更新聊天記錄
54
  chat_history.append(("user", user_message))
 
41
  temperature=1,
42
  max_tokens=1024,
43
  top_p=1,
44
+ stream=False, # 不使用流式回應以簡化處理
45
  stop=None,
46
  )
47
 
48
+ # 獲取 Groq 的回應
49
+ bot_response = completion.choices[0].message['content']
 
 
50
 
51
  # 更新聊天記錄
52
  chat_history.append(("user", user_message))