* 从文件名提取聊天名称
(filePath: string)
| 45 | * 从文件名提取聊天名称 |
| 46 | */ |
| 47 | function extractNameFromFilePath(filePath: string): string { |
| 48 | const basename = path.basename(filePath) |
| 49 | const name = basename.replace(/\.json$/i, '') |
| 50 | return name || '未知聊天' |
| 51 | } |
| 52 | |
| 53 | // ==================== 特征定义 ==================== |
| 54 |