Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

refactor(vector_stores): bind the failure mode before matching on it

mateo-berri376f74c058cd
diff --git a/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py b/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py
index 849e87fae40..636e076a229 100644
--- a/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py
+++ b/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py
@@ -161,13 +161,14 @@ class VectorStorePreCallHook(CustomLogger):
litellm_logging_obj.model_call_details[detail] = value
if augmentation.failures:
- match _configured_failure_mode():
+ failure_mode: Final = _configured_failure_mode()
+ match failure_mode:
case "error":
raise VectorStoreSearchError(failures=augmentation.failures, model=model)
case "annotate":
pass
- case unreachable:
- assert_never(unreachable)
+ case _:
+ assert_never(failure_mode)
return model, list(augmentation.messages), non_default_params