-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Language Support for Agent Names in GroupChat #268
Comments
The error is from openai side, where the legitimate name has to match from the openai cookbook, it seems that the To inject agent name information into message in group chat, we can add the name information as suffix separated by a special token
and set stop word to |
@LittleLittleCloud I don't see any mention that " |
Can anyone run an experiment to compare:
with all the three group chat notebook examples, and the 12 examples in the paper? |
What I understand is that name can be used for messages other than functions, and the names will be passed in the model (the token will be counted) There are some observations here: https://community.openai.com/t/discovered-how-a-name-is-added-to-api-chat-role-messages-and-the-tokens/330016 |
Thanks @kevin666aa It's a really helpful link to share here. So I does some extra experiments on dotnet, typescript and curl. My observation is it's unclear how GPT processes the var systemMessage = new ChatMessage(
role: ChatRole.System,
content: "You are a helpful AI assistant")
{
Name = "Alice",
};
var userMessage = new ChatMessage(ChatRole.User, "Hey what's your name")
{
Name = "Bob",
};
var option = new ChatCompletionsOptions()
{
Temperature = 0,
};
option.Messages.Add(systemMessage);
option.Messages.Add(userMessage);
var response = await Constant.AzureOpenAI.GetChatCompletionsAsync(Constant.GPT_35_MODEL_ID, option);
// response
// Hello Bob! I am Alice, your helpful AI assistant. How can I assist you today? var msgs = [{
role: 'system',
content: 'hello',
name: 'alice',
},
{
role: 'user',
content: 'what is my name',
name: 'bob',
}];
var choices = await client.getChatCompletions(
AZURE_GPT_3_5_TURBO_16K!,
msgs,
{
temperature: 0
}
);
// I'm sorry, but I don't know your name.
So we can see that in typescript, dotnet and curl, the behavior is different. Would be appreciated if anyone can verify that code as well. In Also trying some magic prompts in case the name is unknown is because of privacy policy. No lucky here Again, would be appreciated if anyone can re-run the code snippet as well. |
Hi @sonichi quick question (apologies if this is easily answered via browsing the source code) - in AutoGen do you assume that the OpenAI compatible backend is using the Or does AutoGen do some sort of prompt formatting using the From my reading of POST requests being sent by AutoGen while testing AutoGen+MemGPT (+ reading this issue), I'm assuming it's the former? I'm asking because I recently added some of my own prompt formatting support for this in the MemGPT local LLM prompt formatter: letta-ai/letta#603 (eg |
Yes, it's the former. Your approach looks smart. |
We are closing this issue due to inactivity; please reopen if the problem persists. |
When building a session using GroupChat, the agent name does not support using Chinese, and an error is reported: openai. error. InvalidRequestError: 'User' does not match '^ [a-zA-Z0-9_ -] {1,64} $' - 'messages. 1. name'
Directly using initiate does not have this problem
The text was updated successfully, but these errors were encountered: