Add human-led conversation learning loop
This commit is contained in:
1 parent
bc42c55555
commit
687abab82b
52 files changed
+2112
-53
No files matched your search
@@ -5,6 +5,7 @@ export * from './common.js';
|
||||
export * from './config.js';
|
||||
export * from './events.js';
|
||||
export * from './growth.js';
|
||||
export * from './learning.js';
|
||||
export * from './media.js';
|
||||
export * from './messages.js';
|
||||
export * from './outreach.js';
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const LearningCreditClassSchema = z.enum([
|
||||
'human-created-success',
|
||||
'human-improved-success',
|
||||
'human-completed-ai-trajectory',
|
||||
'autonomous-success',
|
||||
'recipient-initiated-media',
|
||||
'uncertain',
|
||||
]);
|
||||
export const LearningStatusSchema = z.enum(['provisional', 'eligible', 'excluded', 'invalidated', 'needs-review']);
|
||||
export const LearningTrajectorySchema = z.strictObject({
|
||||
id: z.string(), accountId: z.string(), conversationId: z.string(), sentMessageId: z.number().int().nullable(),
|
||||
subreddit: z.string().nullable(), sourceType: z.enum(['image', 'chat']).nullable(),
|
||||
policyMode: z.enum(['legacy', 'r4r', 'r4r-media', 'manual']).nullable(), firstHumanEventId: z.string().nullable(),
|
||||
outcomeEventId: z.string(), outcomeType: z.enum(['image-received', 'reciprocal-engagement']),
|
||||
creditClass: LearningCreditClassSchema, attributionConfidence: z.enum(['exact', 'fingerprint', 'inferred']),
|
||||
status: LearningStatusSchema, maturityAt: z.number(), invalidatedAt: z.number().nullable(),
|
||||
invalidationReason: z.string().nullable(), reviewedAt: z.number().nullable(), createdAt: z.number(), updatedAt: z.number(),
|
||||
});
|
||||
export const LearningSummarySchema = z.strictObject({
|
||||
total: z.number(), provisional: z.number(), eligible: z.number(), excluded: z.number(), invalidated: z.number(),
|
||||
needsReview: z.number(), humanCreated: z.number(), humanImproved: z.number(), humanCompletedAi: z.number(),
|
||||
autonomous: z.number(), recipientInitiated: z.number(), uncertain: z.number(), exact: z.number(),
|
||||
fingerprint: z.number(), inferred: z.number(),
|
||||
});
|
||||
export const LearningOverviewResponseSchema = z.strictObject({
|
||||
summary: LearningSummarySchema,
|
||||
trajectories: z.array(LearningTrajectorySchema),
|
||||
captureEnabled: z.boolean(), generationEnabled: z.boolean(), shadowMode: z.boolean(), policyVersion: z.string(),
|
||||
});
|
||||
export const LearningReviewRequestSchema = z.strictObject({ status: z.enum(['eligible', 'excluded']) });
|
||||
export const LearningReviewResponseSchema = z.strictObject({ success: z.literal(true) });
|
||||
|
||||
export type LearningOverviewResponse = z.infer<typeof LearningOverviewResponseSchema>;
|
||||
Reference in new issue
Block a user