mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-06-27 07:49:55 +00:00
Fixed history_messages in ui.py
This commit is contained in:
parent
89477ea9d3
commit
f12c57b472
@ -155,7 +155,7 @@ class PrivateGptUi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# max 20 messages to try to avoid context overflow
|
# max 20 messages to try to avoid context overflow
|
||||||
return history_messages[:20]
|
return history_messages[-20:]
|
||||||
|
|
||||||
new_message = ChatMessage(content=message, role=MessageRole.USER)
|
new_message = ChatMessage(content=message, role=MessageRole.USER)
|
||||||
all_messages = [*build_history(), new_message]
|
all_messages = [*build_history(), new_message]
|
||||||
|
Loading…
Reference in New Issue
Block a user