Skip to main content

TextMessageContentName

A transform for including the agent’s name in the content of a message.
How to create and apply the transform:
# Imports from autogen.agentchat.contrib.capabilities import transform_messages, transforms

Create Transform

name_transform = transforms.TextMessageContentName(position=“start”, format_string=”‘{name}’ said:
“)

Create the TransformMessages

context_handling = transform_messages.TransformMessages( transforms=[ name_transform ] )

Add it to an agent so when they run inference it will apply to the messages

context_handling.add_to_agent(my_agent) Parameters:

Instance Methods

apply_transform

Applies the name change to the message based on the position and format string.
Parameters: Returns:

get_logs

Parameters: