(model)
| 33 | |
| 34 | // Create a new session |
| 35 | create(model) { |
| 36 | const id = this._generateId(); |
| 37 | const session = { |
| 38 | id, |
| 39 | title: '', |
| 40 | model, |
| 41 | messages: [], |
| 42 | tokens: { input: 0, output: 0, total: 0 }, |
| 43 | cost: 0, |
| 44 | toolCalls: 0, |
| 45 | createdAt: new Date().toISOString(), |
| 46 | updatedAt: new Date().toISOString(), |
| 47 | }; |
| 48 | this.current = session; |
| 49 | this._save(session); |
| 50 | return session; |
| 51 | } |
| 52 | |
| 53 | // Resume the most recent session |
| 54 | resume() { |
no test coverage detected