Skip to content

Commit

Permalink
fix: avoid too long chat title for chat-engine test API
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini256 committed Jun 4, 2024
1 parent 78ee0ae commit 6d4ae17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/api/v1/chat_engines/[id]/test/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ export const POST = defineHandler({
await eachOfLimit(dataset.items, concurrency, async (item: any) => {
const userMessage = item.input;
const userId = 'tester';
const title = item.input.length > 255 ? item.input.substring(0, 255) : item.input;
const chat = await createChat({
engine: engine.engine,
engine_id: engine.id,
engine_name: engine.name,
engine_options: JSON.stringify(engine.engine_options),
created_at: new Date(),
created_by: userId,
title: userMessage,
title: title,
});

console.log(`[Testing] Testing with question (chat engine: ${id}): ${userMessage}`)
Expand All @@ -72,4 +73,4 @@ export const POST = defineHandler({

export const dynamic = 'force-dynamic';

export const maxDuration = 150;
export const maxDuration = 300;

0 comments on commit 6d4ae17

Please sign in to comment.