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

from . import server_pb2 as server__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.CompleteInference = channel.unary_unary(
            "/llm_perf.Inference/CompleteInference",
            request_serializer=server__pb2.InferenceRequest.SerializeToString,
            response_deserializer=server__pb2.InferenceResponse.FromString,
        )
        self.StreamingInference = channel.unary_stream(
            "/llm_perf.Inference/StreamingInference",
            request_serializer=server__pb2.InferenceRequest.SerializeToString,
            response_deserializer=server__pb2.InferenceResponse.FromString,
        )


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

    def CompleteInference(self, request, context):
        """1 request -> 1 response"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def StreamingInference(self, request, context):
        """1 request -> m response"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_InferenceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CompleteInference": grpc.unary_unary_rpc_method_handler(
            servicer.CompleteInference,
            request_deserializer=server__pb2.InferenceRequest.FromString,
            response_serializer=server__pb2.InferenceResponse.SerializeToString,
        ),
        "StreamingInference": grpc.unary_stream_rpc_method_handler(
            servicer.StreamingInference,
            request_deserializer=server__pb2.InferenceRequest.FromString,
            response_serializer=server__pb2.InferenceResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "llm_perf.Inference", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def CompleteInference(
        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,
            "/llm_perf.Inference/CompleteInference",
            server__pb2.InferenceRequest.SerializeToString,
            server__pb2.InferenceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def StreamingInference(
        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_stream(
            request,
            target,
            "/llm_perf.Inference/StreamingInference",
            server__pb2.InferenceRequest.SerializeToString,
            server__pb2.InferenceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
