bonadio / autogenwebdemo

Simple implementation of Autogen with FastApi backend and React frontend
MIT License
104 stars 33 forks source link

UserProxyWebAgent can't execute code with code_execution_config set to turn on #2

Closed miiiz closed 8 months ago

miiiz commented 8 months ago

what else changes should i make ? Thank you.

bonadio commented 8 months ago

Your configuration is incomplete, check Autogen documentation for UserProxyAgent, first make it work on a notebook them move to the web

miiiz commented 8 months ago

Sorry about the wrong expression. I set code_execution_config={"work_dir": "test"}. I think code can't be executed because UserProxyWebAgent has human_input_mode="ALWAYS", and the execute code command can't be sent with queue? do you have any experience in executing code with UserProxyWebAgent? Thank you.

miiiz commented 8 months ago

Another find out is that, if I set two simple agents with a function call sh. when function called, this NO HUMAN INPUT RECEIVED. come up. then AUTO REPLY happened and function call executed. But can't make it happen when using the default AssistantAgent and UserProxyAgent configs.

image
bonadio commented 8 months ago

Sorry about the wrong expression. I set code_execution_config={"work_dir": "test"}. I think code can't be executed because UserProxyWebAgent has human_input_mode="ALWAYS", and the execute code command can't be sent with queue? do you have any experience in executing code with UserProxyWebAgent? Thank you.

Hi @miiiz you are correct, when human_input_mode="ALWAYS" the code will never execute. You can change that parameter to "TERMINATE" when using UserProxyWebAgent.

The way autogen works is it first try to see if it gets a reply from human_input, if not then it tries function_call then code_execution. If you set to TERMINATE you will have to make your assistant output TERMINATE when you want the messages to flow to the UI. This Demo that I created is very basic it just shows how to forward the message to the UI.

miiiz commented 8 months ago

Thanks for your reply. if set to TERMINATE i think i should change the system message too. Otherwise UserProxy can't just chat with Assistant.