Add per-subreddit R4R conversation modes
This commit is contained in:
1 parent
23d4c3a320
commit
0f76bcf59a
14 files changed
+343
-24
No files matched your search
@@ -7,6 +7,15 @@ import { TONE_KEYS } from './tone-profiles.js';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
export const MAX_CONFIGURED_AUTOMATED_CONVERSATION_TURNS = 20;
|
||||
|
||||
export const ConversationBehaviourSchema = z.object({
|
||||
mode: z.enum(['legacy', 'r4r', 'manual']).default('legacy'),
|
||||
maxAutomatedTurns: z.number().int().min(1).max(MAX_CONFIGURED_AUTOMATED_CONVERSATION_TURNS).default(3),
|
||||
}).default({ mode: 'legacy', maxAutomatedTurns: 3 });
|
||||
|
||||
export type ConversationBehaviour = z.infer<typeof ConversationBehaviourSchema>;
|
||||
|
||||
export const SubredditConfigSchema = z.object({
|
||||
name: z.string(),
|
||||
enabled: z.boolean().default(true),
|
||||
@@ -14,6 +23,7 @@ export const SubredditConfigSchema = z.object({
|
||||
weight: z.number().positive().optional(),
|
||||
tone: z.enum(TONE_KEYS).default('default'),
|
||||
scripted: z.string().optional(),
|
||||
conversation: ConversationBehaviourSchema,
|
||||
});
|
||||
|
||||
export type SubredditConfig = z.infer<typeof SubredditConfigSchema>;
|
||||
|
||||
Reference in new issue
Block a user