Keep LLMDetector working as a warning adapter
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend-api-design
Direzione di ricerca
Read the parent issue #126, blockers #156 and #162, and the Errors and logging section of CONTRIBUTING.md; branch from stateless_core. Locate LLMDetector, LLMJudgeDetector, GenerativeDetector, HallucinationDetector, and the golden fixtures and existing tests. Compare current behavior with the acceptance criteria, then verify the old outputs, typed errors, warning behavior, and cache behavior against those tests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Parent
#126
Branch
Branch from stateless_core and open the pull request against it, not main. Close this ticket by hand once its pull request merges there: GitHub only closes issues automatically on merges into main.
What to build
Everyone who builds LLMDetector today keeps working and learns what to change. LLMDetector becomes a thin adapter: it chooses LLMJudgeDetector or GenerativeDetector by today's name rule or by native=, builds the client and the cache the old way when the caller passes none, and warns for each deprecated use, naming the replacement. The default cache file inside the installed package directory is gone: a file is written only when the caller passes cache_file.
The old predict* output, including the token output of the LLM detector, stays as today's golden fixtures record it.
Acceptance criteria
- Constructing
LLMDetectorfrom outside the package warnsLettuceDetectDeprecationWarningnamingLLMJudgeDetectorandGenerativeDetector; constructing it from inside the package does not warn. -
LLMDetectorpicksGenerativeDetectorfor a model name that matches today's rule, andLLMJudgeDetectorfor any other.native=Trueornative=Falseoverrides the rule. -
native=True(or a name that matches the rule) together withzero_shot,fewshot_pathorprompt_pathraisesConfigurationError(native_options_conflict, withparam), as today'sValueErrorcase does. - Without
client,LLMDetectorbuilds one fromproviderand**client_kwargsas today and warns that the client should be passed; passingproviderorclient_kwargswarns as a deprecated argument. -
cache_filebuilds aFileCacheand warns as a deprecated argument namingcache=. With nocache_filethe detector has no cache and no file is written anywhere. -
predict,predict_promptandpredict_prompt_batchconvert the new detector'sDetectioninto today's dicts, withconfidencetaken fromscoreand each key present exactly as today (golden fixtures), apart from spans that had noconfidencenow carrying 1.0. -
predict(output_format="tokens")still returns onetoken,predandprobdict per whitespace token, withprobthe overlapping span'sconfidencewhen there is one, else 0.9 for a flagged token and 0.1 for the others, as in the golden fixtures. - The old methods raise
InvalidInputError(unsupported_output_format,length_mismatch,invalid_min_score) and surface the typed errors of the new detector. -
predict_prompt_batchis unchanged apart from the above until the batch task. -
LLMDetectoralso exposesdetectandadetect, forwarding to the chosen delegate: the result equals the delegate's,model_idis the delegate's, and no warning is added beyond the one at construction. -
LLMDetectorhas the docstring note from the deprecation mechanism, andHallucinationDetector(method="llm", ...)returns today's output without a warning. - The existing tests pass unchanged.
- The changed code follows the Errors and logging section of
CONTRIBUTING.md, and no customer text is logged outsidelettucedetect.content.
Blocked by
#156, #162
User stories covered
40, 44, 45, 46, 47, 48, 57
- Lingua principale
- Python
- Stelle
- 615
- Fork
- 60
- Merge medio
- 1g 8h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di KRLabsOrg/LettuceDetect
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as cleanForse già presa @Clannad47 l’ha presa 17 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
KRLabsOrg/LettuceDetect#117 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
KRLabsOrg/LettuceDetect#108 ·
I maintainer di solito rispondono entro 1 giorno
-
Add AGENTS.md: one entry file for coding agents and new contributorsForse già presa @ShryukGrandhi l’ha presa 17 giorni fa. Apertadocumentation
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
KRLabsOrg/LettuceDetect#104 ·
I maintainer di solito rispondono entro 1 giorno
-
ready-for-agent
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
KRLabsOrg/LettuceDetect#181 ·
I maintainer di solito rispondono entro 1 giorno
-
ready-for-agent
Difficoltà 5/5 Più di una settimana Idoneità per principianti 22/100
KRLabsOrg/LettuceDetect#180 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di KRLabsOrg/LettuceDetect
Issue simili
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
graphql-python/graphql-core#304 ·
I maintainer di solito rispondono entro 1 giorno
-
docs size:S
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
Gathin23/cleanyourtv#3464 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno