class_docstr: Class (or function) decorated with the `@serve.deployment` decorator.
  
  This is run on a number of replica actors. Requests to those replicas call
  this class.
  
  One or more deployments can be composed together into an `Application` which is
  then run via `serve.run` or a config file.
  
  Example:
  
  .. code-block:: python
  
      @serve.deployment
      class MyDeployment:
          def __init__(self, name: str):
              self._name = name
  
          def __call__(self, request):
              return "Hello world!"
  
          app = MyDeployment.bind()
          # Run via `serve.run` or the `serve run` CLI command.
          serve.run(app)
docstr: Return a copy of this deployment with updated options.
  
  Only those options passed in will be updated, all others will remain
  unchanged from the existing deployment.
  
  Refer to the `@serve.deployment` decorator docs for available arguments.
docstr_tok: ["Return","a","copy","of","this","deployment","with","updated","options",".","Only","those","options","passed","in","will","be","updated",",","all","others","will","remain","unchanged","from","the","existing","deployment",".","Refer","to","the","`","@","serve.deployment","`","decorator","docs","for","available","arguments","."]
code: def options(
      self,
      func_or_class: Optional[Callable] = None,
      name: Default[str] = DEFAULT.VALUE,
      version: Default[str] = DEFAULT.VALUE,
      num_replicas: Default[Optional[int]] = DEFAULT.VALUE,
      route_prefix: Default[Union[str, None]] = DEFAULT.VALUE,
      ray_actor_options: Default[Optional[Dict]] = DEFAULT.VALUE,
      placement_group_bundles: Optional[
          List[Dict[str, float]]
      ] = DEFAULT.VALUE,
      placement_group_strategy: Optional[str] = DEFAULT.VALUE,
      max_replicas_per_node: Optional[int] = DEFAULT.VALUE,
      user_config: Default[Optional[Any]] = DEFAULT.VALUE,
      max_concurrent_queries: Default[int] = DEFAULT.VALUE,
      autoscaling_config: Default[
          Union[Dict, AutoscalingConfig, None]
      ] = DEFAULT.VALUE,
      graceful_shutdown_wait_loop_s: Default[float] = DEFAULT.VALUE,
      graceful_shutdown_timeout_s: Default[float] = DEFAULT.VALUE,
      health_check_period_s: Default[float] = DEFAULT.VALUE,
      health_check_timeout_s: Default[float] = DEFAULT.VALUE,
      logging_config: Default[
          Union[Dict, LoggingConfig, None]
      ] = DEFAULT.VALUE,
      _init_args: Default[Tuple[Any]] = DEFAULT.VALUE,
      _init_kwargs: Default[Dict[Any, Any]] = DEFAULT.VALUE,
      _internal: bool = False,
  ) -> "Deployment":
      """Return a copy of this deployment with updated options.
  
      Only those options passed in will be updated, all others will remain
      unchanged from the existing deployment.
  
      Refer to the `@serve.deployment` decorator docs for available arguments.
      """
  
      # NOTE: The user_configured_option_names should be the first thing that's
      # defined in this method. It depends on the locals() dictionary storing
      # only the function args/kwargs.
      # Create list of all user-configured options from keyword args
      user_configured_option_names = [
          option
          for option, value in locals().items()
          if option not in {"self", "func_or_class", "_internal"}
          and value is not DEFAULT.VALUE
      ]
  
      new_deployment_config = deepcopy(self._deployment_config)
      if not _internal:
          new_deployment_config.user_configured_option_names.update(
              user_configured_option_names
          )
  
      if num_replicas not in [
          DEFAULT.VALUE,
          None,
      ] and autoscaling_config not in [
          DEFAULT.VALUE,
          None,
      ]:
          raise ValueError(
              "Manually setting num_replicas is not allowed when "
              "autoscaling_config is provided."
          )
  
      if num_replicas == 0:
          raise ValueError("num_replicas is expected to larger than 0")
  
      if not _internal and version is not DEFAULT.VALUE:
          logger.warning(
              "DeprecationWarning: `version` in `Deployment.options()` has been "
              "deprecated. Explicitly specifying version will raise an error in the "
              "future!"
          )
  
      if not _internal and route_prefix is not DEFAULT.VALUE:
          logger.warning(
              "DeprecationWarning: `route_prefix` in `@serve.deployment` has been "
              "deprecated. To specify a route prefix for an application, pass it "
              "into `serve.run` instead."
          )
  
      if num_replicas not in [DEFAULT.VALUE, None]:
          new_deployment_config.num_replicas = num_replicas
      if user_config is not DEFAULT.VALUE:
          new_deployment_config.user_config = user_config
      if max_concurrent_queries is not DEFAULT.VALUE:
          new_deployment_config.max_concurrent_queries = (
              max_concurrent_queries
          )
  
      if func_or_class is None:
          func_or_class = self._replica_config.deployment_def
  
      if name is DEFAULT.VALUE:
          name = self._name
  
      if version is DEFAULT.VALUE:
          version = self._version
  
      if _init_args is DEFAULT.VALUE:
          _init_args = self._replica_config.init_args
  
      if _init_kwargs is DEFAULT.VALUE:
          _init_kwargs = self._replica_config.init_kwargs
  
      if route_prefix is DEFAULT.VALUE:
          # Default is to keep the previous value
          route_prefix = self._route_prefix
  
      if ray_actor_options is DEFAULT.VALUE:
          ray_actor_options = self._replica_config.ray_actor_options
  
      if placement_group_bundles is DEFAULT.VALUE:
          placement_group_bundles = (
              self._replica_config.placement_group_bundles
          )
  
      if placement_group_strategy is DEFAULT.VALUE:
          placement_group_strategy = (
              self._replica_config.placement_group_strategy
          )
  
      if max_replicas_per_node is DEFAULT.VALUE:
          max_replicas_per_node = (
              self._replica_config.max_replicas_per_node
          )
  
      if autoscaling_config is not DEFAULT.VALUE:
          new_deployment_config.autoscaling_config = autoscaling_config
  
      if graceful_shutdown_wait_loop_s is not DEFAULT.VALUE:
          new_deployment_config.graceful_shutdown_wait_loop_s = (
              graceful_shutdown_wait_loop_s
          )
  
      if graceful_shutdown_timeout_s is not DEFAULT.VALUE:
          new_deployment_config.graceful_shutdown_timeout_s = (
              graceful_shutdown_timeout_s
          )
  
      if health_check_period_s is not DEFAULT.VALUE:
          new_deployment_config.health_check_period_s = (
              health_check_period_s
          )
  
      if health_check_timeout_s is not DEFAULT.VALUE:
          new_deployment_config.health_check_timeout_s = (
              health_check_timeout_s
          )
  
      if logging_config is not DEFAULT.VALUE:
          if isinstance(logging_config, LoggingConfig):
              logging_config = logging_config.dict()
          new_deployment_config.logging_config = logging_config
  
      new_replica_config = ReplicaConfig.create(
          func_or_class,
          init_args=_init_args,
          init_kwargs=_init_kwargs,
          ray_actor_options=ray_actor_options,
          placement_group_bundles=placement_group_bundles,
          placement_group_strategy=placement_group_strategy,
          max_replicas_per_node=max_replicas_per_node,
      )
  
      return Deployment(
          name,
          new_deployment_config,
          new_replica_config,
          version=version,
          route_prefix=route_prefix,
          _internal=True,
      )
  
imports: import inspect
  import logging
  import warnings
  from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from ray.dag.class_node import ClassNode
  from ray.dag.dag_node import DAGNodeBase
  from ray.dag.function_node import FunctionNode
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.constants import SERVE_LOGGER_NAME
  from ray.serve._private.utils import DEFAULT, Default
  from ray.serve.config import AutoscalingConfig
  from ray.serve.context import _get_global_client
  from ray.serve.handle import RayServeHandle, RayServeSyncHandle
  from ray.serve.schema import DeploymentSchema, LoggingConfig, RayActorOptionsSchema
  from ray.util.annotations import Deprecated, PublicAPI
label_desc: Use image node_id 23 for calling the Deployment obj's underlying member method code with example usage: obj.options(func_or_class, name, version, num_replicas, route_prefix, ray_actor_options, placement_group_bundles, placement_group_strategy, max_replicas_per_node, user_config, max_concurrent_queries, autoscaling_config, graceful_shutdown_wait_loop_s, graceful_shutdown_timeout_s, health_check_period_s, health_check_timeout_s, logging_config, _init_args, _init_kwargs, _internal) and returns: Deployment