MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / _value_to_string

Function _value_to_string

src/config/settings.py:653–665  ·  view source on GitHub ↗

将值转换为数据库存储的字符串

(value: Any)

Source from the content-addressed store, hash-verified

651
652
653def _value_to_string(value: Any) -> str:
654 """将值转换为数据库存储的字符串"""
655 if isinstance(value, SecretStr):
656 return value.get_secret_value()
657 elif isinstance(value, bool):
658 return "true" if value else "false"
659 elif isinstance(value, (dict, list)):
660 import json
661 return json.dumps(value)
662 elif value is None:
663 return ""
664 else:
665 return str(value)
666
667
668def init_default_settings() -> None:

Callers 3

init_default_settingsFunction · 0.85
_load_settings_from_dbFunction · 0.85
_save_settings_to_dbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected