mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 12:13:46 +08:00
refactor AI chat message struct, allow users to set whether the AI responds in stream, compatible with the GPT-o1 model
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
* Util lib functions
|
||||
*/
|
||||
import {showConfirmDialog} from "vant";
|
||||
import {httpDownload} from "@/utils/http";
|
||||
import {showMessageError} from "@/utils/dialog";
|
||||
|
||||
// generate a random string
|
||||
export function randString(length) {
|
||||
@@ -183,6 +181,10 @@ export function isImage(url) {
|
||||
}
|
||||
|
||||
export function processContent(content) {
|
||||
if (!content) {
|
||||
return ""
|
||||
}
|
||||
|
||||
// 如果是图片链接地址,则直接替换成图片标签
|
||||
const linkRegex = /(https?:\/\/\S+)/g;
|
||||
const links = content.match(linkRegex);
|
||||
|
||||
Reference in New Issue
Block a user