autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Issue][Discussion]: Use of "name" field for messages

Open marklysze opened this issue 1 year ago • 3 comments

Describe the issue

This issue is a place to discuss the impact of not being able to rely on the name field on messages and existing, or proposed, solutions to cater for this.


The name field on messages (which contains the agent's name) is optionally supported by OpenAI for inference, however it's not used (or cannot be included) on messages through other clients (such as local inference or cloud inference through Anthropic, Mistral AI, Together.AI, Groq, etc.).

This creates a hidden challenge for AutoGen developers who may think that their messages have the agent's name associated with them and create workflows/prompts that refer to the name.

My experience with speaker selection on group chat is that without the name being available to the LLM, it can be difficult for the LLM to determine the next speaker when the prompt to select the next speaker is dependent on who has spoken already. For example, a speaker selection prompt of "Once A, E, or F have spoken select H to review and provide feedback." would be challenging to adhere to if each message has no name.

It would be great to get your thoughts on what not having name impacts (or doesn't) and ideas to solve it!


An initial thought is a simple way to, optionally, include the agent's name at the start of each message, e.g.

dm = ConversableAgent(
    "digital_marketer",
    "add_name_to_messages"=True,
    ...

# Resulting in messages where content is "digital_marketer said: \n Some ideas to ..."
)

(one challenge of this approach is that the LLM takes these messages as the format it needs to respond with and its responses all follow that format!)


Related issues/PRs: #2635 #2457

Note: this issue relates to chat messages and not function/tool messages.

marklysze avatar Jun 21 '24 18:06 marklysze