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

# Use absolute import for agent_pb2
from prompits.plugs.protos import agent_pb2

GRPC_GENERATED_VERSION = '1.70.0'
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 agent_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 AgentStub(object):
    """Agent service definition
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SendMessage = channel.unary_unary(
                '/prompits.plugs.protos.Agent/SendMessage',
                request_serializer=agent_pb2.Message.SerializeToString,
                response_deserializer=agent_pb2.MessageResponse.FromString,
                _registered_method=True)
        self.Echo = channel.unary_unary(
                '/prompits.plugs.protos.Agent/Echo',
                request_serializer=agent_pb2.Message.SerializeToString,
                response_deserializer=agent_pb2.Message.FromString,
                _registered_method=True)
        self.GetAgentInfo = channel.unary_unary(
                '/prompits.plugs.protos.Agent/GetAgentInfo',
                request_serializer=agent_pb2.Empty.SerializeToString,
                response_deserializer=agent_pb2.AgentInfo.FromString,
                _registered_method=True)
        self.ListPractices = channel.unary_unary(
                '/prompits.plugs.protos.Agent/ListPractices',
                request_serializer=agent_pb2.Empty.SerializeToString,
                response_deserializer=agent_pb2.PracticeList.FromString,
                _registered_method=True)
        self.ExecutePractice = channel.unary_unary(
                '/prompits.plugs.protos.Agent/ExecutePractice',
                request_serializer=agent_pb2.PracticeRequest.SerializeToString,
                response_deserializer=agent_pb2.PracticeResponse.FromString,
                _registered_method=True)


class AgentServicer(object):
    """Agent service definition
    """

    def SendMessage(self, request, context):
        """Send a message to the agent
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Echo(self, request, context):
        """Echo a message back to the sender
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAgentInfo(self, request, context):
        """Get agent information
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListPractices(self, request, context):
        """List available practices
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecutePractice(self, request, context):
        """Execute a practice
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AgentServicer_to_server(servicer, server):
    """
    Register AgentServicer with a gRPC server.
    
    This function adds the defined Agent service methods to the provided gRPC server.
    
    Args:
        servicer: An implementation of the AgentServicer interface
        server: The gRPC server to add the service to
    """
    rpc_method_handlers = {
            'SendMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SendMessage,
                    request_deserializer=agent_pb2.Message.FromString,
                    response_serializer=agent_pb2.MessageResponse.SerializeToString,
            ),
            'Echo': grpc.unary_unary_rpc_method_handler(
                    servicer.Echo,
                    request_deserializer=agent_pb2.Message.FromString,
                    response_serializer=agent_pb2.Message.SerializeToString,
            ),
            'GetAgentInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAgentInfo,
                    request_deserializer=agent_pb2.Empty.FromString,
                    response_serializer=agent_pb2.AgentInfo.SerializeToString,
            ),
            'ListPractices': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPractices,
                    request_deserializer=agent_pb2.Empty.FromString,
                    response_serializer=agent_pb2.PracticeList.SerializeToString,
            ),
            'ExecutePractice': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecutePractice,
                    request_deserializer=agent_pb2.PracticeRequest.FromString,
                    response_serializer=agent_pb2.PracticeResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'prompits.plugs.protos.Agent', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('prompits.plugs.protos.Agent', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Agent(object):
    """Agent service definition
    """

    @staticmethod
    def SendMessage(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        """
        Send a message to the specified agent.
        
        This method is a client stub for the SendMessage RPC call.
        
        Args:
            request: The message to send
            target: The target agent address
            options: RPC options
            channel_credentials: Channel credentials for secure connection
            call_credentials: Call-specific credentials
            insecure: Whether to use an insecure connection
            compression: Compression method
            wait_for_ready: Whether to wait for the server to be ready
            timeout: RPC timeout
            metadata: Additional metadata
            
        Returns:
            The response from the agent
        """
        return grpc.experimental.unary_unary(
            request,
            target,
            '/prompits.plugs.protos.Agent/SendMessage',
            agent_pb2.Message.SerializeToString,
            agent_pb2.MessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Echo(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        """
        Echo a message back from the specified agent.
        
        This method is a client stub for the Echo RPC call.
        
        Args:
            request: The message to echo
            target: The target agent address
            options: RPC options
            channel_credentials: Channel credentials for secure connection
            call_credentials: Call-specific credentials
            insecure: Whether to use an insecure connection
            compression: Compression method
            wait_for_ready: Whether to wait for the server to be ready
            timeout: RPC timeout
            metadata: Additional metadata
            
        Returns:
            The echoed message from the agent
        """
        return grpc.experimental.unary_unary(
            request,
            target,
            '/prompits.plugs.protos.Agent/Echo',
            agent_pb2.Message.SerializeToString,
            agent_pb2.Message.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAgentInfo(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        """
        Get information about the specified agent.
        
        This method is a client stub for the GetAgentInfo RPC call.
        
        Args:
            request: Empty request
            target: The target agent address
            options: RPC options
            channel_credentials: Channel credentials for secure connection
            call_credentials: Call-specific credentials
            insecure: Whether to use an insecure connection
            compression: Compression method
            wait_for_ready: Whether to wait for the server to be ready
            timeout: RPC timeout
            metadata: Additional metadata
            
        Returns:
            Agent information including ID, name, and capabilities
        """
        return grpc.experimental.unary_unary(
            request,
            target,
            '/prompits.plugs.protos.Agent/GetAgentInfo',
            agent_pb2.Empty.SerializeToString,
            agent_pb2.AgentInfo.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListPractices(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        """
        List all available practices from the specified agent.
        
        This method is a client stub for the ListPractices RPC call.
        
        Args:
            request: Empty request
            target: The target agent address
            options: RPC options
            channel_credentials: Channel credentials for secure connection
            call_credentials: Call-specific credentials
            insecure: Whether to use an insecure connection
            compression: Compression method
            wait_for_ready: Whether to wait for the server to be ready
            timeout: RPC timeout
            metadata: Additional metadata
            
        Returns:
            List of practices available from the agent
        """
        return grpc.experimental.unary_unary(
            request,
            target,
            '/prompits.plugs.protos.Agent/ListPractices',
            agent_pb2.Empty.SerializeToString,
            agent_pb2.PracticeList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecutePractice(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        """
        Execute a practice on the specified agent.
        
        This method is a client stub for the ExecutePractice RPC call.
        
        Args:
            request: Practice request containing the practice name and parameters
            target: The target agent address
            options: RPC options
            channel_credentials: Channel credentials for secure connection
            call_credentials: Call-specific credentials
            insecure: Whether to use an insecure connection
            compression: Compression method
            wait_for_ready: Whether to wait for the server to be ready
            timeout: RPC timeout
            metadata: Additional metadata
            
        Returns:
            Result of the practice execution
        """
        return grpc.experimental.unary_unary(
            request,
            target,
            '/prompits.plugs.protos.Agent/ExecutePractice',
            agent_pb2.PracticeRequest.SerializeToString,
            agent_pb2.PracticeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
