mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
refactor(vector_stores): bind the failure mode before matching on it
basedpyright counts a named capture after an exhaustive match under reportUnnecessaryComparison, which pushed the merged tree one over the budget; the wildcard case with assert_never on the bound subject is the shape the rest of the codebase uses
This commit is contained in:
parent
a28d1e836c
commit
376f74c058
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue