def depends(
    on: Service[T] | None = None,
    *,
    url: str | None = None,
    deployment: str | None = None,
    cluster: str | None = None,
) -> Dependency[T]:
    """Create a dependency on other service or deployment

    Args:
        on: Service[T] | None: The service to depend on.
        url: str | None: The URL of the service to depend on.
        deployment: str | None: The deployment of the service to depend on.
        cluster: str | None: The cluster of the service to depend on.

    Examples:

    .. code-block:: python

        @bentoml.service
        class MyService:
            # depends on a service
            svc_a = bentoml.depends(SVC_A)
            # depends on a deployment
            svc_b = bentoml.depends(deployment="ci-iris")
            # depends on a remote service with url
            svc_c = bentoml.depends(url="http://192.168.1.1:3000")
            # For the latter two cases, the service can be given to provide more accurate types:
            svc_d = bentoml.depends(url="http://192.168.1.1:3000", on=SVC_D)
    """
    if on is not None and not isinstance(on, Service):
        raise TypeError("depends() expects a class decorated with @bentoml.service()")
    return Dependency(on, url=url, deployment=deployment, cluster=cluster)
Create a dependency on other service or deployment

Args:
on: Service[T] | None: The service to depend on.
url: str | None: The URL of the service to depend on.
deployment: str | None: The deployment of the service to depend on.
cluster: str | None: The cluster of the service to depend on.

Examples:

.. code-block:: python

@bentoml.service
class MyService:
# depends on a service
svc_a = bentoml.depends(SVC_A)
# depends on a deployment
svc_b = bentoml.depends(deployment="ci-iris")
# depends on a remote service with url
svc_c = bentoml.depends(url="http://192.168.1.1:3000")
# For the latter two cases, the service can be given to provide more accurate types:
svc_d = bentoml.depends(url="http://192.168.1.1:3000", on=SVC_D)
src/_bentoml_sdk/service/dependency.py