Add OpenAI provider support - #5
Merged
Merged
Conversation
- Add provider dispatcher (ai_spam_check.py) that routes to the configured provider based on settings.provider in config.ini - Add OpenAI provider (openai_spam_check.py) using gpt-5.4-mini - Extract shared system prompt into email_utils/prompts.py - Rename check_spam_with_ai to check_spam_with_anthropic in the Anthropic module; public API remains check_spam_with_ai via dispatcher - Add openai>=2.0,<3.0 dependency - Add config.ini.default sections for provider selection and OpenAI - Add tests for OpenAI provider, dispatcher routing, and default behavior - Update AGENTS.md with multi-provider architecture docs
- Add configuration section with provider selection, config example, and supported providers table - Add PR checklist to AGENTS.md (always check if README needs updates)
- Define what counts as spam vs not spam explicitly - Add detection hints (DKIM/SPF failures, suspicious domains, pressure tactics) - Clarify that URL/list truncation is preprocessing, not a spam signal - Anchor confidence scale for consistent scoring - Request no markdown wrapping in response
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
gpt-5.4-mini)ai_spam_check.py) that routes to the configured provider viasettings.providerin config.ini (defaults toanthropic)email_utils/prompts.pyopenai>=2.0,<3.0dependencyTest plan
ruff check . && ruff format --check .— cleanpytest -v— 42 tests passprovider = anthropic(existing behavior unchanged)provider = openaiand a valid OpenAI API key