Skip to content

Commit 833dd97

Browse files
committed
Avoid generating huge chat titles.
1 parent 858e14d commit 833dd97

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Support "accept and remember" tool call per session and name.
6+
- Avoid generating huge chat titles.
67

78
## 0.62.1
89

src/eca/features/chat.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,13 @@
467467
:config config
468468
:tools []
469469
:provider-auth provider-auth})]
470-
(swap! db* assoc-in [:chats chat-id :title] title)
471-
(send-content! chat-ctx :system (assoc-some
472-
{:type :metadata}
473-
:title title)))))
470+
(let [title (-> title
471+
(subs 0 32)
472+
string/capitalize)]
473+
(swap! db* assoc-in [:chats chat-id :title] title)
474+
(send-content! chat-ctx :system (assoc-some
475+
{:type :metadata}
476+
:title title))))))
474477
(send-content! chat-ctx :system {:type :progress
475478
:state :running
476479
:text "Waiting model"})

0 commit comments

Comments
 (0)