adding buckets!
This commit is contained in:
@@ -31,7 +31,7 @@ export async function runRanking(
|
||||
chunks.push(filtered.slice(i, i + CHUNK_SIZE));
|
||||
}
|
||||
|
||||
const allBuckets: RankingOutput = {
|
||||
const allTags: RankingOutput = {
|
||||
definitely_like: [],
|
||||
might_like: [],
|
||||
questionable: [],
|
||||
@@ -46,15 +46,15 @@ export async function runRanking(
|
||||
temperature: 0.2,
|
||||
...serviceOptions,
|
||||
text: { format: zodTextFormat(RankingSchema, "ranking") },
|
||||
instructions: `You are a ${mediaLabel} ranking critic. Assign each ${mediaLabel} to exactly one of four confidence buckets based on how well it matches the user's preferences.
|
||||
instructions: `You are a ${mediaLabel} ranking critic. Assign each ${mediaLabel} to exactly one of four confidence tags based on how well it matches the user's preferences.
|
||||
|
||||
Buckets:
|
||||
Tags:
|
||||
- "definitely_like": Near-perfect match to all preferences
|
||||
- "might_like": Strong match to most preferences
|
||||
- "questionable": Partial alignment, some aspects don't match
|
||||
- "will_not_like": Likely mismatch, conflicts with preferences or avoidance criteria
|
||||
|
||||
Every ${mediaLabel} in the input must appear in exactly one bucket. Use the title exactly as given.`,
|
||||
Every ${mediaLabel} in the input must appear in exactly one tag. Use the title exactly as given.`,
|
||||
input: `User preferences:
|
||||
Liked ${mediaLabel}s: ${JSON.stringify(interpreter.liked)}
|
||||
Themes: ${JSON.stringify(interpreter.themes)}
|
||||
@@ -68,11 +68,11 @@ ${chunkTitles}`,
|
||||
|
||||
const chunkResult = (response.output_parsed as Partial<RankingOutput>) ?? {};
|
||||
|
||||
allBuckets.definitely_like.push(...(chunkResult.definitely_like ?? []));
|
||||
allBuckets.might_like.push(...(chunkResult.might_like ?? []));
|
||||
allBuckets.questionable.push(...(chunkResult.questionable ?? []));
|
||||
allBuckets.will_not_like.push(...(chunkResult.will_not_like ?? []));
|
||||
allTags.definitely_like.push(...(chunkResult.definitely_like ?? []));
|
||||
allTags.might_like.push(...(chunkResult.might_like ?? []));
|
||||
allTags.questionable.push(...(chunkResult.questionable ?? []));
|
||||
allTags.will_not_like.push(...(chunkResult.will_not_like ?? []));
|
||||
}
|
||||
|
||||
return allBuckets;
|
||||
return allTags;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user