Skip to content

Commit

Permalink
Fix retry_multiple function to handle single and multiple answers cor…
Browse files Browse the repository at this point in the history
…rectly
  • Loading branch information
recursix committed Dec 4, 2024
1 parent 64ddeb9 commit a557699
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/agentlab/llm/llm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ def retry_multiple(
"""
tries = 0
while tries < n_retry:
answer_list = chat(messages, num_samples=num_samples)
answer_list = chat(messages, n_samples=num_samples)
# TODO: could we change this to not use inplace modifications ?
messages.append(answer)
if not isinstance(answer_list, list):
answer_list = [answer_list]

# TODO taking the 1st hides the other generated answers in AgentXRay
messages.append(answer_list[0])
parsed_answers = []
errors = []
for answer in answer_list:
Expand Down

0 comments on commit a557699

Please sign in to comment.