Return the base config
(self, include_defaults: bool = False)
| 907 | return records |
| 908 | |
| 909 | def get_server_config(self, include_defaults: bool = False) -> dict: |
| 910 | """Return the base config""" |
| 911 | |
| 912 | def clean_keys(config): |
| 913 | config_copy = config.copy() |
| 914 | for k, v in config.items(): |
| 915 | if k == "key" or "_key" in k: |
| 916 | config_copy[k] = server_utils.shorten_key_middle(v, chars_each_side=5) |
| 917 | return config_copy |
| 918 | |
| 919 | # TODO: do we need a separate server config? |
| 920 | base_config = vars(self.config) |
| 921 | clean_base_config = clean_keys(base_config) |
| 922 | |
| 923 | response = {"config": clean_base_config} |
| 924 | |
| 925 | if include_defaults: |
| 926 | default_config = vars(LettaConfig()) |
| 927 | clean_default_config = clean_keys(default_config) |
| 928 | response["defaults"] = clean_default_config |
| 929 | |
| 930 | return response |
| 931 | |
| 932 | def update_agent_core_memory(self, agent_id: str, label: str, value: str, actor: User) -> Memory: |
| 933 | """Update the value of a block in the agent's memory""" |
nothing calls this directly
no test coverage detected