class_docstr: Represents the predictions and metadata returned in response to a scoring request, such as a
  REST API request sent to the ``/invocations`` endpoint of an MLflow Model Server.
class_docstr_tok: ["Represents","the","predictions","and","metadata","returned","in","response","to","a","scoring","request",",","such","as","a","REST","API","request","sent","to","the","``","\/invocations","``","endpoint","of","an","MLflow","Model","Server","."]
docstr: Get the JSON representation of the MLflow Predictions Response.
  
  Args:
      path: If specified, the JSON representation is written to this file path.
  
  Returns:
      If ``path`` is unspecified, the JSON representation of the MLflow Predictions
      Response. Else, None.
docstr_tok: ["Get","the","JSON","representation","of","the","MLflow","Predictions","Response",".","Args",":","path",":","If","specified",",","the","JSON","representation","is","written","to","this","file","path",".","Returns",":","If","``","path","``","is","unspecified",",","the","JSON","representation","of","the","MLflow","Predictions","Response",".","Else",",","None","."]
code: def to_json(self, path=None):
      """Get the JSON representation of the MLflow Predictions Response.
  
      Args:
          path: If specified, the JSON representation is written to this file path.
  
      Returns:
          If ``path`` is unspecified, the JSON representation of the MLflow Predictions
          Response. Else, None.
  
      """
      if path is not None:
          with open(path, "w") as f:
              json.dump(dict(self), f)
      else:
          return json.dumps(dict(self))
  
file_path: mlflow/mlflow/deployments/__init__.py
imports: import contextlib
  import json
  from mlflow.deployments.base import BaseDeploymentClient
  from mlflow.deployments.databricks import DatabricksDeploymentClient, DatabricksEndpoint
  from mlflow.deployments.interface import get_deploy_client, run_local
  from mlflow.deployments.openai import OpenAIDeploymentClient
  from mlflow.deployments.utils import get_deployments_target, set_deployments_target
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
label_desc: Use image node_id 2 for calling the PredictionsResponse obj's underlying member method code with example usage: obj.to_json(path) and returns: json