mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-08-28 12:01:29 +00:00
Merge f12c57b472
into b7ee43788d
This commit is contained in:
commit
079f1f0119
@ -159,7 +159,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