mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix(websearch): use the three-arg getattr to satisfy B009
The pure revert restored `getattr(llm_router, "search_tools")`, whose two-argument constant-attribute form ruff flags as B009, and the strict-rule budget has since ratcheted below what that costs Passing an explicit `None` default keeps behavior identical, the preceding `hasattr` guard already proves the attribute is there, while staying inside the budget
This commit is contained in:
parent
201f60d19c
commit
2814aa54a3
1 changed files with 1 additions and 1 deletions
|
|
@ -1633,7 +1633,7 @@ class WebSearchInterceptionLogger(CustomLogger):
|
|||
def _select_search_tool_from_router(self, llm_router: object) -> "_SearchToolConfig | None":
|
||||
if llm_router is None or not hasattr(llm_router, "search_tools"):
|
||||
return None
|
||||
search_tools: Final = list(getattr(llm_router, "search_tools") or [])
|
||||
search_tools: Final = list(getattr(llm_router, "search_tools", None) or [])
|
||||
return self._select_search_tool_from_list(search_tools=search_tools, source="router")
|
||||
|
||||
def _select_search_tool_from_list(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue