Skip to content

Commit

Permalink
Merge branch 'main' into feat/mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrobeds authored Sep 2, 2024
2 parents ed9329c + 8c44fdd commit 67f264c
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 418 deletions.
7 changes: 7 additions & 0 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.2.2](https://github.com/oaknational/oak-ai-lesson-assistant/compare/v1.2.1...v1.2.2) (2024-08-30)


### Bug Fixes

* replace Inngest app/generation.requested with an async worker function ([#34](https://github.com/oaknational/oak-ai-lesson-assistant/issues/34)) ([eee2b1e](https://github.com/oaknational/oak-ai-lesson-assistant/commit/eee2b1efff8aa71e59333b3d0780a826286c34d5))

## [1.2.1](https://github.com/oaknational/oak-ai-lesson-assistant/compare/v1.2.0...v1.2.1) (2024-08-29)


Expand Down
8 changes: 5 additions & 3 deletions packages/api/src/router/generations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LessonSummaries, Lessons, Snippets, inngest } from "@oakai/core";
import { LessonSummaries, Lessons, Snippets } from "@oakai/core";
import { Feedback } from "@oakai/core/src/models/feedback";
import { Generations } from "@oakai/core/src/models/generations";
import { Prompts } from "@oakai/core/src/models/prompts";
Expand All @@ -12,9 +12,11 @@ import {
generationPartUserTweakedSchema,
} from "@oakai/core/src/types";
import { sendQuizFeedbackEmail } from "@oakai/core/src/utils/sendQuizFeedbackEmail";
import { requestGenerationWorker } from "@oakai/core/src/workers/generations/requestGeneration";
import logger from "@oakai/logger";
import { TRPCError } from "@trpc/server";
import { Redis } from "@upstash/redis";
import { waitUntil } from "@vercel/functions";
import { uniq } from "remeda";
import { z } from "zod";

Expand Down Expand Up @@ -189,8 +191,7 @@ export const generationRouter = router({
ctx.auth.userId,
);

await inngest.send({
name: "app/generation.requested",
const { pending } = requestGenerationWorker({
data: {
appId,
promptId,
Expand All @@ -202,6 +203,7 @@ export const generationRouter = router({
external_id: ctx.auth.userId,
},
});
waitUntil(pending);

/**
* Track if a generation is a re-generation
Expand Down
2 changes: 0 additions & 2 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { populateDemoStatuses } from "./src/functions/demo/populateDemoStatuses";
import { requestGeneration } from "./src/functions/generation/requestGeneration";
import { generateLessonQuizEmbeddings } from "./src/functions/lesson/generateLessonQuizEmbeddings";
import { generatePlanForLesson } from "./src/functions/lesson/generatePlan";
import { summariseLesson } from "./src/functions/lesson/summarise";
Expand Down Expand Up @@ -38,7 +37,6 @@ export * from "./src/models";
//export * from "./src/models/promptVariants";

export const functions = [
requestGeneration,
generateTranscriptEmbeddings,
generateSnippetEmbeddings,
generateQuizQuestionEmbeddings,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/functions/event-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ZodEventSchemas } from "inngest";
import { z } from "zod";

import { populateDemoStatusesSchema } from "./demo/populateDemoStatuses.schema";
import { requestGenerationSchema } from "./generation/requestGeneration.schema";
import { generateLessonQuizEmbeddingsSchema } from "./lesson/generateLessonQuizEmbeddings.schema";
import { generatePlanForLessonSchema } from "./lesson/generatePlan.schema";
import { summariseLessonSchema } from "./lesson/summarise.schema";
Expand Down Expand Up @@ -37,7 +36,6 @@ import { generateTranscriptEmbeddingsSchema } from "./transcript/generateTranscr

const schemas = {
"app/healthcheck": { data: z.any() },
"app/generation.requested": requestGenerationSchema,
"app/transcript.embed": generateTranscriptEmbeddingsSchema,
"app/snippet.embed": embedSnippetSchema,
"app/quizQuestion.embed": embedQuizQuestionSchema,
Expand Down
Loading

0 comments on commit 67f264c

Please sign in to comment.