• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / tg-spam / 13096292120
83%

Build:
DEFAULT BRANCH: master
Ran 02 Feb 2025 06:23AM UTC
Jobs 1
Files 20
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Feb 2025 06:20AM UTC coverage: 79.867% (+0.2%) from 79.642%
13096292120

push

github

web-flow
Requests history and openai integration (#229)

* Add history tracking for recent requests in spam detector

- Implement `LastRequests` struct to maintain a ring buffer of recent requests.
- Add tests for `LastRequests` operations like basic operations, overflow, empty, smaller requests, concurrency, negative count, zero size, and handling of nil values.
- Integrate request history tracking in `Detector` with separate histories for spam and ham messages.
- Test history tracking behavior within `Check` function of `Detector` to validate correct classification storage.
- Adapt existing test cases to accommodate new `Request` structure.

* Add history support to OpenAI spam checker and update tests

- Modify `check` function in `openAIChecker` to include message history.
- Introduce `OpenAIHistorySize` and `HistorySize` configurations.
- Add tests for message formatting with history and spam checks using history.
- Ensure thread-safe implementation for `LastRequests`.
- Update mock client to reset call history.
- Extend main application configuration for history size management.

* Add message length check in spamcheck history to prevent memory issues

Add test for handling very long request messages in LastRequests

* Enhance README with OpenAI context-aware spam detection configuration

fix formatting

* update docs about migration and legacy files

* Update OpenAI system prompt to consider message history

63 of 66 new or added lines in 4 files covered. (95.45%)

3352 of 4197 relevant lines covered (79.87%)

85.75 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
90.29
-0.36% lib/tgspam/detector.go
Jobs
ID Job ID Ran Files Coverage
1 13096292120.1 02 Feb 2025 06:23AM UTC 20
79.87
GitHub Action Run
Source Files on build 13096292120
  • Tree
  • List 20
  • Changed 4
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2b22e86d on github
  • Prev Build on master (#12937938273)
  • Next Build on master (#13096445209)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc