From 134e7dcbacffa1535d170c319f1c66bce6a50177 Mon Sep 17 00:00:00 2001 From: Greg Richardson Date: Tue, 5 Nov 2024 14:43:49 -0700 Subject: [PATCH] fix: tool invocations in message import --- apps/postgres-new/lib/db/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/postgres-new/lib/db/index.ts b/apps/postgres-new/lib/db/index.ts index ec67e131..a389ef66 100644 --- a/apps/postgres-new/lib/db/index.ts +++ b/apps/postgres-new/lib/db/index.ts @@ -134,7 +134,7 @@ export class DbManager { const values = messages.map( (message) => - sql`(${message.id}, ${message.databaseId}, ${message.role}, ${message.content}, ${message.toolInvocations ? JSON.stringify(message.toolInvocations) : raw`${null}`}, ${message.createdAt})` + sql`(${message.id}, ${message.databaseId}, ${message.role}, ${message.content}, ${message.toolInvocations}, ${message.createdAt})` ) return metaDb.sql`insert into messages (id, database_id, role, content, tool_invocations, created_at) values ${join(values, ',')} on conflict (id) do nothing`