mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 04:03:42 +08:00
fix: 修复 markdown 换行符不解析的 Bug,修复新发布的模型 token 统计失败错误
This commit is contained in:
@@ -127,7 +127,7 @@ const onLoad = () => {
|
||||
finished.value = true;
|
||||
const data = res.data
|
||||
if (data && data.length > 0) {
|
||||
const md = require('markdown-it')();
|
||||
const md = require('markdown-it')({breaks: true});
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].type === "prompt") {
|
||||
chatData.value.push(data[i]);
|
||||
@@ -228,7 +228,7 @@ const connect = function (chat_id, role_id) {
|
||||
|
||||
} else {
|
||||
lineBuffer.value += data.content;
|
||||
let md = require('markdown-it')();
|
||||
const md = require('markdown-it')({breaks: true});
|
||||
const reply = chatData.value[chatData.value.length - 1]
|
||||
reply['orgContent'] = lineBuffer.value;
|
||||
reply['content'] = md.render(lineBuffer.value);
|
||||
|
||||
Reference in New Issue
Block a user