fixes!
This commit is contained in:
@@ -121,12 +121,13 @@ async function runSubPipeline(ctx: SubPipelineCtx): Promise<CuratorOutput[]> {
|
||||
runRanking(interpreterOutput, { candidates: bucket }, mediaType, useHardRequirements)
|
||||
)
|
||||
);
|
||||
const dedupTitles = (titles: string[]) => [...new Map(titles.map((t) => [t.toLowerCase(), t])).values()];
|
||||
const rankingOutput: RankingOutput = {
|
||||
full_match: rankingBuckets.flatMap((r) => r.full_match),
|
||||
definitely_like: rankingBuckets.flatMap((r) => r.definitely_like),
|
||||
might_like: rankingBuckets.flatMap((r) => r.might_like),
|
||||
questionable: rankingBuckets.flatMap((r) => r.questionable),
|
||||
will_not_like: rankingBuckets.flatMap((r) => r.will_not_like),
|
||||
full_match: dedupTitles(rankingBuckets.flatMap((r) => r.full_match)),
|
||||
definitely_like: dedupTitles(rankingBuckets.flatMap((r) => r.definitely_like)),
|
||||
might_like: dedupTitles(rankingBuckets.flatMap((r) => r.might_like)),
|
||||
questionable: dedupTitles(rankingBuckets.flatMap((r) => r.questionable)),
|
||||
will_not_like: dedupTitles(rankingBuckets.flatMap((r) => r.will_not_like)),
|
||||
};
|
||||
log(recId, `${stagePrefix}Ranking: done (${Date.now() - t2}ms) — ${rankBucketCount} buckets`, {
|
||||
full_match: rankingOutput.full_match.length,
|
||||
@@ -163,7 +164,7 @@ async function runSubPipeline(ctx: SubPipelineCtx): Promise<CuratorOutput[]> {
|
||||
runCurator(ranking, interpreterOutput, mediaType, useWebSearch)
|
||||
)
|
||||
);
|
||||
const curatorOutput = curatorBucketOutputs.flat();
|
||||
const curatorOutput = curatorBucketOutputs.reduce((acc, bucket) => mergeCuratorOutputs(acc, bucket), [] as CuratorOutput[]);
|
||||
log(recId, `${stagePrefix}Curator: done (${Date.now() - t3}ms) — ${curatorOutput.length} items curated (${curatorBucketCount} buckets)`);
|
||||
sseWrite({ stage: p('curator'), status: 'done', data: curatorOutput });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user