ERROR:root:Exception while generating response stream: 'NoneType' object has no attribute 'get'
Hello,
I am using the 2025-09-11 release of the Azure Search OpenAI Demo project:
Azure Search OpenAI Demo - Release 2025-09-11
My deployment is configured to use GPT-4.1-mini. The application was working normally earlier today, but I suddenly started encountering an issue during streaming responses. After a short period of streaming, the application fails with the following error:
Error: The app encountered an error processing your request. If you are an administrator of the app, check the application logs for a full traceback. Error type: <class 'AttributeError'>While investigating with Claude code suggested me following from backend\approaches\chatreadretrieveread.py :
if event["choices"]:
# No usage during streaming
completion = {
"delta": {
"content": event["choices"][0]["delta"].get("content"),
"role": event["choices"][0]["delta"]["role"],
}
}This made me wonder whether the structure of the streaming chunks returned by Azure OpenAI has changed. For example, is it possible that some streaming events now contain an empty or missing delta, causing the code to fail? Has anyone else experienced AttributeError exceptions during streaming that started appearing without any application code changes?
Source: Azure-Samples/azure-search-openai-demo