Skip to content

Commit

Permalink
Merge pull request #58 from ewheeler/retry_aux_act_once
Browse files Browse the repository at this point in the history
also retry aux_act_once upon TypeError
  • Loading branch information
paulosalem authored Nov 28, 2024
2 parents edc65b9 + bd20904 commit 67ba2bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tinytroupe/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ def aux_pre_act():

# Aux function to perform exactly one action.
# Occasionally, the model will return JSON missing important keys, so we just ask it to try again
@repeat_on_error(retries=5, exceptions=[KeyError])
# Sometimes `content` contains EpisodicMemory's MEMORY_BLOCK_OMISSION_INFO message, which raises a TypeError on line 443
@repeat_on_error(retries=5, exceptions=[KeyError, TypeError])
def aux_act_once():
role, content = self._produce_message()

Expand Down

0 comments on commit 67ba2bd

Please sign in to comment.