Skip to content

Commit 57d6eac

Browse files
committed
Fix backwards compatibility for chat rollback
1 parent d28f585 commit 57d6eac

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/protocol.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,15 @@ type ChatContent =
559559
/**
560560
* Simple text message from the LLM
561561
*/
562-
interface ChatTextContent extends BaseChatContent {
562+
interface ChatTextContent {
563563
type: 'text';
564564

565565
/**
566566
* The unique identifier of this content.
567567
* Mostly used to rollback messages.
568+
* Current, only user messages contain this.
568569
*/
569-
contentId: string;
570+
contentId?: string;
570571

571572
/**
572573
* The text content

src/eca/features/chat.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@
14431443
(let [include (if (seq include)
14441444
(set include)
14451445
;; backwards compatibility
1446-
["messages" "tools"])
1446+
#{"messages" "tools"})
14471447
all-messages (get-in @db* [:chats chat-id :messages])
14481448
tool-calls (get-in @db* [:chats chat-id :tool-calls])
14491449
new-messages (when (contains? include "messages")

0 commit comments

Comments
 (0)