RoleAssignmentAgent

class RoleAssignmentAgent(ChatAgent):

An agent that generates role names based on the task prompt.

Parameters:

  • model (BaseModelBackend, optional): The model backend to use for generating responses. (default: :obj:OpenAIModel with GPT_4O_MINI)
  • Attributes:
  • role_assignment_prompt (TextPrompt): A prompt for the agent to generate role names.

init

def __init__(self, model: Optional[BaseModelBackend] = None):

run

def run(self, task_prompt: Union[str, TextPrompt], num_roles: int = 2):

Generate role names based on the input task prompt.

Parameters:

  • task_prompt (Union[str, TextPrompt]): The prompt for the task based on which the roles are to be generated.
  • num_roles (int, optional): The number of roles to generate. (default: :obj:2)

Returns:

Dict[str, str]: A dictionary mapping role names to their descriptions.