fix(llm): keep evaluator-only config out of the request - #488
Merged
Conversation
Evaluator config and provider request parameters share one bag — ``EvaluatorLLMArgs`` is ``extra="allow"``, so both land in ``model_extra`` — and everything in it was forwarded to ``chat.completions.create``. The SDK takes no unknown keyword arguments, so configuring a documented knob such as ``threshold`` (RAG, agent_eval, instruction_quality) or ``strictness`` made every call by that evaluator raise TypeError, which the caller then shapes into an ordinary "evaluation failed" — indistinguishable from a timeout. What may be sent is now decided by the SDK's own ``create()`` signature rather than a list someone has to remember to update. A denylist was tried first and missed two keys on the first pass; the signature travels with the SDK. Keys that are neither request parameters nor registered local knobs are dropped with a warning, so a misspelled key no longer fails silently. ``llm_custom_metric`` forwarded ``model_extra`` directly and so bypassed the filter entirely; it now goes through the same accessor. ``request_timeout`` and ``max_retries`` become configurable per evaluator, the latter reaching the client rather than the request body. Paths that had no timeout before only get one when configured — inventing a default there would fail long calls that work today.
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.
Evaluator config and provider request parameters share one bag —
EvaluatorLLMArgsisextra="allow", so both land inmodel_extra— and everything in it was forwarded tochat.completions.create. The SDK takes no unknown keyword arguments, so configuring a documented knob such asthreshold(RAG, agent_eval, instruction_quality) orstrictnessmade every call by that evaluator raise TypeError, which the caller then shapes into an ordinary "evaluation failed" — indistinguishable from a timeout.What may be sent is now decided by the SDK's own
create()signature rather than a list someone has to remember to update. A denylist was tried first and missed two keys on the first pass; the signature travels with the SDK. Keys that are neither request parameters nor registered local knobs are dropped with a warning, so a misspelled key no longer fails silently.llm_custom_metricforwardedmodel_extradirectly and so bypassed the filter entirely; it now goes through the same accessor.request_timeoutandmax_retriesbecome configurable per evaluator, the latter reaching the client rather than the request body. Paths that had no timeout before only get one when configured — inventing a default there would fail long calls that work today.