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

from avikom.nlp import answer_question_service_pb2 as avikom_dot_nlp_dot_answer__question__service__pb2


class AnswerQuestionServiceStub(object):
    """*
    This service sends a question and context as requests to the nlp module (currently HuggingFace).
    For example, you might want to extract information from a text by asking a question. You assume, that 
    the answer to your question can be found within the text.
    @author: Lars Schalkwijk <lars.schalkwijk@fh-bielefeld.de>
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.AnswerQuestion = channel.unary_unary(
                '/avikom.nlp.AnswerQuestionService/AnswerQuestion',
                request_serializer=avikom_dot_nlp_dot_answer__question__service__pb2.AnswerQuestionQuery.SerializeToString,
                response_deserializer=avikom_dot_nlp_dot_answer__question__service__pb2.AnswerQuestionResponse.FromString,
                )


class AnswerQuestionServiceServicer(object):
    """*
    This service sends a question and context as requests to the nlp module (currently HuggingFace).
    For example, you might want to extract information from a text by asking a question. You assume, that 
    the answer to your question can be found within the text.
    @author: Lars Schalkwijk <lars.schalkwijk@fh-bielefeld.de>
    """

    def AnswerQuestion(self, request, context):
        """/ the answer to the posed question is searched in the set context and returned if found; 
        / the model is currently based on https://huggingface.co/Sahajtomar/GBERTQnA
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AnswerQuestionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'AnswerQuestion': grpc.unary_unary_rpc_method_handler(
                    servicer.AnswerQuestion,
                    request_deserializer=avikom_dot_nlp_dot_answer__question__service__pb2.AnswerQuestionQuery.FromString,
                    response_serializer=avikom_dot_nlp_dot_answer__question__service__pb2.AnswerQuestionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'avikom.nlp.AnswerQuestionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class AnswerQuestionService(object):
    """*
    This service sends a question and context as requests to the nlp module (currently HuggingFace).
    For example, you might want to extract information from a text by asking a question. You assume, that 
    the answer to your question can be found within the text.
    @author: Lars Schalkwijk <lars.schalkwijk@fh-bielefeld.de>
    """

    @staticmethod
    def AnswerQuestion(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, '/avikom.nlp.AnswerQuestionService/AnswerQuestion',
            avikom_dot_nlp_dot_answer__question__service__pb2.AnswerQuestionQuery.SerializeToString,
            avikom_dot_nlp_dot_answer__question__service__pb2.AnswerQuestionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
