MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / _is_unsupported_token_param_error

Function _is_unsupported_token_param_error

codewiki/src/be/llm_services.py:215–225  ·  view source on GitHub ↗

Return True if *err* is the OpenAI "unsupported_parameter" error for *param*.

(err: BadRequestError, param: str)

Source from the content-addressed store, hash-verified

213
214
215def _is_unsupported_token_param_error(err: BadRequestError, param: str) -> bool:
216 """Return True if *err* is the OpenAI "unsupported_parameter" error for *param*."""
217 body = getattr(err, "body", None) or {}
218 if isinstance(body, dict):
219 error = body.get("error") or {}
220 if isinstance(error, dict):
221 if error.get("param") == param and error.get("code") == "unsupported_parameter":
222 return True
223 # Fallback: message-based sniff for proxies that don't preserve structure
224 msg = str(err).lower()
225 return "unsupported parameter" in msg and param in msg
226
227
228def _call_llm_via_litellm(

Callers 1

call_llmFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected