Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
fix(analytics): reduce poll wait, improve result
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdcruz committed Nov 30, 2024
1 parent 2d9af44 commit 93d2b1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function triggerSummary(
},
},
{
pollIntervalMs: 60000, // 1 minute
pollIntervalMs: 5000,
metadata: { activity: id },
},
);
Expand Down
8 changes: 4 additions & 4 deletions src/trigger/generate-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ export const generateSummary = task({
messages: [
{
role: 'system',
content: 'You are a professional data analyst and secretary.',
content: 'You are a professional analyst and secretary.',
},
{
role: 'user',
content:
'Write a single-paragraph consisting of at least 5 sentences summary report of the feedback evaluation results provided below. Add basic html tags to format the text and highlight important parts, no links.',
'Write a paragraph consisting of at least 5 sentences summary report of the feedback evaluation results provided below. Add basic html tags to format the text and highlight important parts, no links.',
},
{
role: 'user',
content: `Here are ratings score from the evaluation: Partners gave a score of ${ratings?.partners?.score ?? 0}% from ${count.partners} partners, ${ratings?.implementers?.score ?? 0}% from ${count.implementers} for implementers, and ${ratings?.beneficiaries?.score ?? 0}% from ${count.beneficiaries} for beneficiaries. Totaling to ${count.total} total score across ${count.implementers + count.partners + count.beneficiaries} responses.`,
},
{
role: 'user',
content: `The evaluation feedback also shows that the evaluators have ${emotions?.length} distinct emotions, with the top 10 emotions being ${emotions
.slice(0, 9)
content: `Also, Find out the dominant and frequent emotions that shows: ${emotions
.slice(0, 60)
.map((emotion) => emotion.label)
.join(', ')}.`,
},
Expand Down

0 comments on commit 93d2b1d

Please sign in to comment.