Skip to content

Commit 808a8fd

Browse files
committed
feat: 调整自动取名的触发条件
1 parent 1250fb3 commit 808a8fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/devtools/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ function App() {
7777

7878
// 会话名称自动生成
7979
useEffect(() => {
80-
if (store.currentSession.name === 'Untitled' && store.currentSession.messages.length > 3) {
80+
if (
81+
store.currentSession.name === 'Untitled'
82+
&& store.currentSession.messages.findIndex(msg => msg.role === 'assistant') !== -1
83+
) {
8184
generateName(store.currentSession)
8285
}
8386
}, [store.currentSession.messages])

0 commit comments

Comments
 (0)