Skip to content

Add fal.ai transcription provider#30

Open
Dowser wants to merge 1 commit into
nibzard:mainfrom
Dowser:codex/fal-transcription-provider
Open

Add fal.ai transcription provider#30
Dowser wants to merge 1 commit into
nibzard:mainfrom
Dowser:codex/fal-transcription-provider

Conversation

@Dowser
Copy link
Copy Markdown

@Dowser Dowser commented May 20, 2026

Summary

  • adds a fal transcription provider backed by fal-client and the fal-ai/whisper model
  • wires --api fal into the Sapat CLI
  • documents FAL_KEY, FAL_MODEL_ID, FAL_TASK, FAL_CHUNK_LEVEL, and FAL_BATCH_SIZE
  • adds unittest coverage for provider routing and fal.ai payload construction

Validation

  • .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 --help
  • git diff --check

Note: 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.

Copilot AI review requested due to automatic review settings May 20, 2026 19:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FalTranscription implementation and routes --api fal to 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.

Comment thread src/sapat/script.py
@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 thread README.md
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 thread pyproject.toml
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"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants