autogen icon indicating copy to clipboard operation
autogen copied to clipboard

Controlling the printing output of agents

Open Kunjal1999 opened this issue 1 year ago • 2 comments

What happened?

How can we control the output of the code executor? Can we let the executor print only some lines of the output of the code generated? The terminal is crashing when the output of the code is extremely large (~1000 lines or so)

   @staticmethod
    def create_user_proxy_agent() -> autogen.UserProxyAgent:
        x= autogen.UserProxyAgent(
            name="user_proxy",
            human_input_mode="TERMINATE",
            max_consecutive_auto_reply=1,
            code_execution_config={
                "executor": LocalCommandLineCodeExecutor(work_dir="coding"),
            },
        ) 

What did you expect to happen?

Control code printing on the screen.

How can we reproduce it (as minimally and precisely as possible)?

https://github.com/microsoft/autogen/issues/3896#issue-2606804632

AutoGen version

0.2

Which package was this bug in

AgentChat

Model used

No response

Python version

No response

Operating system

No response

Any additional info you think would be helpful for fixing this bug

No response

Kunjal1999 avatar Oct 28 '24 07:10 Kunjal1999

Can you set silent=True to UserProxyAgent?

ekzhu avatar Oct 28 '24 15:10 ekzhu

Hello, I don't want a complete blank output, I want it to be controlled upto 1000 lines.

Kunjal1999 avatar Oct 28 '24 21:10 Kunjal1999

Output control is a major feature of 0.4, please check out the migration guide for observability and control https://microsoft.github.io/autogen/dev/user-guide/agentchat-user-guide/migration-guide.html#observability-and-control

jackgerrits avatar Feb 03 '25 16:02 jackgerrits