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

Use function_call to terminate a conversation #133

Closed
LittleLittleCloud opened this issue Oct 6, 2023 · 5 comments
Closed

Use function_call to terminate a conversation #133

LittleLittleCloud opened this issue Oct 6, 2023 · 5 comments
Labels
group chat/teams group-chat-related issues tool-usage suggestion and execution of function/tool call

Comments

@LittleLittleCloud
Copy link
Collaborator

LittleLittleCloud commented Oct 6, 2023

We have a couple of users who are hitting an infinite loop(#108) when they start a chat between two agents or a group of chat.

The cause of the infinite loop is that we are using some hard-code rule to determine if a message contains terminate information, which is prone to bugs.

A more robust way is to use a terminate_conversation function call, which returns a hard-coded termination message instead of relying on LLM to generate that TERMINATE signal.
This terminate_conversation solution has two advantages

  • the TERMINATE message will be deterministic.
  • the TERMINATE signal won't be mixed with other content (because it's a funciton_call)

Any suggestion/feedback on creating an example of doing that? I can create an example for groupchat, would be great if someone can create example for twoagent chat.

@afourney
Copy link
Member

afourney commented Oct 6, 2023

I think that is a reasonable approach.

My understanding is that, in a Group Chat scenario, the fist agent to call terminate will stop the whole conversation. It's not always clear to me which agents in the chat should have that power. Maybe create an example where there is an agent dedicated to tracking progress and terminating the conversation at the appropriate time?

@LittleLittleCloud
Copy link
Collaborator Author

Yep, having the caller to stop a group chat makes sense here.

@afourney
Copy link
Member

afourney commented Oct 6, 2023

The trouble is that this agent will only act if called upon by the group chat manager -- there's no way to barge in. Maybe this functionality should roll up to the manager?

@LittleLittleCloud
Copy link
Collaborator Author

The group chat, if group chat manager doesn’t call the caller agent, will last for ‘max_turn’ at max before it returns to the caller. So it won’t cause infinity loop unless caller agent send another message to the group after it’s get called .

In the meantime, it’s still likely to have the same infinite loop if we escalate the termination permission to group chat manager, which falls back to the infinite loop between two agent. For example, the caller agent will still likely to send a new message to the group chat, after the manager terminating the last conversation session

@LittleLittleCloud
Copy link
Collaborator Author

This issue is blocked by #152

@sonichi sonichi added group chat/teams group-chat-related issues tool-usage suggestion and execution of function/tool call labels Oct 22, 2023
@gagb gagb closed this as completed Aug 27, 2024
jackgerrits pushed a commit that referenced this issue Oct 2, 2024
* Move agents to a subdir

* Add placeholder for example team

* Move messages to a common file

* Add rounrobin orchestrator + reflex agents

* Fix import errors

* Clean up commented code

* Fix formatting errors

* Fix a linting error

* Fix formatting errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group chat/teams group-chat-related issues tool-usage suggestion and execution of function/tool call
Projects
None yet
Development

No branches or pull requests

4 participants