MCPcopy Index your code
hub / github.com/simstudioai/sim / formatTranscriptContent

Function formatTranscriptContent

apps/sim/connectors/grain/grain.ts:253–278  ·  view source on GitHub ↗

* Formats a recording header plus speaker-attributed transcript lines into plain text.

(
  recording: GrainRecording,
  segments: GrainTranscriptSegment[]
)

Source from the content-addressed store, hash-verified

251 * Formats a recording header plus speaker-attributed transcript lines into plain text.
252 */
253function formatTranscriptContent(
254 recording: GrainRecording,
255 segments: GrainTranscriptSegment[]
256): string {
257 const parts: string[] = []
258
259 parts.push(`Meeting: ${recordingTitle(recording)}`)
260 if (recording.start_datetime) parts.push(`Date: ${recording.start_datetime}`)
261 if (recording.duration_ms != null) {
262 const minutes = Math.round(recording.duration_ms / 60000)
263 parts.push(`Duration: ${minutes} minutes`)
264 }
265 const names = participantNames(recording)
266 if (names.length > 0) parts.push(`Participants: ${names.join(', ')}`)
267
268 parts.push('')
269 parts.push('--- Transcript ---')
270 for (const segment of segments) {
271 const text = segment.text?.trim()
272 if (!text) continue
273 const speaker = segment.speaker?.trim() || 'Unknown'
274 parts.push(`${speaker}: ${text}`)
275 }
276
277 return parts.join('\n')
278}
279
280/**
281 * Fetches a single recording's metadata from the v2 recordings endpoint.

Callers 1

grain.tsFile · 0.70

Calls 4

recordingTitleFunction · 0.85
participantNamesFunction · 0.85
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected