Skip to content

Commit 9af5c4b

Browse files
Merge pull request #98 from Deodat-Lawson/main
Emergency production timeout fix
2 parents 53bc05a + 8b392ac commit 9af5c4b

13 files changed

Lines changed: 40 additions & 0 deletions

File tree

src/app/api/AIAssistant/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import { users, document } from "~/server/db/schema";
1818
import { performTavilySearch, type WebSearchResult } from "./services/tavilySearch";
1919

2020

21+
export const runtime = 'nodejs';
22+
export const maxDuration = 300;
23+
2124

2225
type PdfChunkRow = Record<string, unknown> & {
2326
id: number;
@@ -354,6 +357,7 @@ export async function POST(request: Request) {
354357
openAIApiKey: process.env.OPENAI_API_KEY,
355358
modelName: "gpt-4",
356359
temperature: 0.7, // Increased for more natural, conversational responses
360+
timeout: 600000
357361
});
358362

359363
const selectedStyle = style ?? 'concise';

src/app/api/agent-ai-chatbot/chats/[chatId]/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import {
88
} from "~/server/db/schema";
99
import { eq } from "drizzle-orm";
1010

11+
export const runtime = 'nodejs';
12+
export const maxDuration = 300;
13+
1114
// GET /api/agent-ai-chatbot/chats/[chatId] - Get a specific chat with its messages
1215
export async function GET(
1316
request: NextRequest,

src/app/api/agent-ai-chatbot/chats/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { agentAiChatbotChat } from "~/server/db/schema";
55
import { eq, desc } from "drizzle-orm";
66
import { randomUUID } from "crypto";
77

8+
export const runtime = 'nodejs';
9+
export const maxDuration = 300;
10+
811
// GET /api/agent-ai-chatbot/chats - Get all chats for a user
912
export async function GET(request: NextRequest) {
1013
try {

src/app/api/agent-ai-chatbot/execution-steps/[stepId]/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { db } from "~/server/db";
44
import { agentAiChatbotExecutionStep } from "~/server/db/schema";
55
import { eq } from "drizzle-orm";
66

7+
export const runtime = 'nodejs';
8+
export const maxDuration = 300;
9+
710
// PATCH /api/agent-ai-chatbot/execution-steps/[stepId] - Update execution step
811
export async function PATCH(
912
request: NextRequest,

src/app/api/agent-ai-chatbot/execution-steps/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { agentAiChatbotExecutionStep } from "~/server/db/schema";
55
import { eq } from "drizzle-orm";
66
import { randomUUID } from "crypto";
77

8+
export const runtime = 'nodejs';
9+
export const maxDuration = 300;
10+
811
// POST /api/agent-ai-chatbot/execution-steps - Create an execution step
912
export async function POST(request: NextRequest) {
1013
try {

src/app/api/agent-ai-chatbot/memory/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { agentAiChatbotMemory } from "~/server/db/schema";
55
import { eq, and, desc } from "drizzle-orm";
66
import { randomUUID } from "crypto";
77

8+
export const runtime = 'nodejs';
9+
export const maxDuration = 300;
10+
811
// POST /api/agent-ai-chatbot/memory - Store memory
912
export async function POST(request: NextRequest) {
1013
try {

src/app/api/agent-ai-chatbot/messages/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { agentAiChatbotMessage, agentAiChatbotChat } from "~/server/db/schema";
55
import { eq } from "drizzle-orm";
66
import { randomUUID } from "crypto";
77

8+
export const runtime = 'nodejs';
9+
export const maxDuration = 300;
10+
811
// POST /api/agent-ai-chatbot/messages - Send a message
912
export async function POST(request: NextRequest) {
1013
try {

src/app/api/agent-ai-chatbot/tasks/[taskId]/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { db } from "~/server/db";
44
import { agentAiChatbotTask, agentAiChatbotExecutionStep } from "~/server/db/schema";
55
import { eq } from "drizzle-orm";
66

7+
export const runtime = 'nodejs';
8+
export const maxDuration = 300;
9+
710
// GET /api/agent-ai-chatbot/tasks/[taskId] - Get a specific task with execution steps
811
export async function GET(
912
request: NextRequest,

src/app/api/agent-ai-chatbot/tasks/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { agentAiChatbotTask } from "~/server/db/schema";
55
import { eq } from "drizzle-orm";
66
import { randomUUID } from "crypto";
77

8+
export const runtime = 'nodejs';
9+
export const maxDuration = 300;
10+
811
// POST /api/agent-ai-chatbot/tasks - Create a new task
912
export async function POST(request: NextRequest) {
1013
try {

src/app/api/agent-ai-chatbot/tools/[toolCallId]/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { db } from "~/server/db";
44
import { agentAiChatbotToolCall } from "~/server/db/schema";
55
import { eq } from "drizzle-orm";
66

7+
export const runtime = 'nodejs';
8+
export const maxDuration = 300;
9+
710
// PATCH /api/agent-ai-chatbot/tools/[toolCallId] - Update tool call result
811
export async function PATCH(
912
request: NextRequest,

0 commit comments

Comments
 (0)