From c820c84dcab93367f59aac590522e8b876b84878 Mon Sep 17 00:00:00 2001 From: Kevin CATHALY Date: Thu, 4 Jul 2024 08:50:16 +0200 Subject: [PATCH] Update src/routes/api/conversations/+server.ts Co-authored-by: Nathan Sarrazin --- src/routes/api/conversations/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/api/conversations/+server.ts b/src/routes/api/conversations/+server.ts index da6c234d596..1b5ca26aa98 100644 --- a/src/routes/api/conversations/+server.ts +++ b/src/routes/api/conversations/+server.ts @@ -30,7 +30,7 @@ export async function GET({ locals, url }) { updatedAt: conv.updatedAt, modelId: conv.model, assistantId: conv.assistantId, - modelTools: models.filter((m) => m.id == conv.model)[0].tools ?? false, + modelTools: models.find((m) => m.id == conv.model)?.tools ?? false, })); return Response.json(res);