def test_chat_completion_with_filter_results(sync_azure_openai_mock: MagicMock) -> None:
    """
    Tests that synchronous chat completions work correctly if first chunk contains prompt
    filter results (empty `choices` list).
    """
    mock_instance = MagicMock(spec=SyncAzureOpenAI)
    sync_azure_openai_mock.return_value = mock_instance

    chat_mock = MagicMock()
    chat_mock.completions.create.return_value = (
        mock_chat_completion_stream_with_filter_results()
    )
    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 = llm.stream_complete(prompt)
    responses = list(response_gen)
    assert responses[-1].text == "Hello from\nAzure"

    mock_instance.chat.completions.create.return_value = (
        mock_chat_completion_stream_with_filter_results()
    )
    chat_response_gen = llm.stream_chat([message])
    chat_responses = list(chat_response_gen)
    assert chat_responses[-1].message.content == "Hello from\nAzure"
    assert chat_responses[-1].message.role == "assistant"

    Tests that synchronous 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