code: def test_convert_to_object_ref(serve_instance):
      """Test converting deployment handle refs to Ray object refs."""
  
      @ray.remote
      def identity_task(inp: Any):
          return inp
  
      @serve.deployment
      def downstream():
          return "hello"
  
      @serve.deployment
      class Deployment:
          def __init__(self, handle: RayServeHandle):
              self._handle = handle.options(use_new_handle_api=True)
  
          async def __call__(self):
              ref = self._handle.remote()
              return await identity_task.remote(
                  await ref._to_object_ref()
              )
  
      handle = serve.run(Deployment.bind(downstream.bind())).options(
          use_new_handle_api=True
      )
  
      ref = handle.remote()
      assert (
          ray.get(identity_task.remote(ref._to_object_ref_sync()))
          == "hello"
      )
  
file_path: ray/python/ray/serve/tests/test_new_handle_api.py
imports: import sys
  from typing import Any
  import pytest
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor
  from ray.serve.handle import DeploymentHandle, DeploymentResponse, DeploymentResponseGenerator, RayServeHandle, RayServeSyncHandle
label_desc: Use image node_id 6 for calling a global function with example usage: test_convert_to_object_ref(serve_instance) and returns: inp, str, unknown