export function getTranscript(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- deepgram sdk is not typed correctly
file: any,
keywords: string[] = [],
language: string = 'en',
): Promise<TranscriptOutput | { error: string }> {
return TranscribeRuntime.runPromise(
program.pipe(
Effect.provideService(Params, {
language,
keywords,
}),
Effect.provideService(MediaFile, file),
).pipe(
Effect.catchTag(FetchError, () => ({ error: 'Failed to fetch transcript' })),
Effect.catchTag(TranscribeError, () => ({ error: 'Failed to transcribe audio' })),
)
)
}
export function getTranscript(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- deepgram sdk is not typed correctly
file: any,
keywords: string[] = [],
language: string = 'en',
): Promise<TranscriptOutput | { error: string }> {
return TranscribeRuntime.runPromise(
program.pipe(
Effect.provideService(Params, {
language,
keywords,
}),
Effect.provideService(MediaFile, file),
).pipe(
Effect.catchTag(FetchError, () => ({ error: 'Failed to fetch transcript' })),
Effect.catchTag(TranscribeError, () => ({ error: 'Failed to transcribe audio' })),
)
)
}