Skip to content
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: add an incrementing iteration number to the chat #263

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

stefl
Copy link
Contributor

@stefl stefl commented Oct 24, 2024

Description

  • During testing we sometimes see the lesson plan reverting to a previous state and it's hard to debug why that is happening
  • This adds an incrementing "iteration" attribute to the chat
  • We can then display the iteration when we load and display data
  • Also adds logging about which keys the lesson plan has before and after edits are applied
  • Fixes an issue where the stream closes unexpectedly
  • Sends the chat completion event only once persistence has completed

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 10:22am

Copy link

github-actions bot commented Oct 24, 2024

Playwright test results

passed  13 passed
skipped  1 skipped

Details

report  Open report ↗︎
stats  14 tests across 13 suites
duration  1 minute, 47 seconds
commit  6218e8c

Skipped tests

No persona › tests/auth.test.ts › authenticate through Clerk UI

Copy link
Collaborator

@codeincontext codeincontext left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't given it a poke at runtime, but this looks like a good change 👍

@@ -320,7 +334,7 @@ describe("Aila", () => {
expect(ailaInstance.lesson.plan.title).toBe("Mocked Lesson Plan");
expect(ailaInstance.lesson.plan.subject).toBe("Mocked Subject");
expect(ailaInstance.lesson.plan.keyStage).toBe("key-stage-3");
});
}, 8000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need these extended timeouts if we're using the mock categoriser?

packages/aila/src/core/Aila.test.ts Show resolved Hide resolved
@@ -94,6 +99,7 @@ export class AilaStreamHandler {
await this.fetchChunkFromStream();
} catch (error) {
await this._chat.generationFailed(error);
throw error;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find

Comment on lines +54 to +56
public setPlan(plan: LooseLessonPlan) {
this._plan = plan;
}
Copy link
Collaborator

@codeincontext codeincontext Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we could do with some better patterns for getters and setters. For just the plan, we have the class definition, setting the initial value in the initialiser, 2 setter methods and a getter

I assume we don't need the two setters, but it's indicative of the problem of not having a nice pattern

Something like parameter properties, but I think that would only work for non-destructured properties

Copy link

@stefl stefl merged commit 5aaa1d9 into main Oct 29, 2024
13 checks passed
@stefl stefl deleted the feat/aila_iteration branch October 29, 2024 10:28
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants