Skip to content

Commit 6282a57

Browse files
committed
Move from saving transcribed sentences to paragraphs.
1 parent dd1f364 commit 6282a57

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

functions/src/webhooks/transcription.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const transcription = functions
6969
// If there is one authenticated event, pull out the parts we want to
7070
// save and try to save them in the db.
7171

72-
const { sentences } = await assembly.transcripts.sentences(
72+
const { paragraphs } = await assembly.transcripts.paragraphs(
7373
transcript.id
7474
)
7575
const { id, text, audio_url, utterances } = transcript
@@ -107,16 +107,16 @@ export const transcription = functions
107107
await writer.close()
108108
}
109109

110-
if (sentences) {
110+
if (paragraphs) {
111111
const writer = db.bulkWriter()
112-
for (let sentence of sentences) {
113-
const { confidence, start, end, text } = sentence
112+
for (let paragraph of paragraphs) {
113+
const { confidence, start, end, text } = paragraph
114114

115115
writer.set(
116116
db
117117
.collection("transcriptions")
118118
.doc(`${transcript.id}`)
119-
.collection("sentences")
119+
.collection("paragraphs")
120120
.doc(),
121121
{ confidence, start, end, text }
122122
)

0 commit comments

Comments
 (0)