From 68c699001abe06ede3bdcaa1fa03d23a87d033e0 Mon Sep 17 00:00:00 2001 From: mantagen Date: Wed, 6 Nov 2024 14:38:47 +0000 Subject: [PATCH] docs: comment on lesson snapshots model --- packages/core/src/models/lessonSnapshots.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/core/src/models/lessonSnapshots.ts b/packages/core/src/models/lessonSnapshots.ts index baf62b4d5..330344254 100644 --- a/packages/core/src/models/lessonSnapshots.ts +++ b/packages/core/src/models/lessonSnapshots.ts @@ -5,11 +5,8 @@ import type { } from "@oakai/db"; import crypto from "crypto"; -import type { - LooseLessonPlan} from "../../../aila/src/protocol/schema"; -import { - LessonPlanJsonSchema -} from "../../../aila/src/protocol/schema"; +import type { LooseLessonPlan } from "../../../aila/src/protocol/schema"; +import { LessonPlanJsonSchema } from "../../../aila/src/protocol/schema"; // #TODO this import is reaching out of the package because it would otherwise be a circular dependency import type { DeepNullable } from "../utils/DeepNullable"; import type { DeepPartial } from "../utils/DeepPartial"; @@ -31,6 +28,12 @@ function getSnapshotHash(snapshot: Snapshot) { return hash; } +/** + * Lesson snapshots are stored after each assistant message. + * They act as a snapshot of the lesson plan at that point in the chat. + * These snapshots are passed to the Moderation service and the Exports service + * for moderation and export downloads respectively. + */ export class LessonSnapshots { constructor(private readonly prisma: PrismaClientWithAccelerate) {}