8000 add typesafe (jev) provider by dominicgisler · Pull Request #82 · dominicgisler/imap-spam-cleaner · GitHub
[go: up one dir, main page]

Skip to content

add typesafe (jev) provider - #82

Merged
dominicgisler merged 1 commit into
masterfrom
feat/typesafe-provider
Oct 27, 2026
Merged

dominicgisler merged 1 commit into
masterfrom
feat/typesafe-provider

Conversation

@dominicgisler
Copy link
Copy Markdown
Owner

Closes #79

Adds a typesafe provider for TypeSafe's Jev classifier model.

How it scores

Each message is sent to POST /v1/systemone with one yes/no (noul) question. Jev returns the probability of "yes" (0–1), and the score is round(noul * 100). So minscore: 75 means "at least 75% likely spam". Request and response shapes follow TypeSafe's OpenAPI spec.

Config

Key Required Notes
apikey yes sent as Authorization: Bearer …
model yes e.g. jev-1.14.0 (pinned) or jev-latest
maxsize no Jev allows 32k tokens per question, so the examples use 50000
instructions no the yes/no question, default Is this email spam, phishing or a scam?
prompt no the message template sent as state; same placeholders as the other AI providers, but the default contains no question
url no default https://api.typesafe.ai, for proxies such as LiteLLM

Embeds AIBase, so model, maxsize and the prompt template work as they do for the other AI providers. A non-200 response returns the status plus the API's detail text (e.g. context limit exceeded), and the message is skipped like any other failed analysis.

Also

  • docs/configuration/providers.md: the type options were missing gemini and rspamd.
  • AGENTS.md: added a note on how TypeSafe scores.

Testing

  • go build, go vet and golangci-lint pass (0 issues). mkdocs build --strict passes.
  • Tested against a local mock server built from the OpenAPI spec: request path, headers and body, a proxy URL with a path prefix and a trailing slash, custom prompt/instructions, score rounding at the edges, a 400 with its detail, and a missing answer. I didn't commit that test because the repo has no tests yet.
  • Not tested against the real API (no API key).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dominicgisler dominicgisler added the enhancement New feature or request label Oct 27, 2026
@dominicgisler
dominicgisler merged commit 6a4567f into master Oct 27, 2026
1 check passed
@dominicgisler
dominicgisler deleted the feat/typesafe-provider branch October 27, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Jev as a provider

1 participant

0