-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: further migration steps towards AilaDocument #571
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -13,7 +13,7 @@ const runManually = process.env.RUN_LLM_TESTS === "true"; | |||
|
|||
beforeEach(() => { | |||
ailaInstance = new Aila({ | |||
lessonPlan: {}, | |||
document: { content: {} }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking here is that we will probably want to pass a schema, a version, some metadata. So the document content probably needs to have this extra level of abstraction.
@@ -0,0 +1,11 @@ | |||
import type { LooseLessonPlan } from "../../protocol/schema"; | |||
|
|||
export type AilaDummyDocumentContent = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example of a different type of document that Aila could produce.
I think we will probably want a discriminating "type" attribute so we can use Zod to do a discriminated union. Not implemented yet because that would change the shape of the LooseLessonPlan.
export class AilaAmericanisms implements AilaAmericanismsFeature { | ||
export type AilaDocumentContent = Record<string, unknown>; | ||
|
||
export class AilaAmericanisms<T extends AilaDocumentContent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the association with the lesson plan and treats it as an unknown object.
@@ -12,7 +13,7 @@ import type { AilaThreatDetector } from "./threatDetection"; | |||
export interface AilaModerationFeature { | |||
moderate(options: { | |||
messages: Message[]; | |||
lessonPlan: LooseLessonPlan; | |||
content: AilaDocumentContent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The moderation feature now just accepts some arbitrary content.
Playwright test resultsDetails
Skipped testsNo persona › tests/auth.test.ts › authenticate through Clerk UI |
_migratingLessonsToDocuments.txt
Outdated
To do list for migrating the Aila package from just handling lessons, to allow it it handle different types of document. | ||
|
||
## Snapshots | ||
|
||
We need to generate a JSON schema for each document type. | ||
|
||
## Schemas for documents | ||
The document schemas should be in the Aila package, and move out of protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this to notion? Maybe it belongs in an epic or an Aila Engineering Knowledge age
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes - I spotted this had slipped in. It was a temporary file I thought I'd ignored!
public get content(): AilaDocumentContent { | ||
return this._content; | ||
} | ||
|
||
public set plan(plan: LooseLessonPlan) { | ||
this._plan = plan; | ||
public set content(content: AilaDocumentContent) { | ||
this._content = content; | ||
} | ||
|
||
public setPlan(plan: LooseLessonPlan) { | ||
this._plan = plan; | ||
public setContent(content: AilaDocumentContent) { | ||
this._content = content; | ||
} | ||
|
||
public get hasSetInitialState(): boolean { | ||
return this._hasSetInitialState; | ||
} | ||
|
||
public set hasSetInitialState(value: boolean) { | ||
this._hasSetInitialState = value; | ||
public get hasInitialisedContentFromMessages(): boolean { | ||
return this._hasInitialisedContentFromMessages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've always wondered if these could be defined as setters and getters. But changing something like that would be out of scope for a rename like this so let's ignore this comment!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree on this - we seem to have setPlan and also set plan. Probably quite easy to remove the setPlan method!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
|
🎉 This PR is included in version 1.26.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
No user-facing changes. No data migrations.