def test_astream_chat_completion(test_params: dict, loop: asyncio.AbstractEventLoop):
    """Tests the basic chat completion functionality with streaming."""
    model_name = os.environ.get("AZURE_INFERENCE_MODEL", None)

    llm = AzureAICompletionsModel(model_name=model_name)

    async def iterate():
        stream = await llm.astream_chat(**test_params)
        buffer = ""
        async for chunk in stream:
            buffer += chunk.delta

        return buffer

    response = loop.run_until_complete(iterate())
    assert response.strip() == "Yes, this is a test."
Tests the basic chat completion functionality with streaming.
llama-index-integrations/llms/llama-index-llms-azure-inference/tests/test_llms_azure_inference.py