Example implementation
Last updated
Last updated
You'd need 2 cloud function, one (createTranscript
)to start the recognition, and trigger a cloud task that on a time delay triggers the second one (firestoreCheckSTT
)to check the progress of the transcription gcp operation. If the transcript is not done, it triggers another cloud task to re-trigger the second cloud task later.
createTranscript
save to firestorm
operation name
status 'in-progress'
return
firestoreCheckSTT
end point for GCP operation
GET request to check GCP operation end point
if done
save data
if not done
trigger another cloud task operation
same payload
if errors
save data to firestore
missing handling edge cases, eg If the transcript has been deleted, should try to save in the cloud task, it should drop it Eg instead of set / merge should be try catch, with a method for update only if it exists