Skip to main content

Module spam

Module spam 

Source
Expand description

Spam classification via LlmProvider with an optional cache.

classify hashes (sender, subject, body_preview) into a cache key and consults the optional SpamCache before calling the provider. On cache miss, the result is written back with a 24-hour TTL.

A Redis-backed SpamCache implementation (RedisSpamCache) is available under the default redis-cache feature.

Structs§

AiSpamResult
AI spam classification result.
RedisSpamCache
Redis-backed SpamCache using a shared redis::aio::ConnectionManager.

Traits§

SpamCache
Pluggable cache for spam classification results.

Functions§

classify
Classify a message using provider, consulting cache if supplied.