async def test_async_chat_completion_with_filter_results(
    async_azure_openai_mock: MagicMock,
) -> None:
    """
    Tests that asynchronous chat completions work correctly if first chunk contains prompt
    filter results (empty `choices` list).
    """
    mock_instance = MagicMock(spec=AsyncAzureOpenAI)
    async_azure_openai_mock.return_value = mock_instance
    create_fn = AsyncMock()
    create_fn.side_effect = mock_async_chat_completion_stream_with_filter_results
    chat_mock = MagicMock()
    chat_mock.completions.create = create_fn
    mock_instance.chat = chat_mock

    llm = AzureOpenAI(engine="foo bar", api_key="mock")
    prompt = "test prompt"
    message = ChatMessage(role="user", content="test message")

    response_gen = await llm.astream_complete(prompt)
    responses = [item async for item in response_gen]
    assert responses[-1].text == "Hello from\nAzure"

    chat_response_gen = await llm.astream_chat([message])
    chat_responses = [item async for item in chat_response_gen]
    assert chat_responses[-1].message.content == "Hello from\nAzure"

    Tests that asynchronous chat completions work correctly if first chunk contains prompt
    filter results (empty `choices` list).
    
llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_azure_openai.py