transforms
autogen.agentchat.contrib.capabilities.transforms.MessageTransform
MessageTransform
Defines a contract for message transformation.
Classes implementing this protocol should provide an apply_transform
method
that takes a list of messages and returns the transformed list.
Name | Description |
---|---|
*args | |
**kwargs |
Instance Methods
apply_transform
Applies a transformation to a list of messages.
Name | Description |
---|---|
messages | A list of dictionaries representing messages. Type: list[dict[str, typing.Any]] |
Type | Description |
---|---|
list[dict[str, typing.Any]] | A new list of dictionaries containing the transformed messages. |
get_logs
Creates the string including the logs of the transformation
Alongside the string, it returns a boolean indicating whether the transformation had an effect or not.
Name | Description |
---|---|
pre_transform_messages | A list of dictionaries representing messages before the transformation. Type: list[dict[str, typing.Any]] |
post_transform_messages | A list of dictionaries representig messages after the transformation. Type: list[dict[str, typing.Any]] |
Type | Description |
---|---|
tuple[str, bool] | A tuple with a string with the logs and a flag indicating whether the transformation had an effect or not. |