(sessionId: string, title: string | undefined, assistantId: string)
| 514 | // ==================== 对话管理 ==================== |
| 515 | |
| 516 | createAIChat(sessionId: string, title: string | undefined, assistantId: string): AIChat { |
| 517 | const db = this.getDb() |
| 518 | const now = Math.floor(Date.now() / 1000) |
| 519 | const id = this.generateId('conv') |
| 520 | |
| 521 | db.prepare( |
| 522 | `INSERT INTO ai_chat (id, session_id, title, assistant_id, created_at, updated_at) |
| 523 | VALUES (?, ?, ?, ?, ?, ?)` |
| 524 | ).run(id, sessionId, title || null, assistantId, now, now) |
| 525 | |
| 526 | return { id, sessionId, title: title || null, assistantId, activeMessageId: null, createdAt: now, updatedAt: now } |
| 527 | } |
| 528 | |
| 529 | getAIChatCountsBySession(): Map<string, number> { |
| 530 | const result = new Map<string, number>() |
nothing calls this directly
no test coverage detected