fixes!
This commit is contained in:
@@ -37,6 +37,7 @@ Rules:
|
||||
- Each "reason" should briefly explain why the ${mediaLabel} matches the preferences
|
||||
- Avoid duplicates
|
||||
- Include ${mediaLabelPlural} from different decades, countries${mediaType === 'tv_show' ? ', and networks' : ', and directors'}
|
||||
- The "title" field must contain ONLY the exact title name — no years, descriptions, network names, episode counts, or parenthetical notes. ✗ Bad: "Breaking Bad (2008–2013, AMC)" ✓ Good: "Breaking Bad"
|
||||
- Aim for ${brainstormCount} candidates minimum${previousFullMatches.length > 0 ? '\n- Do NOT suggest titles already in the Previous Full Matches list — generate NEW candidates inspired by what made those successful' : ''}${hardRequirements ? '\n\nIMPORTANT: Strictly follow ALL requirements. Exclude any candidate that does not meet every stated requirement.' : ''}`,
|
||||
input: `Structured preferences:
|
||||
Liked ${mediaLabelPlural}: ${input.liked.join(', ') || '(none)'}
|
||||
|
||||
@@ -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