Bless you sir. I have been searching for a solution like this. I have fought with chainlit and websocket but I ve not been satisfied. This is clean and to the point.
Amazing video! Very to-the-point and helpful. I am encountering an issue and was hoping you could assist me. In your code, you reset input_future each time to receive new input from the user. However, when I attempt to implement this, I only receive responses from the agents the first time I provide input. After that, there is no further agent engagement or conversation, and the terminal indicates that no input is awaited. How can I maintain ongoing user engagement after each termination? For instance, if I have three agents engaging in the chat, I would like the flow to be: User input User proxy Agent 1 Agent 2 Then again User input User proxy Agent 1 Agent 2 And again And so on. Thank you!
This has been actually one of my bigger. Complaints of autogen. that output formatting is awful and the coloring helps. But it just goes so far. This u I is simple, elegant and really awesome. Thank you for this the code and the mark down article.
Great video! Does anyone know how to close the browser window that opens after the server is launched in the code? I am able to stop the server but not close the window with it...
The simple case works, but when I ask my agents to write code, I get an error in Panel chat. I know the code has run successfully by looking at the terminal. But in the Panel chat it shows a message with Avatar symbol as red X, avatar name 'Exception', and the message content is just the literal string 'name'. Have you seen something like this? Any idea what might be happening? Awesome video by the way. Thanks.
Thanks for the feedback. You are right and I just reproduced this issue. The root cause is AutoGen's message structure bug that sometimes loses the "name" key value in the message dictionary. I've updated my source code on Github for a workaround, please check it. For a quick fix: 1. upgrade the pyautogen to the latest. 2. replace the original print_message() function with ------------------------------------------------------------------------ def print_messages(recipient, messages, sender, config): if all(key in messages[-1] for key in ['name']): chat_interface.send(messages[-1]['content'], user=messages[-1]['name'], avatar=avatar[messages[-1]['name']], respond=False) else: chat_interface.send(messages[-1]['content'], user='SecretGuy', avatar='🥷', respond=False) return False, None
@@yeyulabThat's a great workaround. Thanks for a quick response. Looking forward to more videos like this, perhaps adding MemGPT, Multiple models, Agent groups, etc. Also if you can have Autogen agents working together to create complex visualizations using Panel.
It should be resolved because the root cause is that there will be no messages[-1]['name'] in the message when a message is sent back to the sender by chat_manager. Checking its existence is a way. Please try again making sure you replace the print_message() with this. ------------------------ def print_messages(recipient, messages, sender, config): print(f"Messages from: {sender.name} sent to: {recipient.name} | num messages: {len(messages)} | message: {messages[-1]}") if all(key in messages[-1] for key in ['name']): chat_interface.send(messages[-1]['content'], user=messages[-1]['name'], avatar=avatar[messages[-1]['name']], respond=False) else: chat_interface.send(messages[-1]['content'], user=recipient.name, avatar=avatar[recipient.name], respond=False) return False, None
Bless you sir. I have been searching for a solution like this. I have fought with chainlit and websocket but I ve not been satisfied. This is clean and to the point.
Glad it helped, thank you!
Amazing video! Very to-the-point and helpful.
I am encountering an issue and was hoping you could assist me. In your code, you reset input_future each time to receive new input from the user. However, when I attempt to implement this, I only receive responses from the agents the first time I provide input. After that, there is no further agent engagement or conversation, and the terminal indicates that no input is awaited.
How can I maintain ongoing user engagement after each termination? For instance, if I have three agents engaging in the chat, I would like the flow to be:
User input
User proxy
Agent 1
Agent 2
Then again User input
User proxy
Agent 1
Agent 2
And again
And so on.
Thank you!
Congrats, good Job! Was looking for that for a couple of days. Helped tremendously! Thanks
So glad that helps! Thank you.
The (autogen) world was waiting for that. Thank you so much!!!
Enjoyable presentation of useful information and introduction to Panel. Thank you. Liked and subscribed.
Thank you!
This has been actually one of my bigger. Complaints of autogen. that output formatting is awful and the coloring helps. But it just goes so far. This u I is simple, elegant and really awesome. Thank you for this the code and the mark down article.
Thank you for your comments. I am also improving it for handling input as well.
🔥 GREAT video and thanks for introducing me to Panel. Thank you! 🔥
Happy coding, you are welcome!
Thanks for providing great content without wasting my time. :)
Glad you enjoy it!
This is a great application, please make videos for easy use...Thank you very much for your efforts.
Definitely, thanks.
Great job! Where can I find the code? I can't see it in your github. Thank you.
Thank you for letting me know the issue on my GitHub push. It’s fixed now, please check again📬
great work!
Thanks a lot!
Interesting! so cool
Thanks
Simple, very easy to follow. Great video!
Glad it was helpful! Thanks
Great video!
Does anyone know how to close the browser window that opens after the server is launched in the code? I am able to stop the server but not close the window with it...
The simple case works, but when I ask my agents to write code, I get an error in Panel chat. I know the code has run successfully by looking at the terminal. But in the Panel chat it shows a message with Avatar symbol as red X, avatar name 'Exception', and the message content is just the literal string 'name'. Have you seen something like this? Any idea what might be happening? Awesome video by the way. Thanks.
Thanks for the feedback. You are right and I just reproduced this issue. The root cause is AutoGen's message structure bug that sometimes loses the "name" key value in the message dictionary. I've updated my source code on Github for a workaround, please check it. For a quick fix: 1. upgrade the pyautogen to the latest. 2. replace the original print_message() function with
------------------------------------------------------------------------
def print_messages(recipient, messages, sender, config):
if all(key in messages[-1] for key in ['name']):
chat_interface.send(messages[-1]['content'], user=messages[-1]['name'], avatar=avatar[messages[-1]['name']], respond=False)
else:
chat_interface.send(messages[-1]['content'], user='SecretGuy', avatar='🥷', respond=False)
return False, None
@@yeyulabThat's a great workaround. Thanks for a quick response.
Looking forward to more videos like this, perhaps adding MemGPT, Multiple models, Agent groups, etc.
Also if you can have Autogen agents working together to create complex visualizations using Panel.
Great ideas, I will try those!
Very useful, thank you for sharing!
good video!
Thanks!
i am getting this error and couldnt find any solution :/
AttributeError: module 'panel' has no attribute 'chat'
What is the version of your panel? Please make sure it is >1.3.0. Run "pip install --upgrade panel".
Doesn't work as the 'name' error is still unresolved.Encountered KeyError('name'). Set callback_exception='verbose' to see the full traceback.
It should be resolved because the root cause is that there will be no messages[-1]['name'] in the message when a message is sent back to the sender by chat_manager. Checking its existence is a way. Please try again making sure you replace the print_message() with this.
------------------------
def print_messages(recipient, messages, sender, config):
print(f"Messages from: {sender.name} sent to: {recipient.name} | num messages: {len(messages)} | message: {messages[-1]}")
if all(key in messages[-1] for key in ['name']):
chat_interface.send(messages[-1]['content'], user=messages[-1]['name'], avatar=avatar[messages[-1]['name']], respond=False)
else:
chat_interface.send(messages[-1]['content'], user=recipient.name, avatar=avatar[recipient.name], respond=False)
return False, None
And welcome to my Discord to have further discussion. discord.gg/KPTCE4CEmp
great
Thanks!
Cool
Thanks.
Thank you man!! You're awesome!! ❤
Thank you!