nip.code_validation.protocols.CodeValidationAgentSpec#
- class nip.code_validation.protocols.CodeValidationAgentSpec(human_name: str, response_channel_headers: dict[str, str] | None = None, channel_order: list[str | set[str]] | None = None, anonymous: bool = False, last_round_system_message: str | None = None, use_raw_message_for_self_prompt: bool = True, default_stance: int = 1)[source]#
A specification for an agent in a code validation protocol.
This dataclass specifies how the model representing each agent is interfaced with.
- Parameters:
human_name (str) – The human-friendly name of the agent, used in prompts.
response_channel_headers (dict[str, str], optional) – In multi-channel protocols, the completion from the model should contain messages for all channels in which the agent is active. Each message is prefaced by a header that specifies the channel. This dictionary maps channel names to headers. This can be
None
if the agent is active in only one channel.channel_order (list[str | set[str]], optional) – When making a request to the model, in each round the channels are ordered according to this list. It is a list of either channel names or sets of channel names. If a set of channel names is given, the channels are ordered randomly within that set. It is recommended to put the channels in which the agent is active last. If
None
, the order is determined by the protocol handler.anonymous (bool, optional) – Whether the agent is anonymous. If True, the agent’s name will not be used in prompts. Default is False.
last_round_system_message (str, optional) – If set, this message will be sent as a system message at the beginning of the last round of the interaction to the agent. This can be used to tell the agent to make a decision.
use_raw_message_for_self_prompt (bool, default=True) – When prompting the agent for a message, whether messages sent from this agent should be included in the chat history as raw messages (rather than being split by channel). This agent’s messages will still be split by channel in the chat histories used to prompt other agents. When prompting a model with its own past messages, it makes sense to use the raw messages, since the model will do some in-context learning. If the model always sees the messages split by channel, it will eventually learn to generate messages that are split by channel, which is not what we want.
default_stance (int, default=1) – The default verdict that the agent will argue for, where 0 is reject and 1 is accept. This is only relevant for provers.
Methods Summary
Attributes
anonymous
channel_order
default_stance
last_round_system_message
response_channel_headers
use_raw_message_for_self_prompt
human_name
Methods
- __eq__(other)#
Return self==value.
- __init__(human_name: str, response_channel_headers: dict[str, str] | None = None, channel_order: list[str | set[str]] | None = None, anonymous: bool = False, last_round_system_message: str | None = None, use_raw_message_for_self_prompt: bool = True, default_stance: int = 1) None #
- __repr__()#
Return repr(self).