mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-10-27 17:03:49 +08:00
新增 task_auto_title_enabled / chat_auto_title_enabled(默认关)、 共享 GenerateAutoTitle、spawn_task 同步写 name、对话首条先截断再异步 AI, 设置页「自动标题」双 Switch。closes #55
15 lines
405 B
Go
15 lines
405 B
Go
package server
|
|
|
|
import "testing"
|
|
|
|
func TestAutoTitleMayReplace(t *testing.T) {
|
|
for _, current := range []string{"", "新对话", "首条消息预览"} {
|
|
if !autoTitleMayReplace(current, "首条消息预览") {
|
|
t.Fatalf("expected %q to be replaceable", current)
|
|
}
|
|
}
|
|
if autoTitleMayReplace("用户手动改的标题", "首条消息预览") {
|
|
t.Fatal("manual title must not be overwritten")
|
|
}
|
|
}
|