-
Notifications
You must be signed in to change notification settings - Fork 10.4k
feat: send transcription summary and action items #18863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (01/24/25)1 reviewer was added to this PR based on Keith Williams's automation. |
TODO: change prompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for self-hosters, if they dont have an OpenAI .env key we simply skip the summary right?
No, I'll have to add that logic |
This PR is being marked as stale due to inactivity. |
This PR is being marked as stale due to inactivity. |
E2E results are ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI code reviewer found 11 issues
packages/emails/templates/organizer-daily-video-download-transcript-email.ts
Outdated
Show resolved
Hide resolved
packages/emails/src/templates/DailyVideoDownloadTranscriptEmail.tsx
Outdated
Show resolved
Hide resolved
constructor( | ||
calEvent: CalendarEvent, | ||
attendee: Person, | ||
transcriptDownloadLinks: string[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter name 'transcriptDownloadLinks' in the constructor doesn't match the 'downloadLinks' property name used in the template parameters, creating an inconsistency in naming
@@ -708,14 +708,22 @@ export const sendDailyVideoRecordingEmails = async (calEvent: CalendarEvent, dow | |||
await Promise.all(emailsToSend); | |||
}; | |||
|
|||
export const sendDailyVideoTranscriptEmails = async (calEvent: CalendarEvent, transcripts: string[]) => { | |||
export const sendDailyVideoTranscriptEmails = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function parameter change needs to be propagated to all call sites
export const sendDailyVideoTranscriptEmails = async ( | ||
calEvent: CalendarEvent, | ||
transcripts: string[], | ||
summaries: string[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding parameter validation for new summaries parameter
const vttContent = await transcriptResponse.text(); | ||
|
||
// Clean up VTT content by removing timestamps and metadata | ||
const cleanTranscript = vttContent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No check for transcript size against OpenAI's token limits, which could cause API failures for large meetings.
}), | ||
}); | ||
|
||
if (!response.ok) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limited error handling with generic error messages. Consider capturing and forwarding specific error details from the OpenAI API response.
@@ -708,14 +708,22 @@ | |||
await Promise.all(emailsToSend); | |||
}; | |||
|
|||
export const sendDailyVideoTranscriptEmails = async (calEvent: CalendarEvent, transcripts: string[]) => { | |||
export const sendDailyVideoTranscriptEmails = async ( | |||
calEvent: CalendarEvent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function signature change is a breaking change that could affect existing implementations
@@ -360,6 +360,7 @@ | |||
"NEXTAUTH_SECRET", | |||
"NEXTAUTH_URL", | |||
"NODE_ENV", | |||
"OPENAI_API_KEY", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding documentation about the new OpenAI API key requirement
const data = await response.json(); | ||
return data.choices[0].message.content; | ||
} catch (error) { | ||
console.error("Error generating summary:", error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule violated: Avoid Logging Sensitive Information
Logging the entire error object may expose sensitive information
const response = await fetch("https://api.openai.com/v1/chat/completions", { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, | ||
}, | ||
body: JSON.stringify({ | ||
model: "gpt-4", | ||
messages: [ | ||
{ | ||
role: "system", | ||
content: | ||
"You are a professional meeting summarizer. Create clear, concise summaries with well-organized sections and actionable items.", | ||
}, | ||
{ | ||
role: "user", | ||
content: prompt, | ||
}, | ||
], | ||
temperature: 0.5, | ||
max_tokens: 2048, | ||
}), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: move to transcription service
What does this PR do?
TODO
Figure out how many token/character to allow to generate summary
Fixes [CAL-3698] Cal.ai transcription Email Summary #15020 (GitHub issue number)
Fixes CAL-3698 (Linear issue number - should be visible at the bottom of the GitHub issue description)
Mandatory Tasks (DO NOT REMOVE)