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:
toolformer
Toolformer - The Toolformer instance managing tools.num_attempts
int, 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:
tools
List[ToolLike] - A list of tools available for implementation.protocol_document
str - The protocol document outlining requirements.multiround
bool - Indicates if the protocol supports multiple rounds of interaction.additional_info
str, optional - Additional information for implementation. Defaults to ''.
Returns:
str
- The generated implementation code.