chore: introduced modular subtitler design#33
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
- Coverage 97.79% 97.67% -0.12%
==========================================
Files 5 9 +4
Lines 453 473 +20
Branches 63 64 +1
==========================================
+ Hits 443 462 +19
Misses 2 2
- Partials 8 9 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 167d93acf0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def AISubtitler(provider: str = "gemini", **kwargs) -> Subtitler: | ||
| if provider == "gemini": |
There was a problem hiding this comment.
Preserve positional constructor compatibility in factory
Switching AISubtitler from a dataclass constructor to a factory changed the first positional parameter from model_name to provider, so existing calls like AISubtitler("gemini-2.5-flash", "<api-key>") now interpret the model name as a provider and fail with Unsupported AI subtitle provider. This is a runtime regression for any programmatic users who instantiated AISubtitler positionally before this refactor.
Useful? React with 👍 / 👎.
167d93a to
25627c5
Compare
Introduce a factory to instantiate subtitlers for different providers and refactor the Gemini-based subtitler as a provider implementation. This facilitates the implementation of #31 and #32