Skip to content

Commit

Permalink
Merge pull request #1279 from UKGovernmentBEIS/craig/choices-0
Browse files Browse the repository at this point in the history
Do not assume that `result.choices` will contain elements
  • Loading branch information
craigwalton-dsit authored Feb 10, 2025
2 parents 1c16511 + 5506a00 commit b2afbb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/inspect_ai/model/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ def complete(
) -> None:
# trace
if isinstance(result, ModelOutput):
conversation_assistant_message(input, result.choices[0].message)
if result.choices:
conversation_assistant_message(input, result.choices[0].message)
event.output = result
else:
conversation_assistant_error(result)
Expand Down

0 comments on commit b2afbb4

Please sign in to comment.