Add hybrid R4R media conversation mode
This commit is contained in:
1 parent
927636ec8b
commit
b73e305cf3
15 files changed
+357
-35
No files matched your search
+11
-2
@@ -10,9 +10,18 @@ dotenv.config();
|
||||
export const MAX_CONFIGURED_AUTOMATED_CONVERSATION_TURNS = 20;
|
||||
|
||||
export const ConversationBehaviourSchema = z.object({
|
||||
mode: z.enum(['legacy', 'r4r', 'manual']).default('legacy'),
|
||||
mode: z.enum(['legacy', 'r4r', 'r4r-media', 'manual']).default('legacy'),
|
||||
maxAutomatedTurns: z.number().int().min(1).max(MAX_CONFIGURED_AUTOMATED_CONVERSATION_TURNS).default(3),
|
||||
}).default({ mode: 'legacy', maxAutomatedTurns: 3 });
|
||||
rapportTurnsBeforeMediaAsk: z.number().int().min(1).max(MAX_CONFIGURED_AUTOMATED_CONVERSATION_TURNS - 1).default(3),
|
||||
}).superRefine((behaviour, context) => {
|
||||
if (behaviour.mode === 'r4r-media' && behaviour.rapportTurnsBeforeMediaAsk >= behaviour.maxAutomatedTurns) {
|
||||
context.addIssue({
|
||||
code: 'custom',
|
||||
path: ['rapportTurnsBeforeMediaAsk'],
|
||||
message: 'Rapport turns must be lower than the maximum automated turns.',
|
||||
});
|
||||
}
|
||||
}).default({ mode: 'legacy', maxAutomatedTurns: 3, rapportTurnsBeforeMediaAsk: 3 });
|
||||
|
||||
export type ConversationBehaviour = z.infer<typeof ConversationBehaviourSchema>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user