You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ch06): guard against IndexError on empty LLM choices list
Nine example scripts in chapter 06 access choices[0] without checking
whether the API returned any choices. Content-policy filters, token
limits, and non-standard responses can all return choices=[].
- aoai-app.py, aoai-history-bot.py, aoai-study-buddy.py: wrap print in `if completion.choices`
- oai-app.py, oai-history-bot.py, oai-study-buddy.py: same
- githubmodels-app.py: wrap print in `if response.choices`
- aoai-app-recipe.py, oai-app-recipe.py: guard both choices accesses and
skip the dependent shopping-list call when first response is empty
0 commit comments