fix keyerror

This commit is contained in:
Cyberes 2023-10-01 22:37:13 -06:00
parent 51881ae39d
commit a594729d00
1 changed files with 2 additions and 2 deletions

View File

@ -37,9 +37,9 @@ def format_oai_err(err_msg):
def validate_oai(parameters): def validate_oai(parameters):
if parameters['temperature'] > 2: if parameters.get('temperature', 0) > 2:
return format_oai_err(f"{parameters['temperature']} is greater than the maximum of 2 - 'temperature'") return format_oai_err(f"{parameters['temperature']} is greater than the maximum of 2 - 'temperature'")
if parameters['temperature'] < 0: if parameters.get('temperature', 0) < 0:
return format_oai_err(f"{parameters['temperature']} less than the minimum of 0 - 'temperature'") return format_oai_err(f"{parameters['temperature']} less than the minimum of 0 - 'temperature'")
if parameters.get('top_p', 1) > 2: if parameters.get('top_p', 1) > 2: