Skip to content

Commit

Permalink
Prevent IndexError in collect_playbook_responses when not currently i…
Browse files Browse the repository at this point in the history
…n a playbook

Fixes #243
  • Loading branch information
SeanScripts committed Oct 2, 2024
1 parent 3d0337e commit 1ec6ba5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/dfcx_scrapi/core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,14 @@ def collect_playbook_responses(
else:
# If no playbook invocation was found
# return the current Playbook
playbook_responses.append(
{
"playbook_name": self.get_playbook_name(
res.generative_info.current_playbooks[-1]
)
}
)
if len(res.generative_info.current_playbooks) > 0:
playbook_responses.append(
{
"playbook_name": self.get_playbook_name(
res.generative_info.current_playbooks[-1]
)
}
)

return playbook_responses

Expand Down

0 comments on commit 1ec6ba5

Please sign in to comment.