def test_chat_completion_gpt4o_api_version(test_params: dict):
    """Test chat completions endpoint with api_version indicated for a GPT model."""
    # In case the endpoint being tested serves more than one model
    model_name = os.environ.get("AZURE_INFERENCE_MODEL", "gpt-4o")

    llm = AzureAICompletionsModel(
        model_name=model_name, api_version="2024-05-01-preview"
    )

    response = llm.chat(**test_params)

    assert response.message.role == MessageRole.ASSISTANT
    assert response.message.content.strip() == "Yes, this is a test."
Test chat completions endpoint with api_version indicated for a GPT model.
llama-index-integrations/llms/llama-index-llms-azure-inference/tests/test_llms_azure_inference.py