agora.common.core
Suitability Objects
class Suitability(str, Enum)
Enumeration of protocol suitability statuses.
Conversation Objects
class Conversation(ABC)
Abstract base class representing a conversation.
__call__
@abstractmethod
def __call__(message: str, print_output: bool = True) -> Any
Processes a message within the conversation.
Arguments:
messagestr - The message to process.print_outputbool - Whether to print the response.
Returns:
Any- The response generated by processing the message.
close
def close() -> None
Closes the conversation.
Returns:
None
__enter__
def __enter__() -> "Conversation"
Enters the conversation context.
Returns:
Conversation- The current conversation instance.
__exit__
def __exit__(exc_type: Optional[type], exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> None
Exits the conversation context, ensuring closure.
Arguments:
exc_typeOptional[type] - The exception type if an error occurred.exc_valueOptional[BaseException] - The exception instance if raised.tracebackOptional[TracebackType] - The traceback object.
Returns:
None
Protocol Objects
class Protocol()
Represents a protocol document with associated sources and metadata.
__init__
def __init__(protocol_document: str, sources: List[str],
metadata: Optional[Dict[str, str]]) -> None
Initializes a Protocol.
Arguments:
protocol_documentstr - The document detailing the protocol.sourcesList[str] - Sources where the protocol is referenced.metadataOptional[Dict[str, str]] - Additional metadata for the protocol.
hash
@property
def hash() -> str
Computes and returns the hash of the protocol document.
Returns:
str- The computed hash value.
__str__
def __str__() -> str
Returns a string representation of the Protocol.
Returns:
str- The string representation including hash, sources, metadata, and document.