# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from yeying.api.llm import provider_pb2 as yeying_dot_api_dot_llm_dot_provider__pb2

GRPC_GENERATED_VERSION = "1.68.1"
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower

    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f"The grpc package installed is at version {GRPC_VERSION},"
        + f" but the generated code in yeying/api/llm/provider_pb2_grpc.py depends on"
        + f" grpcio>={GRPC_GENERATED_VERSION}."
        + f" Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}"
        + f" or downgrade your generated code using grpcio-tools<={GRPC_VERSION}."
    )


class ProviderStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.Descriptions = channel.unary_unary(
            "/yeying.api.llm.Provider/Descriptions",
            request_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDescriptionsRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDescriptionsResponse.FromString,
            _registered_method=True,
        )
        self.Models = channel.unary_unary(
            "/yeying.api.llm.Provider/Models",
            request_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderModelsRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderModelsResponse.FromString,
            _registered_method=True,
        )
        self.Search = channel.unary_unary(
            "/yeying.api.llm.Provider/Search",
            request_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.SearchProviderRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.SearchProviderResponse.FromString,
            _registered_method=True,
        )
        self.Detail = channel.unary_unary(
            "/yeying.api.llm.Provider/Detail",
            request_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDetailRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDetailResponse.FromString,
            _registered_method=True,
        )
        self.Add = channel.unary_unary(
            "/yeying.api.llm.Provider/Add",
            request_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.AddProviderRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.AddProviderResponse.FromString,
            _registered_method=True,
        )
        self.Delete = channel.unary_unary(
            "/yeying.api.llm.Provider/Delete",
            request_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.DeleteProviderRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.DeleteProviderResponse.FromString,
            _registered_method=True,
        )


class ProviderServicer(object):
    """Missing associated documentation comment in .proto file."""

    def Descriptions(self, request, context):
        """供应商描述列表"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Models(self, request, context):
        """供应商模型"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Search(self, request, context):
        """搜索添加的供应商"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Detail(self, request, context):
        """供应商状态"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Add(self, request, context):
        """添加新供应商配置"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Delete(self, request, context):
        """删除供应商"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_ProviderServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Descriptions": grpc.unary_unary_rpc_method_handler(
            servicer.Descriptions,
            request_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDescriptionsRequest.FromString,
            response_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDescriptionsResponse.SerializeToString,
        ),
        "Models": grpc.unary_unary_rpc_method_handler(
            servicer.Models,
            request_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderModelsRequest.FromString,
            response_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderModelsResponse.SerializeToString,
        ),
        "Search": grpc.unary_unary_rpc_method_handler(
            servicer.Search,
            request_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.SearchProviderRequest.FromString,
            response_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.SearchProviderResponse.SerializeToString,
        ),
        "Detail": grpc.unary_unary_rpc_method_handler(
            servicer.Detail,
            request_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDetailRequest.FromString,
            response_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDetailResponse.SerializeToString,
        ),
        "Add": grpc.unary_unary_rpc_method_handler(
            servicer.Add,
            request_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.AddProviderRequest.FromString,
            response_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.AddProviderResponse.SerializeToString,
        ),
        "Delete": grpc.unary_unary_rpc_method_handler(
            servicer.Delete,
            request_deserializer=yeying_dot_api_dot_llm_dot_provider__pb2.DeleteProviderRequest.FromString,
            response_serializer=yeying_dot_api_dot_llm_dot_provider__pb2.DeleteProviderResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("yeying.api.llm.Provider", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("yeying.api.llm.Provider", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class Provider(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def Descriptions(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/yeying.api.llm.Provider/Descriptions",
            yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDescriptionsRequest.SerializeToString,
            yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDescriptionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Models(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/yeying.api.llm.Provider/Models",
            yeying_dot_api_dot_llm_dot_provider__pb2.ProviderModelsRequest.SerializeToString,
            yeying_dot_api_dot_llm_dot_provider__pb2.ProviderModelsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Search(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/yeying.api.llm.Provider/Search",
            yeying_dot_api_dot_llm_dot_provider__pb2.SearchProviderRequest.SerializeToString,
            yeying_dot_api_dot_llm_dot_provider__pb2.SearchProviderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Detail(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/yeying.api.llm.Provider/Detail",
            yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDetailRequest.SerializeToString,
            yeying_dot_api_dot_llm_dot_provider__pb2.ProviderDetailResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Add(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/yeying.api.llm.Provider/Add",
            yeying_dot_api_dot_llm_dot_provider__pb2.AddProviderRequest.SerializeToString,
            yeying_dot_api_dot_llm_dot_provider__pb2.AddProviderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Delete(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/yeying.api.llm.Provider/Delete",
            yeying_dot_api_dot_llm_dot_provider__pb2.DeleteProviderRequest.SerializeToString,
            yeying_dot_api_dot_llm_dot_provider__pb2.DeleteProviderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
