# 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.apps.zuoyepigai import assignment_pb2 as yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__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/apps/zuoyepigai/assignment_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 AssignmentStub(object):
    """*
    作业管理
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Upload = channel.unary_unary(
            "/yeying.api.apps.zuoyepigai.Assignment/Upload",
            request_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentUploadRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentUploadResponse.FromString,
            _registered_method=True,
        )
        self.BigModelGenerate = channel.unary_unary(
            "/yeying.api.apps.zuoyepigai.Assignment/BigModelGenerate",
            request_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentBigModelRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentBigModelResponse.FromString,
            _registered_method=True,
        )
        self.ArtificialGenerate = channel.unary_unary(
            "/yeying.api.apps.zuoyepigai.Assignment/ArtificialGenerate",
            request_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentArtificialRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentArtificialResponse.FromString,
            _registered_method=True,
        )
        self.StudentAction = channel.unary_unary(
            "/yeying.api.apps.zuoyepigai.Assignment/StudentAction",
            request_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.StudentActionRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.StudentActionResponse.FromString,
            _registered_method=True,
        )
        self.Correction = channel.unary_unary(
            "/yeying.api.apps.zuoyepigai.Assignment/Correction",
            request_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentCorrectionRequest.SerializeToString,
            response_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentCorrectionResponse.FromString,
            _registered_method=True,
        )


class AssignmentServicer(object):
    """*
    作业管理
    """

    def Upload(self, request, context):
        """老师上传作业, 图片题目识别 (OCR)，将图片上的题目转换为文字信息存储到 DB
        对应 DB 表：
        zuoyepigai.test_paper，试卷
        zuoyepigai.question_collection，题目
        zuoyepigai.answer_collection，答案
        zuoyepigai.warehouse，资产仓库
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def BigModelGenerate(self, request, context):
        """大模型生成答案 (做题)，从题库中获取题目，调用解题的大模型生成对应题目的答案，并保存到 DB
        对应 DB 表：
        zuoyepigai.test_paper，试卷
        zuoyepigai.question_collection，题目
        zuoyepigai.answer_collection，答案
        zuoyepigai.warehouse，资产仓库
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ArtificialGenerate(self, request, context):
        """人工生成答案，人工做题，拍照上传生成题库答案"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def StudentAction(self, request, context):
        """学生加减，该任务对那些学生可见和不可见，老师可以自己来调整"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Correction(self, request, context):
        """作业批改，学生做完试卷后提交给老师，老师统一拍照上传批改处理"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_AssignmentServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Upload": grpc.unary_unary_rpc_method_handler(
            servicer.Upload,
            request_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentUploadRequest.FromString,
            response_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentUploadResponse.SerializeToString,
        ),
        "BigModelGenerate": grpc.unary_unary_rpc_method_handler(
            servicer.BigModelGenerate,
            request_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentBigModelRequest.FromString,
            response_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentBigModelResponse.SerializeToString,
        ),
        "ArtificialGenerate": grpc.unary_unary_rpc_method_handler(
            servicer.ArtificialGenerate,
            request_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentArtificialRequest.FromString,
            response_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentArtificialResponse.SerializeToString,
        ),
        "StudentAction": grpc.unary_unary_rpc_method_handler(
            servicer.StudentAction,
            request_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.StudentActionRequest.FromString,
            response_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.StudentActionResponse.SerializeToString,
        ),
        "Correction": grpc.unary_unary_rpc_method_handler(
            servicer.Correction,
            request_deserializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentCorrectionRequest.FromString,
            response_serializer=yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentCorrectionResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("yeying.api.apps.zuoyepigai.Assignment", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("yeying.api.apps.zuoyepigai.Assignment", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class Assignment(object):
    """*
    作业管理
    """

    @staticmethod
    def Upload(
        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.apps.zuoyepigai.Assignment/Upload",
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentUploadRequest.SerializeToString,
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentUploadResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def BigModelGenerate(
        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.apps.zuoyepigai.Assignment/BigModelGenerate",
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentBigModelRequest.SerializeToString,
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentBigModelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def ArtificialGenerate(
        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.apps.zuoyepigai.Assignment/ArtificialGenerate",
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentArtificialRequest.SerializeToString,
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentArtificialResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def StudentAction(
        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.apps.zuoyepigai.Assignment/StudentAction",
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.StudentActionRequest.SerializeToString,
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.StudentActionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def Correction(
        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.apps.zuoyepigai.Assignment/Correction",
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentCorrectionRequest.SerializeToString,
            yeying_dot_api_dot_apps_dot_zuoyepigai_dot_assignment__pb2.AssignmentCorrectionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
