code: def test_promptlab_works_with_completions_route():
      mock_response = {
          "choices": [
              {
                  "text": "test",
                  "metadata": {"finish_reason": "stop"},
              }
          ]
      }
      model = construct_model("completions")
      get_route_patch = mock.patch(
          "mlflow.gateway.get_route",
          return_value=mock.Mock(route_type="llm/v1/completions"),
      )
  
      with get_route_patch, mock.patch(
          "mlflow.gateway.query", return_value=mock_response
      ):
          response = model.predict(
              pd.DataFrame(data=[{"thing": "books"}])
          )
  
          assert response == ["test"]
  
file_path: mlflow/tests/promptlab/test_promptlab_model.py
imports: from unittest import mock
  import pandas
  from mlflow.entities.param import Param
  from mlflow.gateway import set_gateway_uri
  from mlflow.promptlab import _PromptlabModel
label_desc: Use image node_id 4 for calling a global function with example usage: test_promptlab_works_with_completions_route() without return types