Open kk2491 opened 4 months ago
hi @kk2491, thank you for your kind words, i think this tutorial should help you in resuming the groupchat. https://microsoft.github.io/autogen/docs/topics/groupchat/resuming_groupchat/
@Hk669 Thank you for providing the relevant material. I have gone through the details.
In my case, I am looking for a chat between only 2 agents and how can I effectively use chat_messages
field in the ConversableAgent
to add the previous chat history.
Thank you,
KK
I believe this is the key for you:
chat_result = user_proxy.initiate_chat(
assistant,
message=question,
)
in a new chat, normally, you pass in a message which is a string, and the initiate_chat does the rest... if you look at that function, you'll see summary discussed and carryover/context but not how to add chat_history. You can pass a set of chat messages, with your question last, but look at your example.. the last two items:
{'content': '', 'role': 'assistant'},
{'content': 'TERMINATE', 'role': 'user'}
Probably don't want to pass those in...
BUT the /agentchat/chat.py does contain a function: initiate_chats() which includes args for:
- `"carryover"` - It can be used to specify the carryover information to be passed
to this chat. If provided, we will combine this carryover with the "message" content when
generating the initial chat message in `generate_init_message`.
- `"finished_chat_indexes_to_exclude_from_carryover"` - It can be used by specifying a list of indexes of the finished_chats list, from which to exclude the summaries for carryover. If 'finished_chat_indexes_to_exclude_from_carryover' is not provided or an empty list, then summary from all the finished chats will be taken.
if you are doing summaries, this is helpful, less tokens to send/process. But this can be used to 'cleanup' the chat_history (+ current message) and give you a single 'message bundle' to send to initiate a new chat, with the history of previous discussions
Describe the issue
First of all, thank you all for making this awesome tool.
I have recently started using autogen, and the use case I am trying to achieve is the sequence of related queries one after the other in separate chats. In this case, I am using only 2 agents (one for use proxy and the other one is assistant).
For example, first question would be :
create a resource in x
. assistant and user proxy works together, uses the tools and creates the resource. Second followup question would beupdate the resource you just created
. How can I provide the previous chat history, so that the agents know the context.As per the documentation I see that the
chat_messages
can be used to provide the previous conversation. However I am not able to exactly figure out on how to populate this, could you please help me here?I am using the below python script
After the first query, the
chat_result
output is as given below:How can I populate the
chat_messages
field in the agents, so that the agents know the previous context when I ask a new question?Thank you,
KK
Steps to reproduce
No response
Screenshots and logs
No response
Additional Information
No response