追加元数据条目(标题、标签等)。 对应 Reference: EP09 §1 条目类型 custom-title, ai-title, last-prompt, tag 等
(self, session_id: str, meta_type: str, data: dict)
| 323 | f.write(line) |
| 324 | |
| 325 | def append_metadata(self, session_id: str, meta_type: str, data: dict): |
| 326 | """ |
| 327 | 追加元数据条目(标题、标签等)。 |
| 328 | |
| 329 | 对应 Reference: EP09 §1 条目类型 |
| 330 | custom-title, ai-title, last-prompt, tag 等 |
| 331 | """ |
| 332 | entry = {"type": meta_type, **data} |
| 333 | path = self._session_path(session_id) |
| 334 | line = json.dumps(entry, ensure_ascii=False) + "\n" |
| 335 | with open(path, "a") as f: |
| 336 | f.write(line) |
| 337 | |
| 338 | def load_session(self, session_id: str) -> Session: |
| 339 | """ |