Build and run agents you can see, understand and trust.
Python agentchatbotlarge-language-modelsllmllm-agentmcpmulti-agentmulti-modalreact-agentrealtime-agentvoice-agentvoice-assistant
feat(agent): support to disable console output from environment variable (#1001)
DavdGao5e0adc36ad64
diff --git a/src/agentscope/agent/_agent_base.py b/src/agentscope/agent/_agent_base.pyindex 0ac03550d..0779a1781 100644--- a/src/agentscope/agent/_agent_base.py+++ b/src/agentscope/agent/_agent_base.py@@ -3,6 +3,7 @@import asyncioimport ioimport json+import osfrom asyncio import Task, Queuefrom collections import OrderedDictfrom copy import deepcopy@@ -168,7 +169,13 @@ class AgentBase(StateModule, metaclass=_AgentMeta):# We add this variable in case developers want to disable the console# output of the agent, e.g., in a production environment.- self._disable_console_output: bool = False+ self._disable_console_output: bool = (+ os.getenv(+ "AGENTSCOPE_DISABLE_CONSOLE_OUTPUT",+ "false",+ ).lower()+ == "true"+ )# The streaming message queue used to export the messages as a# generator