Add fal.ai transcription provider#30
Open
Dowser wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new fal transcription provider (using fal-client / fal-ai/whisper) and integrates it into the Sapat CLI, with accompanying documentation and unit tests.
Changes:
- Introduces
FalTranscriptionimplementation and routes--api falto it in the CLI. - Adds unit tests for CLI provider routing and fal.ai request payload construction.
- Updates documentation and project dependencies to include fal.ai configuration and
fal-client.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/sapat/transcription/fal.py |
Adds a new fal.ai-backed transcription provider and request construction logic. |
src/sapat/script.py |
Wires the new fal provider into the --api CLI option routing. |
tests/test_fal_transcription.py |
Adds tests for fal.ai upload/subscribe payload and missing API key validation. |
tests/test_script.py |
Adds a CLI test ensuring --api fal routes to FalTranscription. |
README.md |
Documents fal.ai support and the required FAL_* environment variables. |
pyproject.toml |
Adds fal-client as a project dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @click.option("--quality", "-q", type=click.Choice(['L', 'M', 'H'], case_sensitive=False), default='M', help="Quality of the MP3 audio: 'L' for low, 'M' for medium, and 'H' for high (default: 'M')") | ||
| @click.option("--correct", is_flag=True, help="Use LLM to correct the transcript") | ||
| @click.option("--api", "-a", type=click.Choice(['openai', 'groq', 'azure'], case_sensitive=True), required=True, help="API to use for the transcription ('openai', 'groq' or 'azure')") | ||
| @click.option("--api", "-a", type=click.Choice(['openai', 'groq', 'azure', 'fal'], case_sensitive=True), required=True, help="API to use for the transcription ('openai', 'groq', 'azure' or 'fal')") |
| "chunk_level": kwargs.get("chunk_level", self.chunk_level), | ||
| "batch_size": kwargs.get("batch_size", self.batch_size), | ||
| } | ||
|
|
Comment on lines
7
to
9
| - Converts video files to MP3 format using ffmpeg | ||
| - Supports transcription using Azure OpenAI, Groq, and OpenAI APIs | ||
| - Supports transcription using Azure OpenAI, Groq, OpenAI, and fal.ai APIs | ||
| - Supports processing of individual video files or entire directories |
Comment on lines
8
to
13
| "requests>=2.32.3", | ||
| "python-dotenv>=1.0.1", | ||
| "openai>=1.58.1", | ||
| "groq>=0.13.1" | ||
| "groq>=0.13.1", | ||
| "fal-client>=0.7.0" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
faltranscription provider backed byfal-clientand thefal-ai/whispermodel--api falinto the Sapat CLIFAL_KEY,FAL_MODEL_ID,FAL_TASK,FAL_CHUNK_LEVEL, andFAL_BATCH_SIZEValidation
.venv/bin/python -m unittest discover -s tests -v.venv/bin/python -m py_compile src/sapat/script.py src/sapat/transcription/fal.py tests/test_fal_transcription.py tests/test_script.py.venv/bin/python -m sapat.script --helpgit diff --checkNote: local tests emitted a Python/urllib3 LibreSSL warning from the macOS Python runtime, but all tests passed. I did not run a live fal.ai transcription because no API key or sample recording is committed.
Transparency: AI-assisted with Codex and checked against the Sapat source plus fal.ai public docs.