mirror of
https://github.com/Shubhamsaboo/awesome-llm-apps.git
synced 2026-07-17 17:05:58 -05:00
[PR #931] fix: guard against empty choices and None message in memory tutorial apps #14871
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Shubhamsaboo/awesome-llm-apps/pull/931
Author: @SHAI-manpreet-likhari
Created: 7/6/2026
Status: 🔄 Open
Base:
main← Head:fix/guard-empty-openai-response-memory-tutorials📝 Commits (1)
1231337fix: guard against empty choices and None message in memory tutorial apps📊 Changes
4 files changed (+11 additions, -1 deletions)
View changed files
📝
advanced_llm_apps/llm_apps_with_memory_tutorials/ai_arxiv_agent_memory/ai_arxiv_agent_memory.py(+2 -0)📝
advanced_llm_apps/llm_apps_with_memory_tutorials/ai_travel_agent_memory/travel_agent_memory.py(+2 -0)📝
advanced_llm_apps/llm_apps_with_memory_tutorials/llm_app_personalized_memory/llm_app_memory.py(+3 -1)📝
advanced_llm_apps/llm_apps_with_memory_tutorials/multi_llm_memory/multi_llm_memory.py(+4 -0)📄 Description
Summary
advanced_llm_apps/llm_apps_with_memory_tutorials/accessedresponse.choices[0].message.contentwithout checking thatchoicesis non-empty or thatcontentis notNone.IndexErrorwhen the API returns an emptychoiceslist (content filter, quota exceeded, or transient error), or silently passNoneinto downstream memory/UI code.Files changed
ai_arxiv_agent_memory/ai_arxiv_agent_memory.pyai_travel_agent_memory/travel_agent_memory.pyllm_app_personalized_memory/llm_app_memory.pymulti_llm_memory/multi_llm_memory.py(both the OpenAI and Claude branches)Test plan
python -m py_compilepasses on all 4 modified files🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.