agora.receiver.components.programmer
ReceiverProgrammer Objects
class ReceiverProgrammer()
Generates implementations for protocols based on their specifications.
__init__
def __init__(toolformer: Toolformer, num_attempts: int = 5)
Initialize the ReceiverProgrammer with a Toolformer and retry attempts.
Arguments:
toolformerToolformer - The Toolformer instance managing tools.num_attemptsint, optional - Number of attempts to generate implementation. Defaults to 5.
__call__
def __call__(tools: List[ToolLike],
protocol_document: str,
multiround: bool,
additional_info: str = '') -> str
Generate the implementation code for a given protocol.
Arguments:
toolsList[ToolLike] - A list of tools available for implementation.protocol_documentstr - The protocol document outlining requirements.multiroundbool - Indicates if the protocol supports multiple rounds of interaction.additional_infostr, optional - Additional information for implementation. Defaults to ''.
Returns:
str- The generated implementation code.