Skip to content

Commit

Permalink
chore: Add max duration for the response
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-paliychuk committed Jan 30, 2025
1 parent 809bab2 commit 9cce91b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/vercel_ai/scripts/seed_zep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async function seedZepData() {
};

try {
console.log("🌱 Seeding Zep with initial data...");
console.log("🤖 Seeding Zep with initial data...");

// Users in Zep may have one or more chat sessions. These are threads of messages between the user and an agent.
// TIP: Include the user's full name and email address when creating a user.
Expand Down
5 changes: 4 additions & 1 deletion examples/vercel_ai/src/app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { streamText, tool } from "ai";
import { z } from "zod";
import { ZepClient, Zep } from "@getzep/zep-cloud";

// Allow streaming responses up to 30 seconds
export const maxDuration = 30;

export async function POST(req: Request) {
const { messages, sessionId, userId } = await req.json();
const zep = new ZepClient({ apiKey: process.env.ZEP_API_KEY });
Expand Down Expand Up @@ -95,7 +98,7 @@ export async function POST(req: Request) {
await zep.memory.add(sessionId, {
messages: [
{
role: "assistant",
role: "SupportBot",
roleType: "assistant",
content: result.text,
},
Expand Down

0 comments on commit 9cce91b

Please sign in to comment.