agora.sender.components.transporter
SenderTransporter Objects
class SenderTransporter(ABC)
new_conversation
@abstractmethod
def new_conversation(target: str, multiround: bool, protocol_hash: str,
protocol_sources: List[str]) -> Conversation
Creates a new conversation with the target.
Arguments:
targetstr - The target URL or endpoint.multiroundbool - Whether the conversation is multi-round.protocol_hashstr - The protocol's hash identifier.protocol_sourcesList[str] - Sources referencing the protocol.
Returns:
Conversation- A conversation instance.
SimpleSenderTransporter Objects
class SimpleSenderTransporter(SenderTransporter)
SimpleExternalConversation Objects
class SimpleExternalConversation(Conversation)
__init__
def __init__(target: str, multiround: bool, protocol_hash: str,
protocol_sources: List[str])
Initializes a simple external conversation.
Arguments:
targetstr - The target URL or endpoint.multiroundbool - Whether multi-round communication is enabled.protocol_hashstr - The protocol hash.protocol_sourcesList[str] - Protocol sources.
__call__
def __call__(message: str)
Sends a message in the current conversation.
Arguments:
messagestr - The message to send.
Returns:
dict- The response containing 'status' and 'body'.
close
def close() -> None
Closes the conversation by deleting it from the remote service.
new_conversation
def new_conversation(
target: str, multiround: bool, protocol_hash: str,
protocol_sources: List[str]) -> SimpleExternalConversation
Creates a new SimpleExternalConversation instance.
Arguments:
targetstr - The target URL or endpoint.multiroundbool - Whether the conversation is multi-round.protocol_hashstr - The protocol's hash identifier.protocol_sourcesList[str] - Protocol sources.
Returns:
SimpleExternalConversation- A new conversation instance.