Generate AI summaries when meetings end, not only after recordings.
Deploy Ladill Meet / deploy (push) Successful in 1m1s
Deploy Ladill Meet / deploy (push) Successful in 1m1s
Queue summarization on session end (with a short delay for late captions), keep recording-ready as a refresh path, and unique the summary job so end plus recording do not double-process the same transcript.
This commit is contained in:
@@ -29,18 +29,43 @@ class TranscriptService
|
||||
]);
|
||||
}
|
||||
|
||||
/** @deprecated Use finalizeAndSummarize() when a recording is ready. */
|
||||
/** @deprecated Use finalizeAndSummarize() when a session ends or a recording is ready. */
|
||||
public function ensureForSession(Session $session, ?Recording $recording = null): Transcript
|
||||
{
|
||||
return $this->finalizeAndSummarize($session, $recording);
|
||||
}
|
||||
|
||||
public function finalizeAndSummarize(Session $session, ?Recording $recording = null): Transcript
|
||||
/**
|
||||
* Whether this session should receive an automatic AI summary.
|
||||
* Matches room setting + global meet.ai.auto_summarize config.
|
||||
*/
|
||||
public function shouldAutoSummarize(Session $session): bool
|
||||
{
|
||||
$session->loadMissing('room');
|
||||
$room = $session->room;
|
||||
|
||||
if (! $room) {
|
||||
return (bool) config('meet.ai.auto_summarize', true);
|
||||
}
|
||||
|
||||
return (bool) $room->setting('auto_ai_summary', false)
|
||||
|| (bool) config('meet.ai.auto_summarize', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build/refresh the session transcript and queue AI summarization.
|
||||
*
|
||||
* @param int $delaySeconds Brief delay so late caption/chat posts can land (e.g. on meeting end).
|
||||
*/
|
||||
public function finalizeAndSummarize(Session $session, ?Recording $recording = null, int $delaySeconds = 0): Transcript
|
||||
{
|
||||
$transcript = $this->getOrCreateForSession($session, $recording);
|
||||
$this->refreshContent($transcript, $session);
|
||||
|
||||
GenerateAiSummary::dispatch($transcript->id);
|
||||
$pending = GenerateAiSummary::dispatch($transcript->id);
|
||||
if ($delaySeconds > 0) {
|
||||
$pending->delay(now()->addSeconds($delaySeconds));
|
||||
}
|
||||
|
||||
return $transcript->fresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user