Skip to content

Build your personal knowledge base with Trilium Notes

use 16 character random string for session ID

perf3ctbbd81f6ef1ac
diff --git a/src/services/llm/rest_chat_service.ts b/src/services/llm/rest_chat_service.ts
index 61d945e5d8..ef54604416 100644
--- a/src/services/llm/rest_chat_service.ts
+++ b/src/services/llm/rest_chat_service.ts
@@ -8,9 +8,8 @@ import * as aiServiceManagerModule from "./ai_service_manager.js";
import becca from "../../becca/becca.js";
import vectorStore from "./embeddings/index.js";
import providerManager from "./providers/providers.js";
-// @ts-ignore
-import { v4 as uuidv4 } from 'uuid';
import options from "../../services/options.js";
+import { randomString } from "../utils.js";
// Define interfaces for the REST API
export interface NoteSource {
@@ -715,7 +714,7 @@ class RestChatService {
const options: any = req.body || {};
const title = options.title || 'Chat Session';
- const sessionId = uuidv4();
+ const sessionId = randomString(16);
const now = new Date();
// Initial system message if provided