Skip to content

Commit

Permalink
intermediate commit while bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
gclomax committed Nov 21, 2024
1 parent 48c2331 commit ff6072f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/aila/src/core/quiz/BaseFullQuizService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
import type { AilaQuizGeneratorService } from "../AilaServices";
import type { BaseSchema, BaseType } from "./ChoiceModels";
import { MLQuizGenerator } from "./MLQuizGenerator";
import { testRatingSchema } from "./RerankerStructuredOutputSchema";
import { TestSchemaReranker } from "./SchemaReranker";
import { SimpleQuizSelector } from "./SimpleQuizSelector";
import type {
Expand Down Expand Up @@ -60,6 +61,6 @@ export class SimpleFullQuizService extends BaseFullQuizService {
new SimpleQuizSelector<BaseType>();

public quizReranker: AilaQuizReranker<typeof BaseSchema> =
new TestSchemaReranker();
new TestSchemaReranker(testRatingSchema, "/starterQuiz");
public quizGenerators: AilaQuizGeneratorService[] = [new MLQuizGenerator()];
}
16 changes: 15 additions & 1 deletion packages/aila/src/core/quiz/SimpleFullQuizService.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import type { QuizPath } from "../../protocol/schema";
import { AilaQuiz } from "./AilaQuiz";
import { SimpleFullQuizService } from "./BaseFullQuizService";
import { selectHighestRated } from "./ChoiceModels";
import { CircleTheoremLesson } from "./CircleTheoremsExampleOutput";
import { TestRating, testRatingSchema } from "./RerankerStructuredOutputSchema";
import { FullQuizServiceFactory } from "./SimpleBodgeFactory";

describe("Tests SimpleFullQuizService", () => {
jest.setTimeout(30000);
it("should create a quiz", async () => {
it("should create a quiz", async () => {
const quizFactory = new FullQuizServiceFactory();
const quizService = quizFactory.create("simple");

const quiz = await quizService.createBestQuiz(
"/starterQuiz",
CircleTheoremLesson,
);
console.log(JSON.stringify(quiz));
const ans = true;
expect(ans).toBe(true);
});
});
4 changes: 4 additions & 0 deletions packages/aila/src/core/quiz/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export interface FullQuizService {
quizSelector: QuizSelector<BaseType>;
quizReranker: AilaQuizReranker<typeof BaseSchema>;
quizGenerators: AilaQuizGeneratorService[];
createBestQuiz(
quizType: quizPatchType,
lessonPlan: LooseLessonPlan,
): Promise<QuizQuestion[]>;
}

// Separating these out to allow for different types of selectors for different types of rerankers. Abstracting away allows for the LLM to potentially change the answer depending on input.
Expand Down

0 comments on commit ff6072f

Please sign in to comment.