fix: crypto undefined on some websites, leading to session creation failure (#231)

This commit is contained in:
josc146 committed 2023-04-20 22:12:08 +08:00
1 parent 8af03398d5
commit 4fb5d735ea
6 files changed
+24 -9

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
import { Models } from '../config/index.mjs'
import { v4 as uuidv4 } from 'uuid'
/**
* @typedef {object} Session
@@ -43,7 +44,7 @@ export function initSession({
conversationRecords,
sessionName,
sessionId: crypto.randomUUID(),
sessionId: uuidv4(),
aiName: modelName ? Models[modelName].desc : null,
modelName,