Deprecate make_detector as an adapter

オープン
#174 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

Start by reading lettucedetect/detectors/factory.py and lettucedetect/detectors/__init__.py, then run uv run --extra dev pytest tests/test_factory_pytest.py tests/test_golden_factory_cache_pytest.py -q. Check how the deprecation helper from #135 works and how HallucinationDetector calls the factory. Done means the specified methods and unknown-method error remain unchanged, external callers get the named warning, internal callers do not, and the golden fixtures pass.

索引モデルが issue の本文から書いたものです。

説明

ready-for-agent

Parent: #172 · Epic: #126 · Blocked by: #173, #168, #171
Branch from stateless_core; open the PR against it.

Problem

make_detector is the old entry point (and HallucinationDetector calls it). It must warn outside the package, name load_detector, and keep returning today's detectors.

Current behavior

  • lettucedetect/detectors/factory.py:10-32 builds TransformerDetector, LLMDetector or RAGFactCheckerDetector from kwargs and raises ValueError for an unknown method.
  • lettucedetect/detectors/__init__.py:5 re-exports it as _make_detector.

Steps

  1. Mark make_detector deprecated (naming load_detector) with the helper from #135.
  2. Keep building "transformer", "llm" and "rag_fact_checker" through the adapter classes and raising the same error for an unknown method.
  3. Verify HallucinationDetector (calls it from inside the package) returns today's output without a warning.

Acceptance criteria

  • Calling from a test module warns LettuceDetectDeprecationWarning naming load_detector; calling from lettucedetect.* doesn't.
  • #131 golden fixtures pass unchanged.
  • Docstring has the .. deprecated:: note; existing tests pass.

Start here

uv run --extra dev pytest tests/test_factory_pytest.py tests/test_golden_factory_cache_pytest.py -q
主要言語
Python
スター
615
フォーク
60
平均マージ
2日 18時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

KRLabsOrg/LettuceDetect のほかの issue

KRLabsOrg/LettuceDetect の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。