Lint the openai extension
This commit is contained in:
parent
760510db52
commit
8f97e87cac
12 changed files with 79 additions and 69 deletions
|
@ -51,9 +51,11 @@ def get_default_req_params():
|
|||
return copy.deepcopy(default_req_params)
|
||||
|
||||
# little helper to get defaults if arg is present but None and should be the same type as default.
|
||||
|
||||
|
||||
def default(dic, key, default):
|
||||
val = dic.get(key, default)
|
||||
if type(val) != type(default):
|
||||
if not isinstance(val, type(default)):
|
||||
# maybe it's just something like 1 instead of 1.0
|
||||
try:
|
||||
v = type(default)(val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue