Skip to content

Commit

Permalink
fix query (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc authored Nov 29, 2024
1 parent a9e2ffe commit ac81636
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/service/ApplicationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,21 @@ class ApplicationService {
alloPoolId: string,
chainId: number
): Promise<Application[]> {
return await applicationRepository
const applications = await applicationRepository
.createQueryBuilder('application')
.leftJoinAndSelect('application.pool', 'pool')
.leftJoinAndSelect('application.evaluations', 'evaluation')
.where('pool.alloPoolId = :alloPoolId', { alloPoolId })
.andWhere('pool.chainId = :chainId', { chainId })
.andWhere(
'evaluation.id IS NULL OR evaluation.evaluatorType != :evaluatorType',
{
evaluatorType: EVALUATOR_TYPE.LLM_GPT3,
}
)
.getMany();

const applicationsWithoutLLM = applications.filter(
application =>
!application.evaluations.some(
evaluation => evaluation.evaluatorType === EVALUATOR_TYPE.LLM_GPT3
)
);
return applicationsWithoutLLM;
}

async upsertApplicationsForPool(
Expand Down

0 comments on commit ac81636

Please sign in to comment.