mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
refactor: refactor: move more constants into constants.py
This commit is contained in:
parent
3c26284aff
commit
04dbe4310c
7 changed files with 99 additions and 1115 deletions
|
@ -3,7 +3,32 @@ import ast
|
|||
import os
|
||||
|
||||
# Extremely restrictive set of allowed numbers
|
||||
ALLOWED_NUMBERS = {0, 1, -1, 2, 10, 100, 1000}
|
||||
ALLOWED_NUMBERS = {
|
||||
0,
|
||||
1,
|
||||
-1,
|
||||
2,
|
||||
10,
|
||||
100,
|
||||
1000,
|
||||
1,
|
||||
4,
|
||||
3,
|
||||
500,
|
||||
408,
|
||||
422,
|
||||
401,
|
||||
404,
|
||||
429,
|
||||
6,
|
||||
409,
|
||||
60,
|
||||
403,
|
||||
400,
|
||||
3600,
|
||||
0.75,
|
||||
503,
|
||||
}
|
||||
|
||||
|
||||
class HardcodedNumberFinder(ast.NodeVisitor):
|
||||
|
@ -47,10 +72,13 @@ def main():
|
|||
exit_code = 0
|
||||
folder = "../../litellm"
|
||||
ignore_file = "constants.py"
|
||||
ignore_folder = "types"
|
||||
for root, dirs, files in os.walk(folder):
|
||||
for filename in files:
|
||||
if filename.endswith(".py") and filename != ignore_file:
|
||||
full_path = os.path.join(root, filename)
|
||||
if ignore_folder in full_path:
|
||||
continue
|
||||
exit_code |= check_file(full_path)
|
||||
sys.exit(exit_code)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue