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:
target
str - The target URL or endpoint.multiround
bool - Whether the conversation is multi-round.protocol_hash
str - The protocol's hash identifier.protocol_sources
List[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:
target
str - The target URL or endpoint.multiround
bool - Whether multi-round communication is enabled.protocol_hash
str - The protocol hash.protocol_sources
List[str] - Protocol sources.
__call__
def __call__(message: str)
Sends a message in the current conversation.
Arguments:
message
str - 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:
target
str - The target URL or endpoint.multiround
bool - Whether the conversation is multi-round.protocol_hash
str - The protocol's hash identifier.protocol_sources
List[str] - Protocol sources.
Returns:
SimpleExternalConversation
- A new conversation instance.