You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hardening follow-ups for the GLiNER-family adapters, from the review of #380 and #381. None of them block those PRs.
GLiNER2 caller errors should raise InvalidInputError. Bad metadata.entities on relations, invalid labels or schema, and multi_label misuse currently raise ValueError, which surfaces as a server error. Raise InvalidInputError instead, as GLiREL now does, so these return 400 INVALID_INPUT.
Count GLiNER2's real prompt. Measure the prompt gliner2 actually builds, as the GLiNER path does, instead of estimating it. The estimate over-counts plain field specs, so some valid schemas are rejected, and it can under-count JSON-heavy ones by about 2%.
Validate the prompt before windowing the document in GLiNER2. Today the document is windowed and metered first. That work is already bounded, so this is an efficiency change.
Apply the 128-character label check to the GLiNER bi-encoder. This matches the other GLiNER-family adapters.
GLiNER2 metering covers the window. GLiNER2 meters document tokens up to 512, while the window it reads can hold up to 2048 subwords. Consider metering the window's subwords, as GLiNER does.
Docstring. Update the 50-field schema figure in _prompt_limit.py to about 1,260 tokens.
Hardening follow-ups for the GLiNER-family adapters, from the review of #380 and #381. None of them block those PRs.
InvalidInputError. Badmetadata.entitieson relations, invalid labels or schema, andmulti_labelmisuse currently raiseValueError, which surfaces as a server error. RaiseInvalidInputErrorinstead, as GLiREL now does, so these return 400 INVALID_INPUT._prompt_limit.pyto about 1,260 tokens.