Add per-request recognizer allowlist + list accessors - #338
Merged
Conversation
Wire selects deployment NER/LLM recognizers by name instead of
just a boolean toggle. `RecognizerParams.{ner,llm}` become
`Option<ProviderSelection>`: `true` runs the whole lineup,
`false` skips it, `["a","b"]` runs only the named recognizers.
Empty allowlist and unknown names fail the analyzer compile
with the available names in the error.
Adds `Engine::{ner,llm}_recognizers()` returning
`impl ExactSizeIterator<Item = RegisteredRecognizer<'_>>` so
hosts can list what's configured without leaking backend
credentials or connection details. Each recognizer gains an
optional `description` field for the UI.
Bumps elide a29a152e -> 6c0331db (adds OcrBackend::recognize_batch
with a sequential default). Refactors BentoNer and BentoOcr so
post_recognize does the full encode-transport-decode hop inside
one function, and `recognize` delegates to `recognize_batch` for
single-request dispatch.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collapse engine's public module surface from 9 to 5: `entity` absorbs the old `primitive` module; `plan` absorbs `annotation`; `file` promotes `Document` / `FileMetadata` to root; `llm` and `ner` merge into one flat `provider` module (no name clashes since types are already `Llm*` / `Ner*` prefixed). `modality` stays standalone. `EntityRecord` re-exports from `entity`. Simplify the selection helper: replace the `Named` extractor closure with a small trait implemented in-file; replace the five-positional-parameter `select` with three, using a plain `&'static str` for the field-name interpolation (Kind struct dropped). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RecognizerParams.{ner,llm}becomeOption<ProviderSelection>:trueruns the whole lineup,falseskips it,["a","b"]runs only the named recognizers. Empty allowlist and unknown names fail the analyzer compile with the available names in the error message.Engine::ner_recognizers()/Engine::llm_recognizers()returningimpl ExactSizeIterator<Item = RegisteredRecognizer<'_>>so hosts can list what's registered without leaking backend credentials or connection details. Each recognizer gains an optionaldescriptionfield for the UI.a29a152e → 6c0331db(addsOcrBackend::recognize_batchwith a sequential default). RefactorsBentoNerandBentoOcrsopost_recognizedoes the full encode-transport-decode hop inside one function, andrecognizedelegates torecognize_batchfor single-request dispatch.Test plan
cargo check --workspace --all-featurescargo clippy --workspace --all-features --all-targets(no warnings)cargo test --workspace --all-featuresRUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc --workspace --all-features --no-depscargo deny check🤖 Generated with Claude Code