Skip to content

[Feature Request]: Add TransformMessages support to GroupChat's nested Select Speaker conversation #2583

Closed
@marklysze

Description

@marklysze

Is your feature request related to a problem? Please describe.

GroupChat uses a nested conversation between two agents. Currently it does not utilise the recent TransformMessages capability nor does it provide users a way to provide their own message transforms to select speaker messages.

The TransformMessages functionality provides the ability to compress messages, truncate/token-limit messages, and add content to existing messages. All of these would increase the robustness of the select speaker process.

cc @WaelKarkoub who I am collaborating with.

Describe the solution you'd like

Implementing default TransformMessages capabilities around text compression and truncation that a user can optionally enable would help users overcome select speaker issues as the total context length increases. Additionally, the option to include the speaker name inside the content of the message would also help link content to agent names during the LLM inference for selecting speakers.

Furthermore, adding the ability for the user to provide their own MessageTransform dictionary to apply would provide flexibility for users to utilise existing transforms or implement their own ones.

For implementation this would involve the addition of attributes and corresponding parameters for GroupChat (as the select speaker functionality is within GroupChat class).

Preliminary, GroupChat parameters being something like:

  • select_speaker_auto_compression - string with option of "" for none, "LLMLingua" to use LLMLingua, "Agent" to use the LLM for the agent (default "")
  • select_speaker_auto_token_limit - bool(defaullt False) will attempt to use max_tokens to limit total context length (needs consideration for non-OpenAI models)
  • select_speaker_auto_add_name - bool (default False) when true will prefix message["content"] with message["name"]
  • select_speaker_auto_message_transforms - dict[MessageTransform] (default None) the set of message transforms to apply, overriding the other options.

The defaults will result in no message transformations, matching current functionality.

I'll work on the implementation of this with support from @WaelKarkoub.

Additional context

To provide efficient text compression using LLMs, @WaelKarkoub is looking to add caching to a text compression MessageTransform class. This will be utilised within select speaker.

Related Issues

#2499

Metadata

Metadata

Assignees

Labels

0.2Issues which are related to the pre 0.4 codebasegroup chat/teamsgroup-chat-related issuesneeds-triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions