File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import type { AgentInputItem, Session } from '@openai/agents';
22import { Agent , protocol , run } from '@openai/agents' ;
33import { randomUUID } from 'node:crypto' ;
44import { PrismaClient } from '@prisma/client' ;
5- import type { Prisma } from '@prisma/client' ;
65import * 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 }
You can’t perform that action at this time.
0 commit comments