mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
refactor: clean up fresh tech debt in router context signatures, search tool comment and gemini realtime init
Some checks failed
Cost map pins recheck / rerun-cost-map-guard (push) Waiting to run
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
LiteLLM Rust / rust-wheel (push) Waiting to run
LiteLLM Rust DB / db-queries (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
Some checks failed
Cost map pins recheck / rerun-cost-map-guard (push) Waiting to run
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
LiteLLM Rust / rust-wheel (push) Waiting to run
LiteLLM Rust DB / db-queries (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
82d8e10f5a
commit
70122390a7
4 changed files with 5 additions and 6 deletions
|
|
@ -218,7 +218,7 @@ def _system_instruction_text(system_instruction: HttpxContentType | None) -> str
|
|||
class GeminiRealtimeConfig(BaseRealtimeConfig):
|
||||
_TOOL_CALL_ID_TO_NAME_MAX = 256 # LRU cap for call_id→name mapping
|
||||
|
||||
def __init__(self, drop_params: bool = False):
|
||||
def __init__(self, drop_params: bool = False) -> None:
|
||||
super().__init__()
|
||||
self.drop_params = drop_params
|
||||
self._tool_call_id_to_name: OrderedDict[str, str] = OrderedDict()
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class CustomDenseEncoder(DenseEncoder):
|
|||
litellm_router_instance: ClassVar = RenamedRouterAttribute() # deprecated: the router attribute before ``ctx``
|
||||
|
||||
@renamed_router_param("litellm_router_instance")
|
||||
def __init__(self, ctx: Optional["RoutingContext"] = None, **kwargs):
|
||||
def __init__(self, ctx: Optional["RoutingContext"] = None, **kwargs) -> None:
|
||||
if "ctx" in kwargs:
|
||||
ctx = kwargs.pop("ctx")
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ class LiteLLMRouterEncoder(CustomDenseEncoder, AsymmetricDenseMixin):
|
|||
model_name: str,
|
||||
score_threshold: float | None = None,
|
||||
max_input_chars: int = 0,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the LiteLLMEncoder.
|
||||
|
||||
:param ctx: The routing context of the owning router.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class MaxParallelRequestsLimit:
|
|||
class InitalizeCachedClient:
|
||||
@staticmethod
|
||||
@renamed_router_param("litellm_router_instance")
|
||||
def set_max_parallel_requests_client(ctx: "RoutingContext", model: dict):
|
||||
def set_max_parallel_requests_client(ctx: "RoutingContext", model: dict) -> None:
|
||||
litellm_params: Final = model.get("litellm_params", {})
|
||||
model_id: Final = model["model_info"]["id"]
|
||||
rpm: Final = litellm_params.get("rpm", None)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class SearchAPIRouter:
|
|||
|
||||
@staticmethod
|
||||
@renamed_router_param("router_instance")
|
||||
async def update_router_search_tools(ctx: "RoutingContext", search_tools: list):
|
||||
async def update_router_search_tools(ctx: "RoutingContext", search_tools: list) -> None:
|
||||
"""
|
||||
Update the router with search tools from the database.
|
||||
|
||||
|
|
@ -143,7 +143,6 @@ class SearchAPIRouter:
|
|||
# Set up kwargs for the fallback system
|
||||
kwargs["model"] = search_tool_name # Use model field for compatibility with fallback system
|
||||
kwargs["original_generic_function"] = original_function
|
||||
# Bind ctx to the helper method using partial
|
||||
kwargs["original_function"] = partial(
|
||||
SearchAPIRouter.async_search_with_fallbacks_helper,
|
||||
litellm_routing_ctx=ctx,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue