Delegate the LLMDetector native path to GenerativeDetector

Aperta
#165 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ai

Direzione di ricerca

Start with lettucedetect/detectors/llm.py around _predict_native and the native branches in predict*, then read the GenerativeDetector constructor and GenerativeConfig mapping. Run uv run --extra dev pytest tests/test_llm_detector_pytest.py tests/test_golden_llm_pytest.py -q after blockers #164 and #161 are resolved. Done means native outputs match the #129 fixtures with span confidence set to 1.0, and native detection logic is no longer duplicated in LLMDetector.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

ready-for-agent

Parent: #162 · Epic: #126 · Blocked by: #164, #161
Branch from stateless_core; open the PR against it.

Problem

Until the native path of LLMDetector runs through GenerativeDetector, there are two implementations of it.

Current behavior

  • lettucedetect/detectors/llm.py:437 _predict_native and the native branch in predict* (:533-625).

Steps

  1. When self.native is true, build a GenerativeDetector from the constructor arguments (map to GenerativeConfig) and convert its Detection into today's dicts in predict, predict_prompt, predict_prompt_batch.
  2. Keep _predict_native as a thin wrapper if existing tests call it.
  3. The choice between judge and generative stays in LLMDetector (_looks_native or native=); no other code decides by name.

Acceptance criteria

  • predict* native output equals the #129 native fixtures except spans now carry confidence 1.0.
  • Existing tests pass unchanged; no native-path logic remains duplicated on LLMDetector.

Start here

uv run --extra dev pytest tests/test_llm_detector_pytest.py tests/test_golden_llm_pytest.py -q
Lingua principale
Python
Stelle
615
Fork
60
Merge medio
1g 8h
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di KRLabsOrg/LettuceDetect

Tutte le issue di KRLabsOrg/LettuceDetect

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.