Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add MessageTransforms to the GroupChat's Select Speaker nested chat (speaker_selection_method='auto') #2719

Merged
merged 21 commits into from
Aug 26, 2024

Conversation

marklysze
Copy link
Collaborator

@marklysze marklysze commented May 19, 2024

This provides the ability to add MessageTransforms to the nested select speaker chat that occurs in a GroupChat when the speaker selection method is 'auto'. The MessageTransforms apply only to the messages within that nested select speaker chat (and not to the broader GroupChat chat).

The GroupChat constructor has a new, optional, parameter called select_speaker_auto_message_transforms that takes in a MessageTransforms object, or None.

Within GroupChat, the provided MessageTransforms object will be assigned to self._auto_message_transforms and used within _auto_select_speaker and a_auto_select_speaker.

The nested select speaker chat has two agents, checking_agent and speaker_selection_agent and the MessageTransforms are added to the speaker_selection_agent as that is the agent that utilises the LLM.

cc @Nathan-Intergral, @WebsheetPlugin

Why are these changes needed?

These changes enable greater control and flexibility of messages for speaker selection. Particularly useful for non-OpenAI models with limited context / reasoning ability.

Related issue number

Addresses #2499.

Addresses part of #2583.

I will carry forward other suggested changes in #2583 - select_speaker_auto_compression, select_speaker_auto_token_limit, select_speaker_auto_token_limit - it is useful to have these simple methods to enable message transforms without the developer having to create them, however as I test the effectiveness of the select speaker method I need more time to think through what would be most beneficial.

Checks

@marklysze marklysze added the group chat group-chat-related issues label May 19, 2024
@marklysze marklysze self-assigned this May 19, 2024
@thinkall thinkall added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit 4451632 Aug 26, 2024
134 of 146 checks passed
@thinkall thinkall deleted the selectspeakertransforms branch August 26, 2024 03:53
victordibia pushed a commit that referenced this pull request Aug 28, 2024
…sted chat (speaker_selection_method='auto') (#2719)

* Initial commit with ability to add transforms to GroupChat

* Added tests

* Tidy up

* Tidy up of variable names and commented out test

* Tidy up comment

* Update import to relative

* Added documentation topic for transform messages for speaker selection.

* Added handling of non-core module, transforms, in groupchat

* Adjusted parameter if module not loaded.

* Updated groupchat test which failed during CI/CD

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group chat group-chat-related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants