Skip to content

Commit

Permalink
ai: run on edge
Browse files Browse the repository at this point in the history
This will ensure that the lambda function has more time to stream the response to the client
  • Loading branch information
lean1190 committed Dec 30, 2023
1 parent 52df548 commit 28bd43c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/api/ai/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { getServerSession } from '@/lib/auth/session';
import { createOvercommitmentPrompt } from '@/lib/commitments/ai';
import { createMoodAdvicePrompt, createMoodSummaryPrompt } from '@/lib/moods/ai';

export const runtime = 'edge';

const executionPrompt: { [key in AiExecutionName]: (userId: string) => Promise<string> } = {
[AiExecutionName.MoodSummary]: createMoodSummaryPrompt,
[AiExecutionName.MoodAdvice]: createMoodAdvicePrompt,
Expand Down

0 comments on commit 28bd43c

Please sign in to comment.