This commit is contained in:
Timothy J. Baek
2024-06-08 13:18:42 -07:00
parent 40ea18d54d
commit 3499ec3f79
4 changed files with 14 additions and 9 deletions

View File

@@ -199,6 +199,14 @@ async def speech(request: Request, user=Depends(get_verified_user)):
headers["Authorization"] = f"Bearer {app.state.config.TTS_OPENAI_API_KEY}"
headers["Content-Type"] = "application/json"
try:
body = body.decode("utf-8")
body = json.loads(body)
body["model"] = app.state.config.TTS_MODEL
body = json.dumps(body).encode("utf-8")
except Exception as e:
pass
r = None
try:
r = requests.post(