(content: str, max_chars: int = 48)
| 267 | |
| 268 | |
| 269 | def _chat_title_from_content(content: str, max_chars: int = 48) -> str: |
| 270 | title = " ".join(str(content or "").split()) |
| 271 | if not title: |
| 272 | return "新对话" |
| 273 | if len(title) <= max_chars: |
| 274 | return title |
| 275 | return title[: max(1, max_chars - 3)].rstrip() + "..." |
| 276 | |
| 277 | |
| 278 | def _chat_session_row(row: sqlite3.Row) -> Dict[str, Any]: |
no outgoing calls
no test coverage detected