MCPcopy Create free account
hub / github.com/KerwinMai/Multi-Agent-Exp / replace_env_vars

Method replace_env_vars

agent.py:74–79  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

72
73 # 替换环境变量
74 def replace_env_vars(obj):
75 if isinstance(obj, dict):
76 return {k: replace_env_vars(v) for k, v in obj.items()}
77 if isinstance(obj, str) and obj.startswith("${") and obj.endswith("}"):
78 return os.getenv(obj[2:-1], obj)
79 return obj
80
81 return replace_env_vars(config)
82

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected