Skip to content

Commit

Permalink
forgot return in retry multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultLSDC committed Dec 3, 2024
1 parent da8208f commit e124fea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/agentlab/llm/llm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ def retry_multiple(
parsed_answers.append(parser(answer["content"]))
except ParseError as parsing_error:
errors.append(str(parsing_error))
# if we have a valid answer, return it
if parsed_answers:
return parsed_answers, tries
else:
tries += 1
if log:
msg = f"Query failed. Retrying {tries}/{n_retry}.\n[LLM]:\n{answer['content']}\n[User]:\n{str(errors)}"
Expand Down

0 comments on commit e124fea

Please sign in to comment.