Giter Club home page Giter Club logo

Comments (3)

Hk669 avatar Hk669 commented on July 18, 2024

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/

from autogen.

kk2491 avatar kk2491 commented on July 18, 2024

@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

from autogen.

scruffynerf avatar scruffynerf commented on July 18, 2024

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

from autogen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.