(sessionId: string)
| 544 | } |
| 545 | |
| 546 | getAIChats(sessionId: string): AIChat[] { |
| 547 | const db = this.getDb() |
| 548 | return db |
| 549 | .prepare( |
| 550 | `SELECT id, session_id as sessionId, title, assistant_id as assistantId, |
| 551 | active_message_id as activeMessageId, |
| 552 | created_at as createdAt, updated_at as updatedAt |
| 553 | FROM ai_chat WHERE session_id = ? ORDER BY updated_at DESC` |
| 554 | ) |
| 555 | .all(sessionId) as AIChat[] |
| 556 | } |
| 557 | |
| 558 | getAIChat(aiChatId: string): AIChat | null { |
| 559 | const db = this.getDb() |