MCPcopy
hub / github.com/TauricResearch/TradingAgents / set_config

Function set_config

tradingagents/dataflows/config.py:16–30  ·  view source on GitHub ↗

Update the configuration with custom values. Dict-valued keys (e.g. ``data_vendors``) are merged one level deep so a partial update like ``{"data_vendors": {"core_stock_apis": "alpha_vantage"}}`` keeps the other nested keys from the default; scalar keys are replaced.

(config: dict)

Source from the content-addressed store, hash-verified

14
15
16def set_config(config: dict):
17 """Update the configuration with custom values.
18
19 Dict-valued keys (e.g. ``data_vendors``) are merged one level deep so a
20 partial update like ``{"data_vendors": {"core_stock_apis": "alpha_vantage"}}``
21 keeps the other nested keys from the default; scalar keys are replaced.
22 """
23 global _config
24 initialize_config()
25 incoming = deepcopy(config)
26 for key, value in incoming.items():
27 if isinstance(value, dict) and isinstance(_config.get(key), dict):
28 _config[key].update(value)
29 else:
30 _config[key] = value
31
32
33def get_config() -> dict:

Calls 1

initialize_configFunction · 0.85