Skip to content

default_grpc_channel_factory

autogen.beta.a2a.transports.grpc.default_grpc_channel_factory #

default_grpc_channel_factory(url)

Insecure grpc.aio.Channel factory; strips grpc(+insecure):// prefix.

Source code in autogen/beta/a2a/transports/grpc.py
def default_grpc_channel_factory(url: str) -> grpc.aio.Channel:
    """Insecure ``grpc.aio.Channel`` factory; strips ``grpc(+insecure)://`` prefix."""
    for prefix in ("grpc+insecure://", "grpc://"):
        if url.startswith(prefix):
            url = url[len(prefix) :]
            break
    return grpc.aio.insecure_channel(url)