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

from spounge.llm.v2 import llm_pb2 as llm_dot_v2_dot_llm__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GenerateText = channel.unary_unary(
                '/llm.v2.LLMProviderService/GenerateText',
                request_serializer=llm_dot_v2_dot_llm__pb2.GenerateTextRequest.SerializeToString,
                response_deserializer=llm_dot_v2_dot_llm__pb2.GenerateTextResponse.FromString,
                _registered_method=True)
        self.GenerateTextStream = channel.unary_stream(
                '/llm.v2.LLMProviderService/GenerateTextStream',
                request_serializer=llm_dot_v2_dot_llm__pb2.GenerateTextStreamRequest.SerializeToString,
                response_deserializer=llm_dot_v2_dot_llm__pb2.GenerateTextStreamResponse.FromString,
                _registered_method=True)
        self.GenerateEmbedding = channel.unary_unary(
                '/llm.v2.LLMProviderService/GenerateEmbedding',
                request_serializer=llm_dot_v2_dot_llm__pb2.GenerateEmbeddingRequest.SerializeToString,
                response_deserializer=llm_dot_v2_dot_llm__pb2.GenerateEmbeddingResponse.FromString,
                _registered_method=True)


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

    def GenerateText(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GenerateTextStream(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GenerateEmbedding(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LLMProviderServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GenerateText': grpc.unary_unary_rpc_method_handler(
                    servicer.GenerateText,
                    request_deserializer=llm_dot_v2_dot_llm__pb2.GenerateTextRequest.FromString,
                    response_serializer=llm_dot_v2_dot_llm__pb2.GenerateTextResponse.SerializeToString,
            ),
            'GenerateTextStream': grpc.unary_stream_rpc_method_handler(
                    servicer.GenerateTextStream,
                    request_deserializer=llm_dot_v2_dot_llm__pb2.GenerateTextStreamRequest.FromString,
                    response_serializer=llm_dot_v2_dot_llm__pb2.GenerateTextStreamResponse.SerializeToString,
            ),
            'GenerateEmbedding': grpc.unary_unary_rpc_method_handler(
                    servicer.GenerateEmbedding,
                    request_deserializer=llm_dot_v2_dot_llm__pb2.GenerateEmbeddingRequest.FromString,
                    response_serializer=llm_dot_v2_dot_llm__pb2.GenerateEmbeddingResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'llm.v2.LLMProviderService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('llm.v2.LLMProviderService', rpc_method_handlers)


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

    @staticmethod
    def GenerateText(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.v2.LLMProviderService/GenerateText',
            llm_dot_v2_dot_llm__pb2.GenerateTextRequest.SerializeToString,
            llm_dot_v2_dot_llm__pb2.GenerateTextResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GenerateTextStream(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.v2.LLMProviderService/GenerateTextStream',
            llm_dot_v2_dot_llm__pb2.GenerateTextStreamRequest.SerializeToString,
            llm_dot_v2_dot_llm__pb2.GenerateTextStreamResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GenerateEmbedding(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.v2.LLMProviderService/GenerateEmbedding',
            llm_dot_v2_dot_llm__pb2.GenerateEmbeddingRequest.SerializeToString,
            llm_dot_v2_dot_llm__pb2.GenerateEmbeddingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
