Revert "Get optional params behavior" - #23234
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR reverts #23224, which had fixed a known bug where optional parameters like Key Concerns:
Confidence Score: 1/5
Last reviewed commit: 504e66c |
| optional_params = get_optional_params( | ||
| **optional_param_args, **non_default_params | ||
| ) |
There was a problem hiding this comment.
This revert re-introduces the silent parameter-dropping bug originally reported in #23087.
The removed safety-net loop forwarded kwargs present in DEFAULT_CHAT_COMPLETION_PARAM_VALUES (such as store, metadata, context_management, prompt_cache_key, prompt_cache_retention) into optional_param_args before calling get_optional_params().
Without it, these parameters are silently dropped because:
- They are not named parameters of
completion(), so they arrive only via**kwargs get_non_default_completion_params()explicitly excludes any key inDEFAULT_CHAT_COMPLETION_PARAM_VALUESfromnon_default_paramsoptional_param_argsonly includes explicitly named parametersoptional_params(which is passed to the provider) is built from onlyoptional_param_argsandnon_default_params
Result: callers passing store=True, metadata={...}, etc. will have their values silently ignored, regardless of the provider.
…-optional-params-behavior-ed4a Revert "Get optional params behavior"
Reverts #23224