mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(azure-ocr): reject mixed bool+int in pages list validation
Use any() instead of all() for bool check so lists like [True, 1, 2] raise ValueError; bool is a subclass of int so all(int) alone was insufficient. Made-with: Cursor
This commit is contained in:
parent
b6d5728134
commit
089ca5fc0f
1 changed files with 1 additions and 1 deletions
|
|
@ -113,7 +113,7 @@ class AzureDocumentIntelligenceOCRConfig(BaseOCRConfig):
|
|||
if isinstance(pages, list):
|
||||
if len(pages) == 0:
|
||||
return ""
|
||||
if all(isinstance(p, bool) for p in pages):
|
||||
if any(isinstance(p, bool) for p in pages):
|
||||
raise ValueError("`pages` must be integers, not booleans")
|
||||
if all(isinstance(p, int) for p in pages):
|
||||
if any(p < 0 for p in pages):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue