edu-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -0
  3. package/dist/errors/errors.d.ts +7 -0
  4. package/dist/errors/errors.d.ts.map +1 -0
  5. package/dist/errors/errors.js +13 -0
  6. package/dist/errors/errors.js.map +1 -0
  7. package/dist/flashcard/create-flashcards.d.ts +21 -0
  8. package/dist/flashcard/create-flashcards.d.ts.map +1 -0
  9. package/dist/flashcard/create-flashcards.js +29 -0
  10. package/dist/flashcard/create-flashcards.js.map +1 -0
  11. package/dist/index.d.ts +13 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +7 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/notes/create-note.d.ts +21 -0
  16. package/dist/notes/create-note.d.ts.map +1 -0
  17. package/dist/notes/create-note.js +30 -0
  18. package/dist/notes/create-note.js.map +1 -0
  19. package/dist/practice-problems/create-practice-problems.d.ts +23 -0
  20. package/dist/practice-problems/create-practice-problems.d.ts.map +1 -0
  21. package/dist/practice-problems/create-practice-problems.js +57 -0
  22. package/dist/practice-problems/create-practice-problems.js.map +1 -0
  23. package/dist/quizzes/create-quiz.d.ts +23 -0
  24. package/dist/quizzes/create-quiz.d.ts.map +1 -0
  25. package/dist/quizzes/create-quiz.js +40 -0
  26. package/dist/quizzes/create-quiz.js.map +1 -0
  27. package/dist/shared/schema.d.ts +19 -0
  28. package/dist/shared/schema.d.ts.map +1 -0
  29. package/dist/shared/schema.js +12 -0
  30. package/dist/shared/schema.js.map +1 -0
  31. package/dist/studyguide/create-studyguide.d.ts +24 -0
  32. package/dist/studyguide/create-studyguide.d.ts.map +1 -0
  33. package/dist/studyguide/create-studyguide.js +43 -0
  34. package/dist/studyguide/create-studyguide.js.map +1 -0
  35. package/package.json +39 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Oluwatobiloba Adejumo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # edu-sdk
2
+
3
+ Generate learning materials from content using a language model.
4
+
5
+ Pass a `model` (string model ID or AI SDK `LanguageModel`), `content`, and optional `difficulty` (`easy` | `medium` | `hard`).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add edu-sdk
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ts
16
+ import { createQuiz } from "edu-sdk";
17
+
18
+ const quiz = await createQuiz({
19
+ model: "google/gemini-3.6-flash",
20
+ content,
21
+ count: 10,
22
+ difficulty: "medium",
23
+ });
24
+ ```
25
+
26
+ `createQuiz` returns `Promise<QuizQuestion[]>`. Each question looks like:
27
+
28
+ ```ts
29
+ {
30
+ question: string;
31
+ options: string[];
32
+ correctAnswer: number; // zero-indexed
33
+ }
34
+ ```
35
+
36
+ ## API
37
+
38
+ | Function | Description |
39
+ | --- | --- |
40
+ | `createQuiz` | Multiple-choice questions |
41
+ | `createFlashcards` | Front/back flashcards |
42
+ | `createStudyGuide` | Structured study guide |
43
+ | `createPracticeProblems` | Practice problems with solutions |
44
+ | `createNote` | Markdown notes (no React component) |
45
+
46
+ Shared options on every create call:
47
+
48
+ | Option | Type | Required |
49
+ | --- | --- | --- |
50
+ | `model` | `string \| LanguageModel` | Yes |
51
+ | `content` | `string` | Yes |
52
+ | `difficulty` | `"easy" \| "medium" \| "hard"` | No |
53
+
54
+ Some surfaces take extra options (for example `count` on `createQuiz`).
55
+
56
+ ## Errors
57
+
58
+ Options are validated with Zod before the model is called. Invalid options throw `InvalidInputError`, which extends `EduSDKError`.
59
+
60
+ ```ts
61
+ import { InvalidInputError, EduSDKError } from "edu-sdk";
62
+ ```
63
+
64
+ ## UI
65
+
66
+ For React components that render these outputs, use [`@edu-sdk/react`](../react/README.md).
67
+
68
+ ## Links
69
+
70
+ - [Monorepo README](../../README.md)
71
+ - [GitHub](https://github.com/Tobi3333A/edu-sdk)
72
+
73
+ ## License
74
+
75
+ MIT © 2026 Oluwatobiloba Adejumo. See [LICENSE](../../LICENSE).
@@ -0,0 +1,7 @@
1
+ export declare class EduSDKError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export declare class InvalidInputError extends EduSDKError {
5
+ constructor(message: string);
6
+ }
7
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,KAAK;gBACtB,OAAO,EAAE,MAAM;CAI9B;AAED,qBAAa,iBAAkB,SAAQ,WAAW;gBAClC,OAAO,EAAE,MAAM;CAI9B"}
@@ -0,0 +1,13 @@
1
+ export class EduSDKError extends Error {
2
+ constructor(message) {
3
+ super(message);
4
+ this.name = 'EduSDKError';
5
+ }
6
+ }
7
+ export class InvalidInputError extends EduSDKError {
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = "InvalidInputError";
11
+ }
12
+ }
13
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;IAClC,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC9B,CAAC;CACJ;AAED,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAC9C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACpC,CAAC;CACJ"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const createFlashcardsOptionsSchema: z.ZodObject<{
3
+ model: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<import("ai").LanguageModel, import("ai").LanguageModel>]>;
4
+ content: z.ZodString;
5
+ difficulty: z.ZodOptional<z.ZodEnum<{
6
+ easy: "easy";
7
+ medium: "medium";
8
+ hard: "hard";
9
+ }>>;
10
+ count: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ declare const flashcardSchema: z.ZodObject<{
13
+ front: z.ZodString;
14
+ back: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export type Flashcard = z.infer<typeof flashcardSchema>;
17
+ type Flashcards = Flashcard[];
18
+ export type CreateFlashcardsOptions = z.infer<typeof createFlashcardsOptionsSchema>;
19
+ export declare function createFlashcards(options: CreateFlashcardsOptions): Promise<Flashcards>;
20
+ export {};
21
+ //# sourceMappingURL=create-flashcards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-flashcards.d.ts","sourceRoot":"","sources":["../../src/flashcard/create-flashcards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,6BAA6B;;;;;;;;;iBAExC,CAAC;AAEH,QAAA,MAAM,eAAe;;;iBAGnB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,KAAK,UAAU,GAAG,SAAS,EAAE,CAAA;AAE7B,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmB5F"}
@@ -0,0 +1,29 @@
1
+ import { generateText, Output } from 'ai';
2
+ import { z } from 'zod';
3
+ import { generationOptionsSchema } from '../shared/schema.js';
4
+ import { InvalidInputError } from '../errors/errors.js';
5
+ export const createFlashcardsOptionsSchema = generationOptionsSchema.extend({
6
+ count: z.number().int().positive()
7
+ });
8
+ const flashcardSchema = z.object({
9
+ front: z.string().min(1).describe('The front part of the flashcard'),
10
+ back: z.string().min(1).describe('The back part of the flashcard')
11
+ });
12
+ export async function createFlashcards(options) {
13
+ const result = createFlashcardsOptionsSchema.safeParse(options);
14
+ if (!result.success) {
15
+ throw new InvalidInputError(result.error.issues[0]?.message ?? "Invalid flashcard generation options");
16
+ }
17
+ const { model, content, count, difficulty = 'medium' } = result.data;
18
+ const { output } = await generateText({
19
+ model,
20
+ prompt: `Create ${count} flashcards from this content: ${content} and with this difficulty level: ${difficulty}`,
21
+ output: Output.object({
22
+ schema: z.object({
23
+ cards: z.array(flashcardSchema).length(count)
24
+ })
25
+ })
26
+ });
27
+ return output.cards;
28
+ }
29
+ //# sourceMappingURL=create-flashcards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-flashcards.js","sourceRoot":"","sources":["../../src/flashcard/create-flashcards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACxE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACpE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACrE,CAAC,CAAC;AAOH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgC;IACnE,MAAM,MAAM,GAAG,6BAA6B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAChE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,sCAAsC,CAAC,CAAC;IAC3G,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,QAAQ,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IAErE,MAAM,EAAE,MAAM,EAAE,GAAI,MAAM,YAAY,CAAC;QACnC,KAAK;QACL,MAAM,EAAE,UAAU,KAAK,kCAAkC,OAAO,oCAAoC,UAAU,EAAE;QAChH,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;gBACb,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChD,CAAC;SACL,CAAC;KACN,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,KAAK,CAAC;AACvB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export { createFlashcards } from './flashcard/create-flashcards.js';
2
+ export type { Flashcard, CreateFlashcardsOptions } from './flashcard/create-flashcards.js';
3
+ export { createNote } from './notes/create-note.js';
4
+ export type { Note, CreateNoteOptions } from './notes/create-note.js';
5
+ export { createQuiz } from './quizzes/create-quiz.js';
6
+ export type { QuizQuestion, CreateQuizOptions } from './quizzes/create-quiz.js';
7
+ export { createStudyGuide } from './studyguide/create-studyguide.js';
8
+ export type { StudyGuide, CreateStudyGuideOptions } from './studyguide/create-studyguide.js';
9
+ export { createPracticeProblems } from './practice-problems/create-practice-problems.js';
10
+ export type { PracticeProblem, CreatePracticeProblemsOptions } from './practice-problems/create-practice-problems.js';
11
+ export type { Difficulty } from './shared/schema.js';
12
+ export { EduSDKError, InvalidInputError } from './errors/errors.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,YAAY,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,YAAY,EAAE,eAAe,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAEtH,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { createFlashcards } from './flashcard/create-flashcards.js';
2
+ export { createNote } from './notes/create-note.js';
3
+ export { createQuiz } from './quizzes/create-quiz.js';
4
+ export { createStudyGuide } from './studyguide/create-studyguide.js';
5
+ export { createPracticeProblems } from './practice-problems/create-practice-problems.js';
6
+ export { EduSDKError, InvalidInputError } from './errors/errors.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAKzF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const createNoteOptionsSchema: z.ZodObject<{
3
+ model: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<import("ai").LanguageModel, import("ai").LanguageModel>]>;
4
+ content: z.ZodString;
5
+ difficulty: z.ZodOptional<z.ZodEnum<{
6
+ easy: "easy";
7
+ medium: "medium";
8
+ hard: "hard";
9
+ }>>;
10
+ length: z.ZodOptional<z.ZodEnum<{
11
+ medium: "medium";
12
+ short: "short";
13
+ long: "long";
14
+ }>>;
15
+ }, z.core.$strip>;
16
+ export type CreateNoteOptions = z.infer<typeof createNoteOptionsSchema>;
17
+ declare const noteSchema: z.ZodString;
18
+ export type Note = z.infer<typeof noteSchema>;
19
+ export declare function createNote(options: CreateNoteOptions): Promise<Note>;
20
+ export {};
21
+ //# sourceMappingURL=create-note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-note.d.ts","sourceRoot":"","sources":["../../src/notes/create-note.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;iBAElC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,QAAA,MAAM,UAAU,aAAqE,CAAC;AAEtF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB1E"}
@@ -0,0 +1,30 @@
1
+ import { generateText } from "ai";
2
+ import { z } from 'zod';
3
+ import { generationOptionsSchema } from "../shared/schema.js";
4
+ import { InvalidInputError } from "../errors/errors.js";
5
+ export const createNoteOptionsSchema = generationOptionsSchema.extend({
6
+ length: z.enum(['short', 'medium', 'long']).optional()
7
+ });
8
+ const noteSchema = z.string().min(1).describe('The content of the notes in markdown');
9
+ export async function createNote(options) {
10
+ const result = createNoteOptionsSchema.safeParse(options);
11
+ if (!result.success) {
12
+ throw new InvalidInputError(result.error.issues[0]?.message ?? "Invalid note generation options");
13
+ }
14
+ const { model, content, difficulty = 'medium', length = 'medium' } = result.data;
15
+ const { text } = await generateText({
16
+ model,
17
+ prompt: `
18
+ Create a ${difficulty}-difficulty note of approximately ${length} length
19
+ using the provided content.
20
+
21
+ Format the note in Markdown.
22
+ Use headings to organize sections and bold important terms and concepts.
23
+
24
+ Content:
25
+ ${content}
26
+ `
27
+ });
28
+ return text;
29
+ }
30
+ //# sourceMappingURL=create-note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-note.js","sourceRoot":"","sources":["../../src/notes/create-note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAClE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAIH,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC,CAAC;AAItF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA0B;IACvD,MAAM,MAAM,GAAG,uBAAuB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,iCAAiC,CAAC,CAAC;IACtG,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IAEjF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,CAAC;QAChC,KAAK;QACL,MAAM,EAAE;WACL,UAAU,qCAAqC,MAAM;;;;;;;EAO9D,OAAO;KACJ;KACA,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export declare const createPracticeProblemsOptionsSchema: z.ZodObject<{
3
+ model: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<import("ai").LanguageModel, import("ai").LanguageModel>]>;
4
+ content: z.ZodString;
5
+ difficulty: z.ZodOptional<z.ZodEnum<{
6
+ easy: "easy";
7
+ medium: "medium";
8
+ hard: "hard";
9
+ }>>;
10
+ count: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ export type CreatePracticeProblemsOptions = z.infer<typeof createPracticeProblemsOptionsSchema>;
13
+ declare const practiceProblemSchema: z.ZodObject<{
14
+ question: z.ZodString;
15
+ hint: z.ZodString;
16
+ answer: z.ZodString;
17
+ solution: z.ZodString;
18
+ }, z.core.$strip>;
19
+ export type PracticeProblem = z.infer<typeof practiceProblemSchema>;
20
+ export type PracticeProblems = PracticeProblem[];
21
+ export declare function createPracticeProblems(options: CreatePracticeProblemsOptions): Promise<PracticeProblems>;
22
+ export {};
23
+ //# sourceMappingURL=create-practice-problems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-practice-problems.d.ts","sourceRoot":"","sources":["../../src/practice-problems/create-practice-problems.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mCAAmC;;;;;;;;;iBAE9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,QAAA,MAAM,qBAAqB;;;;;iBAKzB,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC;AAEjD,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA4C9G"}
@@ -0,0 +1,57 @@
1
+ import { generateText, Output } from 'ai';
2
+ import { z } from 'zod';
3
+ import { generationOptionsSchema } from "../shared/schema.js";
4
+ import { InvalidInputError } from '../errors/errors.js';
5
+ export const createPracticeProblemsOptionsSchema = generationOptionsSchema.extend({
6
+ count: z.number().int().positive()
7
+ });
8
+ const practiceProblemSchema = z.object({
9
+ question: z.string().min(1).describe('The question of the practice problem'),
10
+ hint: z.string().min(1).describe('A hint for the student to solve the question'),
11
+ answer: z.string().min(1).describe('The answer to the question'),
12
+ solution: z.string().min(1).describe('A good solution to the question to help the student understand how to solve the question')
13
+ });
14
+ export async function createPracticeProblems(options) {
15
+ const result = createPracticeProblemsOptionsSchema.safeParse(options);
16
+ if (!result.success) {
17
+ throw new InvalidInputError(result.error.issues[0]?.message ?? 'Invalid practice problems generation input');
18
+ }
19
+ const { model, content, difficulty = 'medium', count } = result.data;
20
+ const { output } = await generateText({
21
+ model,
22
+ prompt: `Create exactly ${count} ${difficulty}-difficulty practice problems using the provided content.
23
+
24
+ Each practice problem should:
25
+ - Test understanding and application of the material, not just simple recall.
26
+ - Be answerable using the provided content.
27
+ - Have a clear, unambiguous question.
28
+ - Include a helpful hint that guides the student without revealing the answer.
29
+ - Include a concise final answer.
30
+ - Include a clear worked solution explaining how to reach the answer step by step.
31
+ - Match the requested difficulty level.
32
+ - Avoid duplicate or nearly identical problems.
33
+ - Stay grounded in the provided content and do not introduce unsupported facts.
34
+
35
+ For mathematical or quantitative problems:
36
+ - Show the reasoning and calculations clearly in the solution.
37
+ - Include units where appropriate.
38
+ - Ensure the final answer is consistent with the worked solution.
39
+
40
+ For conceptual problems:
41
+ - Explain the reasoning behind the answer rather than simply restating it.
42
+
43
+ Difficulty: ${difficulty}
44
+ Number of problems: ${count}
45
+
46
+ Content:
47
+ ${content}`,
48
+ output: Output.object({
49
+ schema: z.object({
50
+ problems: z.array(practiceProblemSchema).length(count)
51
+ })
52
+ })
53
+ });
54
+ return output.problems;
55
+ }
56
+ ;
57
+ //# sourceMappingURL=create-practice-problems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-practice-problems.js","sourceRoot":"","sources":["../../src/practice-problems/create-practice-problems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,MAAM,mCAAmC,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAGH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAChF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0FAA0F,CAAC;CACnI,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAAsC;IAC/E,MAAM,MAAM,GAAG,mCAAmC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACtE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,4CAA4C,CAAC,CAAC;IACjH,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IAEnE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC;QAClC,KAAK;QACL,MAAM,EAAE,kBAAkB,KAAK,IAAI,UAAU;;;;;;;;;;;;;;;;;;;;;cAqBvC,UAAU;sBACF,KAAK;;;EAGzB,OAAO,EAAE;QACH,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;gBACb,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aACzD,CAAC;SACL,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAA;AAC1B,CAAC;AAAA,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export declare const createQuizOptionsSchema: z.ZodObject<{
3
+ model: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<import("ai").LanguageModel, import("ai").LanguageModel>]>;
4
+ content: z.ZodString;
5
+ difficulty: z.ZodOptional<z.ZodEnum<{
6
+ easy: "easy";
7
+ medium: "medium";
8
+ hard: "hard";
9
+ }>>;
10
+ count: z.ZodNumber;
11
+ numOfOptions: z.ZodOptional<z.ZodNumber>;
12
+ }, z.core.$strip>;
13
+ export type CreateQuizOptions = z.infer<typeof createQuizOptionsSchema>;
14
+ declare function createQuizQuestionSchema(numOfOptions: number): z.ZodObject<{
15
+ question: z.ZodString;
16
+ options: z.ZodArray<z.ZodString>;
17
+ correctAnswer: z.ZodNumber;
18
+ }, z.core.$strip>;
19
+ export type QuizQuestion = z.infer<ReturnType<typeof createQuizQuestionSchema>>;
20
+ type Quiz = QuizQuestion[];
21
+ export declare function createQuiz(options: CreateQuizOptions): Promise<Quiz>;
22
+ export {};
23
+ //# sourceMappingURL=create-quiz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-quiz.d.ts","sourceRoot":"","sources":["../../src/quizzes/create-quiz.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAGlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,iBAAS,wBAAwB,CAAC,YAAY,EAAE,MAAM;;;;kBAMrD;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;AAChF,KAAK,IAAI,GAAG,YAAY,EAAE,CAAC;AAE3B,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B1E"}
@@ -0,0 +1,40 @@
1
+ import { generateText, Output } from "ai";
2
+ import { z } from 'zod';
3
+ import { generationOptionsSchema } from "../shared/schema.js";
4
+ import { InvalidInputError } from "../errors/errors.js";
5
+ export const createQuizOptionsSchema = generationOptionsSchema.extend({
6
+ count: z.number().int().positive(),
7
+ numOfOptions: z.number().int().min(2).optional()
8
+ });
9
+ function createQuizQuestionSchema(numOfOptions) {
10
+ return z.object({
11
+ question: z.string().describe('A question in the quiz'),
12
+ options: z.array(z.string()).length(numOfOptions).describe(`Exactly ${numOfOptions} options for this qustion`),
13
+ correctAnswer: z.number().int().min(0).max(numOfOptions - 1).describe('The index position of the correct option using 0-indexing')
14
+ });
15
+ }
16
+ export async function createQuiz(options) {
17
+ const result = createQuizOptionsSchema.safeParse(options);
18
+ if (!result.success) {
19
+ throw new InvalidInputError(result.error.issues[0]?.message ?? 'Invalid quiz generation options');
20
+ }
21
+ const { model, content, count, difficulty = 'medium', numOfOptions = 4 } = result.data;
22
+ const quizQuestionSchema = createQuizQuestionSchema(numOfOptions);
23
+ const { output } = await generateText({
24
+ model,
25
+ prompt: `Create a ${difficulty}-difficulty quiz with ${count} questions.
26
+
27
+ Each question must have exactly ${numOfOptions} answer choices.
28
+
29
+ Content:
30
+ ${content}
31
+ `,
32
+ output: Output.object({
33
+ schema: z.object({
34
+ questions: z.array(quizQuestionSchema).length(count)
35
+ })
36
+ })
37
+ });
38
+ return output.questions;
39
+ }
40
+ //# sourceMappingURL=create-quiz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-quiz.js","sourceRoot":"","sources":["../../src/quizzes/create-quiz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAClE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAIH,SAAS,wBAAwB,CAAC,YAAoB;IAClD,OAAO,CAAC,CAAC,MAAM,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACvD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,WAAW,YAAY,2BAA2B,CAAC;QAC9G,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,2DAA2D,CAAC;KACrI,CAAC,CAAC;AACP,CAAC;AAKD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA0B;IACvD,MAAM,MAAM,GAAG,uBAAuB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,iCAAiC,CAAC,CAAA;IACrG,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,QAAQ,EAAE,YAAY,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IAEvF,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC;IAElE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC;QAClC,KAAK;QACL,MAAM,EAAE,YAAY,UAAU,yBAAyB,KAAK;;kCAElC,YAAY;;;EAG5C,OAAO;KACJ;QACG,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;gBACb,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aACvD,CAAC;SACL,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,SAAS,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import type { LanguageModel } from "ai";
3
+ declare const difficultySchema: z.ZodEnum<{
4
+ easy: "easy";
5
+ medium: "medium";
6
+ hard: "hard";
7
+ }>;
8
+ export type Difficulty = z.infer<typeof difficultySchema>;
9
+ export declare const generationOptionsSchema: z.ZodObject<{
10
+ model: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<LanguageModel, LanguageModel>]>;
11
+ content: z.ZodString;
12
+ difficulty: z.ZodOptional<z.ZodEnum<{
13
+ easy: "easy";
14
+ medium: "medium";
15
+ hard: "hard";
16
+ }>>;
17
+ }, z.core.$strip>;
18
+ export {};
19
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/shared/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAExC,QAAA,MAAM,gBAAgB;;;;EAAqC,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAO1D,eAAO,MAAM,uBAAuB;;;;;;;;iBAOlC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ const difficultySchema = z.enum(['easy', 'medium', 'hard']);
3
+ const languageModelSchema = z.custom((value) => typeof value === "object" && value !== null, "Model must be a model ID or LanguageModel");
4
+ export const generationOptionsSchema = z.object({
5
+ model: z.union([
6
+ z.string().min(1, "Model must be supplied"),
7
+ languageModelSchema
8
+ ]),
9
+ content: z.string().min(1, "Content cannot be empty"),
10
+ difficulty: difficultySchema.optional()
11
+ });
12
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/shared/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAI5D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAChC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EACtD,2CAA2C,CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;QACX,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;QAC3C,mBAAmB;KACtB,CAAC;IACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;IACrD,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const createStudyGuideOptionsSchema: z.ZodObject<{
3
+ model: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<import("ai").LanguageModel, import("ai").LanguageModel>]>;
4
+ content: z.ZodString;
5
+ difficulty: z.ZodOptional<z.ZodEnum<{
6
+ easy: "easy";
7
+ medium: "medium";
8
+ hard: "hard";
9
+ }>>;
10
+ }, z.core.$strip>;
11
+ export type CreateStudyGuideOptions = z.infer<typeof createStudyGuideOptionsSchema>;
12
+ declare const studyGuideSchema: z.ZodObject<{
13
+ title: z.ZodString;
14
+ summary: z.ZodString;
15
+ keyConcepts: z.ZodArray<z.ZodObject<{
16
+ concept: z.ZodString;
17
+ explanation: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ reviewQuestions: z.ZodArray<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type StudyGuide = z.infer<typeof studyGuideSchema>;
22
+ export declare function createStudyGuide(options: CreateStudyGuideOptions): Promise<StudyGuide>;
23
+ export {};
24
+ //# sourceMappingURL=create-studyguide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-studyguide.d.ts","sourceRoot":"","sources":["../../src/studyguide/create-studyguide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,6BAA6B;;;;;;;;iBAA0B,CAAC;AACrE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,QAAA,MAAM,gBAAgB;;;;;;;;iBAUpB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CA6B5F"}
@@ -0,0 +1,43 @@
1
+ import { generateText, Output } from 'ai';
2
+ import { z } from 'zod';
3
+ import { generationOptionsSchema } from "../shared/schema.js";
4
+ import { InvalidInputError } from '../errors/errors.js';
5
+ export const createStudyGuideOptionsSchema = generationOptionsSchema;
6
+ const studyGuideSchema = z.object({
7
+ title: z.string().min(1),
8
+ summary: z.string().min(1),
9
+ keyConcepts: z.array(z.object({
10
+ concept: z.string().min(1),
11
+ explanation: z.string().min(1)
12
+ })).min(1),
13
+ reviewQuestions: z.array(z.string().min(1)).min(1)
14
+ });
15
+ export async function createStudyGuide(options) {
16
+ const result = createStudyGuideOptionsSchema.safeParse(options);
17
+ if (!result.success) {
18
+ throw new InvalidInputError(result.error.issues[0]?.message ?? 'Invalid study guide generation options');
19
+ }
20
+ const { model, content, difficulty = 'medium' } = result.data;
21
+ const { output } = await generateText({
22
+ model,
23
+ prompt: `Create a ${difficulty}-difficulty study guide from the content below.
24
+
25
+ The study guide should:
26
+ - Give a concise but complete summary of the material.
27
+ - Identify the most important concepts a student should understand.
28
+ - Explain each key concept clearly and accurately.
29
+ - Include review questions that test understanding rather than simple memorization.
30
+ - Stay grounded in the provided content and do not introduce unsupported information.
31
+ - Match the requested difficulty level.
32
+
33
+ Content:
34
+ ${content}
35
+ `,
36
+ output: Output.object({
37
+ schema: studyGuideSchema
38
+ })
39
+ });
40
+ return output;
41
+ }
42
+ ;
43
+ //# sourceMappingURL=create-studyguide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-studyguide.js","sourceRoot":"","sources":["../../src/studyguide/create-studyguide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AAGrE,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,WAAW,EAAE,CAAC,CAAC,KAAK,CAChB,CAAC,CAAC,MAAM,CAAC;QACL,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACjC,CAAC,CACL,CAAC,GAAG,CAAC,CAAC,CAAC;IACR,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACrD,CAAC,CAAC;AAGH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgC;IACnE,MAAM,MAAM,GAAG,6BAA6B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAChE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,wCAAwC,CAAC,CAAC;IAC7G,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IAE5D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC;QAClC,KAAK;QACL,MAAM,EAAE,YAAY,UAAU;;;;;;;;;;;EAWpC,OAAO;CACR;QACO,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YAClB,MAAM,EAAE,gBAAgB;SAC3B,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAAA,CAAC"}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "edu-sdk",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/Tobi3333A/edu-sdk.git",
8
+ "directory": "packages/core"
9
+ },
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "devDependencies": {
24
+ "@types/json-schema": "^7.0.15",
25
+ "@types/node": "^26.4.0",
26
+ "typescript": "^5",
27
+ "vitest": "^4.1.11"
28
+ },
29
+ "dependencies": {
30
+ "@ai-sdk/openai": "^4.0.52",
31
+ "ai": "^7.0.79",
32
+ "zod": "^4.4.3"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc",
36
+ "test": "vitest",
37
+ "test:run": "vitest run"
38
+ }
39
+ }