Ali Kadhim commited on
Commit
6b68216
1 Parent(s): 00ed004

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -20,8 +20,7 @@ settings = {
20
  "presence_penalty": 0, # higher value will result in the model being more likely to generate tokens that have not yet been included in the generated text
21
  }
22
 
23
-
24
- @cl.on_chat_start
25
  def start_chat():
26
  cl.user_session.set(
27
  "message_history",
@@ -29,7 +28,7 @@ def start_chat():
29
  )
30
 
31
 
32
- @cl.on_message
33
  async def main(message: str):
34
  message_history = cl.user_session.get("message_history")
35
  message_history.append({"role": "user", "content": message})
 
20
  "presence_penalty": 0, # higher value will result in the model being more likely to generate tokens that have not yet been included in the generated text
21
  }
22
 
23
+ @cl.on_chat_start # marks a function that will be executed at the start of a user session
 
24
  def start_chat():
25
  cl.user_session.set(
26
  "message_history",
 
28
  )
29
 
30
 
31
+ @cl.on_message # marks a function that should be run each time the chatbot receives a message from a user
32
  async def main(message: str):
33
  message_history = cl.user_session.get("message_history")
34
  message_history.append({"role": "user", "content": message})