Repository: jina-ai/jina
File: jina/orchestrate/flow/base.py (Python)

Code before:

        EXAMPLE USAGE

            Python API

            .. code-block:: python

                from jina import Flow

                f = Flow().add(uses='jinahub+docker://SimpleIndexer')  # create Flow and add Executor
                with f:
                    f.bock()  # serve Flow

            To and from YAML configuration

            .. code-block:: python

                from jina import Flow

                f = Flow().add(uses='jinahub+docker://SimpleIndexer')  # create Flow and add Executor
                f.save_config('flow.yml')  # save YAML config file
                f = Flow.load_config('flow.yml')  # load Flow from YAML config
                with f:
                    f.bock()  # serve Flow
            
        All arguments received by `Flow()` API will be propagated to other entities (Gateway, Executor) with the following exceptions:
        
        - `uses` and `uses_with` won't be passed to Gateway
        - `port`, `port_monitoring`, `uses` and `uses_with` won't be passed to Executor

        :param asyncio: If set, then the input and output of this Client work in an asynchronous manner.
        :param host: The host of the Gateway, which the client should connect to, by default it is 0.0.0.0.
        :param metrics: If set, the sdk implementation of the OpenTelemetry metrics will be available for default monitoring and custom measurements. Otherwise a no-op implementation will be provided.
        :param metrics_exporter_host: If tracing is enabled, this hostname will be used to configure the metrics exporter agent.
        :param metrics_exporter_port: If tracing is enabled, this port will be used to configure the metrics exporter agent.
        :param port: The port of the Gateway, which the client should connect to.
        :param prefetch: Number of requests fetched from the client before feeding into the first Executor. 
              
              Used to control the speed of data input into a Flow. 0 disables prefetch (1000 requests is the default)
        :param protocol: Communication protocol between server and client.
        :param proxy: If set, respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems to prefer no proxy
        :param tls: If set, connect to gateway using tls encryption
        :param traces_exporter_host: If tracing is enabled, this hostname will be used to configure the trace exporter agent.
        :param traces_exporter_port: If tracing is enabled, this port will be used to configure the trace exporter agent.
        :param tracing: If set, the sdk implementation of the OpenTelemetry tracer will be available and will be enabled for automatic tracing of requests and customer span creation. Otherwise a no-op implementation will be provided.
        :param compression: The compression mechanism used when sending requests from the Head to the WorkerRuntimes. For more details, check https://grpc.github.io/grpc/python/grpc.html#compression.
        :param cors: If set, a CORS middleware is added to FastAPI frontend to allow cross-origin access.
        :param deployments_addresses: JSON dictionary with the input addresses of each Deployment
        :param deployments_metadata: JSON dictionary with the request metadata for each Deployment
        :param deployments_no_reduce: list JSON disabling the built-in merging mechanism for each Deployment listed
        :param description: The description of this HTTP server. It will be used in automatics docs such as Swagger UI.

Review comment (suggestion):
```suggestion
        All arguments received by {class}`~jina.Flow()` API will be propagated to other entities (Gateway, Executor) with the following exceptions:
```

Code after:

        EXAMPLE USAGE

            Python API

            .. code-block:: python

                from jina import Flow

                f = Flow().add(uses='jinahub+docker://SimpleIndexer')  # create Flow and add Executor
                with f:
                    f.bock()  # serve Flow

            To and from YAML configuration

            .. code-block:: python

                from jina import Flow

                f = Flow().add(uses='jinahub+docker://SimpleIndexer')  # create Flow and add Executor
                f.save_config('flow.yml')  # save YAML config file
                f = Flow.load_config('flow.yml')  # load Flow from YAML config
                with f:
                    f.bock()  # serve Flow
            
        All arguments received by {class}`~jina.Flow()` API will be propagated to other entities (Gateway, Executor) with the following exceptions:

        - `uses` and `uses_with` won't be passed to Gateway
        - `port`, `port_monitoring`, `uses` and `uses_with` won't be passed to Executor

        :param asyncio: If set, then the input and output of this Client work in an asynchronous manner.
        :param host: The host of the Gateway, which the client should connect to, by default it is 0.0.0.0.
        :param metrics: If set, the sdk implementation of the OpenTelemetry metrics will be available for default monitoring and custom measurements. Otherwise a no-op implementation will be provided.
        :param metrics_exporter_host: If tracing is enabled, this hostname will be used to configure the metrics exporter agent.
        :param metrics_exporter_port: If tracing is enabled, this port will be used to configure the metrics exporter agent.
        :param port: The port of the Gateway, which the client should connect to.
        :param prefetch: Number of requests fetched from the client before feeding into the first Executor. 
              
              Used to control the speed of data input into a Flow. 0 disables prefetch (1000 requests is the default)
        :param protocol: Communication protocol between server and client.
        :param proxy: If set, respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems to prefer no proxy
        :param tls: If set, connect to gateway using tls encryption
        :param traces_exporter_host: If tracing is enabled, this hostname will be used to configure the trace exporter agent.
        :param traces_exporter_port: If tracing is enabled, this port will be used to configure the trace exporter agent.
        :param tracing: If set, the sdk implementation of the OpenTelemetry tracer will be available and will be enabled for automatic tracing of requests and customer span creation. Otherwise a no-op implementation will be provided.
        :param compression: The compression mechanism used when sending requests from the Head to the WorkerRuntimes. For more details, check https://grpc.github.io/grpc/python/grpc.html#compression.
        :param cors: If set, a CORS middleware is added to FastAPI frontend to allow cross-origin access.
        :param deployments_addresses: JSON dictionary with the input addresses of each Deployment
        :param deployments_metadata: JSON dictionary with the request metadata for each Deployment
        :param deployments_no_reduce: list JSON disabling the built-in merging mechanism for each Deployment listed
        :param description: The description of this HTTP server. It will be used in automatics docs such as Swagger UI.