Skip to content

Commit 0fd03a5

Browse files
committed
build error
1 parent 366cc0a commit 0fd03a5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

examples/memory/prisma.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { AgentInputItem, Session } from '@openai/agents';
22
import { Agent, protocol, run } from '@openai/agents';
33
import { randomUUID } from 'node:crypto';
44
import { PrismaClient } from '@prisma/client';
5-
import type { Prisma } from '@prisma/client';
65
import * as process from 'node:process';
76

87
/**
@@ -83,7 +82,11 @@ export class PrismaSession implements Session {
8382
orderBy: { position: 'desc' },
8483
});
8584
let position = last?.position ?? 0;
86-
const payload: Prisma.SessionItemCreateManyInput[] = [];
85+
const payload: Array<{
86+
sessionId: string;
87+
position: number;
88+
item: string;
89+
}> = [];
8790
for (const raw of items) {
8891
const item = coerceAgentItem(raw);
8992
if (!item) continue;
@@ -125,14 +128,12 @@ export class PrismaSession implements Session {
125128
this.#sessionId = undefined;
126129
}
127130

128-
async #withClient<T>(
129-
fn: (client: PrismaClient | Prisma.TransactionClient) => Promise<T>,
130-
): Promise<T> {
131+
async #withClient<T>(fn: (client: PrismaClient) => Promise<T>): Promise<T> {
131132
if (
132133
this.#useTransactions &&
133134
typeof this.#client.$transaction === 'function'
134135
) {
135-
return this.#client.$transaction((tx) => fn(tx));
136+
return this.#client.$transaction((tx: unknown) => fn(tx as PrismaClient));
136137
}
137138
return fn(this.#client);
138139
}

0 commit comments

Comments
 (0)