Open wangruxun opened 5 months ago
@ekzhu Please tell me how exactly should I get this context in an init_chat?
@wangruxun, for deep customization, you can just write multiple initiate_chat
calls directly rather than using initiate_chats
to chain them in a pre-defined way. You get much more control over the chat flow this way.
You mean to create multiple init_chat and then get the chat_results[0].summary of the previous init_chat in this way. But I think this way is not good. It stands to reason that an init_chat should be able to complete it.
After all, it already has the ability “carry over”, The content in the carryover should be bound to the chat_id, so that the next chat_id can accurately obtain the context of the former.
I think the current carryover function has this flaw。It is impossible to distinguish the context corresponding to different chat_id. The context and chat_id should be configured in dictionary format for better acquisition.
initiate_chats ‘s context cannot be displayed in dictionary format in the conversation list (1)Question:According to the carryover mechanism in initiate_chats, the context of each session will be passed to the next session, but if one of the sessions is allowed to accurately obtain the last_msg of a certain session, it cannot be obtained accurately. (2)For example, a function I want to implement.Among them, Context[0] should be able to correspond to the session content in "recipient": b_agent, because this content is passed to the next session as a carryover. However, how can I get it accurately in an initiate_chats? chat_results = a_agent.initiate_chats( [ { "recipient": b_agent, "message": receive_from_a_api(),
"max_turns": 1, "summary_method": "last_msg", }, { "recipient": user_agent, "message": tasks[1], # "max_turns": 1, "summary_method": "last_msg", }, { "recipient": judgement_agent, "message": f"b_agent_comment: {Context[0]} \n user_agent_comment: {Context[1]}", "max_turns": 1, "summary_method": "last_msg", }, ] )
Describe the solution you'd like
A dictionary mechanism should be provided for the context in carryover to facilitate the next session to obtain the content in a previous session and perform one-to-one correspondence.
Additional context