Spaces:
Sleeping
Sleeping
Andrew
commited on
Commit
·
5b20855
1
Parent(s):
d30d00e
Unify single and multi-persona generation flow for consistency
Browse files
src/lib/server/textGeneration/multiPersona.ts
CHANGED
|
@@ -31,14 +31,8 @@ export async function* multiPersonaTextGeneration(
|
|
| 31 |
return;
|
| 32 |
}
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
// (this shouldn't happen, but handle it gracefully)
|
| 37 |
-
logger.warn("multiPersonaTextGeneration called with single persona, using standard flow");
|
| 38 |
-
const { textGeneration } = await import("./index");
|
| 39 |
-
yield* textGeneration(ctx);
|
| 40 |
-
return;
|
| 41 |
-
}
|
| 42 |
|
| 43 |
const { conv, messages } = ctx;
|
| 44 |
const convId = conv._id;
|
|
|
|
| 31 |
return;
|
| 32 |
}
|
| 33 |
|
| 34 |
+
// Single persona now uses the same flow as multiple personas for consistency
|
| 35 |
+
// This ensures all responses have the same personaResponses structure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
const { conv, messages } = ctx;
|
| 38 |
const convId = conv._id;
|
src/routes/conversation/[id]/+server.ts
CHANGED
|
@@ -477,8 +477,8 @@ export async function POST({ request, locals, params, getClientAddress }) {
|
|
| 477 |
.map((id) => userSettings?.personas?.find((p) => p.id === id && !p.archived))
|
| 478 |
.filter((p): p is import("$lib/types/Persona").Persona => p !== undefined && !p.archived);
|
| 479 |
|
| 480 |
-
// Determine if we should use multi-persona mode
|
| 481 |
-
const useMultiPersona = activePersonas.length
|
| 482 |
|
| 483 |
if (!useMultiPersona) {
|
| 484 |
// Use current persona prompt (reflects any edits)
|
|
|
|
| 477 |
.map((id) => userSettings?.personas?.find((p) => p.id === id && !p.archived))
|
| 478 |
.filter((p): p is import("$lib/types/Persona").Persona => p !== undefined && !p.archived);
|
| 479 |
|
| 480 |
+
// Determine if we should use multi-persona mode (includes single persona for consistency)
|
| 481 |
+
const useMultiPersona = activePersonas.length >= 1;
|
| 482 |
|
| 483 |
if (!useMultiPersona) {
|
| 484 |
// Use current persona prompt (reflects any edits)
|