Skip to content

Commit

Permalink
raise on last retry
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwe committed Mar 19, 2024
1 parent 64b8351 commit bd1e794
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openduck-py/openduck_py/routers/voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,14 @@ async def start_response(

# NOTE(zach): retries
response = None
for _ in range(3):
for _retry in range(3):
try:
response = await acompletion(
CHAT_MODEL, messages, temperature=0.3, stream=True
)
except Exception:
raise
if _retry == 2:
raise
else:
break
complete_sentence = ""
Expand Down

0 comments on commit bd1e794

Please sign in to comment.