mirror of
https://github.com/LLM-Red-Team/kimi-free-api.git
synced 2025-04-18 09:29:12 +08:00
remove wrong links for citation
This commit is contained in:
parent
d1a76e6c8a
commit
411b5e4fa7
@ -1011,16 +1011,7 @@ function createTransStream(model: string, convId: string, stream: any, endCallba
|
||||
|
||||
const regex = /\[\^(\d+)\^\]/g;
|
||||
|
||||
chunk= chunk.replace(regex, (match, capturedNumber) => {
|
||||
const extractedNumber = parseInt(capturedNumber, 10);
|
||||
if (extractedNumber >= 0 && extractedNumber < searchResult.length) {
|
||||
const content = searchResult[extractedNumber-1].url;
|
||||
|
||||
return `[[${extractedNumber}]](${content})`;
|
||||
} else {
|
||||
return match; // 如果索引超出范围,保持原样
|
||||
}
|
||||
});
|
||||
chunk= chunk.replace(regex, '');
|
||||
|
||||
const data = `data: ${JSON.stringify({
|
||||
id: convId,
|
||||
|
Loading…
x
Reference in New Issue
Block a user