mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 02:04:43 +08:00
chore: fix memory prompt
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export function trimTopic(topic: string) {
|
||||
const s = topic.split("").slice(0, 20);
|
||||
const s = topic.split("");
|
||||
let lastChar = s.at(-1); // 获取 s 的最后一个字符
|
||||
let pattern = /[,。!?、]/; // 定义匹配中文标点符号的正则表达式
|
||||
while (lastChar && pattern.test(lastChar!)) {
|
||||
|
Reference in New Issue
Block a user