fix(openai-api): KeyError when response_format or speed omitted

This commit is contained in:
GenericMale committed 2024-09-13 19:09:07 +02:00
1 parent 7f98ef3905
commit cf3635ea48
1 file changed
+2 -2
+2 -2
View File
@@ -741,8 +741,8 @@ async def openai_tts_generate(request: Request):
model = json_data["model"] # Currently ignored model = json_data["model"] # Currently ignored
input_text = json_data["input"] input_text = json_data["input"]
voice = json_data["voice"] voice = json_data["voice"]
response_format = json_data["response_format"].lower() response_format = json_data.get("response_format", "wav").lower()
speed = json_data["speed"] speed = json_data.get("speed", 1.0)
print(f"[{branding}Debug] Input text: {input_text}") if debug_openai else None print(f"[{branding}Debug] Input text: {input_text}") if debug_openai else None
print(f"[{branding}Debug] Voice: {voice}") if debug_openai else None print(f"[{branding}Debug] Voice: {voice}") if debug_openai else None
print(f"[{branding}Debug] Speed: {speed}") if debug_openai else None print(f"[{branding}Debug] Speed: {speed}") if debug_openai else None