def test_stream_chat_multiple_messages(vlm_model: str, func: str) -> None:
    """Test streaming chat with multiple messages and images."""
    llm = NVIDIAMultiModal(model=vlm_model)

    messages = [
        ChatMessage(
            role="user",
            content=[
                {"type": "text", "text": "Describe the first image:"},
                {"type": "image_url", "image_url": image_urls[0]},
            ],
        ),
        ChatMessage(
            role="assistant", content="This is a response about the first image."
        ),
        ChatMessage(
            role="user",
            content=[
                {"type": "text", "text": "Now describe this second image:"},
                {"type": "image_url", "image_url": image_urls[1]},
            ],
        ),
    ]

    if func == "chat":
        response = llm.chat(messages)
        assert isinstance(response, ChatResponse)
        assert isinstance(response.delta, str)
    if func == "stream_chat":
        for token in llm.stream_chat(messages):
            assert isinstance(token.delta, str)
Test streaming chat with multiple messages and images.
llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-nvidia/tests/test_multi_modal_nvidia.py