summaryrefslogtreecommitdiff
path: root/packages/core/src/utils
diff options
context:
space:
mode:
authorjerop <[email protected]>2025-06-11 04:46:39 +0000
committerJerop Kipruto <[email protected]>2025-06-11 01:18:40 -0400
commitd1e23b7c71e6a0e1c7d920e147ec15a0dbbf689c (patch)
tree80242ba70949c1e8b982ee1c827147ff387ea7b5 /packages/core/src/utils
parent95fdc66e7d719eae731c1afd61103f94f7fe3131 (diff)
refactor: Centralize session ID generation and propagation
Diffstat (limited to 'packages/core/src/utils')
-rw-r--r--packages/core/src/utils/nextSpeakerChecker.test.ts1
-rw-r--r--packages/core/src/utils/session.ts9
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/core/src/utils/nextSpeakerChecker.test.ts b/packages/core/src/utils/nextSpeakerChecker.test.ts
index 2514c99d..a19045d1 100644
--- a/packages/core/src/utils/nextSpeakerChecker.test.ts
+++ b/packages/core/src/utils/nextSpeakerChecker.test.ts
@@ -71,6 +71,7 @@ describe('checkNextSpeaker', () => {
chatInstance = new GeminiChat(
mockModelsInstance, // This is the instance returned by mockGoogleGenAIInstance.getGenerativeModel
'gemini-pro', // model name
+ 'test-session-id',
{},
[], // initial history
);
diff --git a/packages/core/src/utils/session.ts b/packages/core/src/utils/session.ts
new file mode 100644
index 00000000..57726019
--- /dev/null
+++ b/packages/core/src/utils/session.ts
@@ -0,0 +1,9 @@
+/**
+ * @license
+ * Copyright 2025 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { randomUUID } from 'crypto';
+
+export const sessionId = randomUUID();