modified: app.py
This commit is contained in:
parent
6e3f1f7a60
commit
03b11ff4c4
1 changed files with 2 additions and 1 deletions
3
app.py
3
app.py
|
|
@ -320,7 +320,8 @@ def chat_gpt(username, room_name, message, model_name="gpt-3.5-turbo"):
|
|||
.limit(limit)
|
||||
.all()
|
||||
)
|
||||
if len(last_messages) % 6 == 0 or room.title is None:
|
||||
message_count = len(last_messages)
|
||||
if message_count % 6 == 0 or (room.title is None and message_count > 2):
|
||||
room.title = gpt_generate_room_title(last_messages, model_name)
|
||||
db.session.add(room)
|
||||
db.session.commit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue