# 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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from insightproto.proto.results.v1 import flow_pb2 as insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2

GRPC_GENERATED_VERSION = '1.71.2'
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 insightproto/proto/results/v1/flow_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 AgentFlowStub(object):
    """this service is primarily for transparency of agent flow
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.AgentStarted = channel.unary_unary(
                '/insightproto.proto.results.v1.AgentFlow/AgentStarted',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentStartedEvent.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.SendAgentEvent = channel.unary_unary(
                '/insightproto.proto.results.v1.AgentFlow/SendAgentEvent',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentEvent.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.AgentStopped = channel.unary_unary(
                '/insightproto.proto.results.v1.AgentFlow/AgentStopped',
                request_serializer=insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentStoppedEvent.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)


class AgentFlowServicer(object):
    """this service is primarily for transparency of agent flow
    """

    def AgentStarted(self, request, context):
        """issue an event when an agent is started
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendAgentEvent(self, request, context):
        """issue an event during the agent process
        this can be used to stream thoughts, tool calls or other info
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AgentStopped(self, request, context):
        """issue an event when an agent is complete
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AgentFlowServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'AgentStarted': grpc.unary_unary_rpc_method_handler(
                    servicer.AgentStarted,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentStartedEvent.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'SendAgentEvent': grpc.unary_unary_rpc_method_handler(
                    servicer.SendAgentEvent,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentEvent.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'AgentStopped': grpc.unary_unary_rpc_method_handler(
                    servicer.AgentStopped,
                    request_deserializer=insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentStoppedEvent.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'insightproto.proto.results.v1.AgentFlow', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('insightproto.proto.results.v1.AgentFlow', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AgentFlow(object):
    """this service is primarily for transparency of agent flow
    """

    @staticmethod
    def AgentStarted(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,
            '/insightproto.proto.results.v1.AgentFlow/AgentStarted',
            insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentStartedEvent.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SendAgentEvent(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,
            '/insightproto.proto.results.v1.AgentFlow/SendAgentEvent',
            insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentEvent.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AgentStopped(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,
            '/insightproto.proto.results.v1.AgentFlow/AgentStopped',
            insightproto_dot_proto_dot_results_dot_v1_dot_flow__pb2.AgentStoppedEvent.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
