(config = {})
| 56 | } |
| 57 | |
| 58 | async enable(config = {}) { |
| 59 | debug('Enabling AI assistant') |
| 60 | this.isEnabled = true |
| 61 | |
| 62 | const { html, prompts, ...aiConfig } = config |
| 63 | |
| 64 | this.config = Object.assign(this.config, aiConfig) |
| 65 | this.htmlConfig = Object.assign(defaultHtmlConfig, html) |
| 66 | |
| 67 | const loadedPrompts = await loadPrompts() |
| 68 | this.prompts = Object.assign(loadedPrompts, prompts || {}) |
| 69 | |
| 70 | debug('Config', this.config) |
| 71 | } |
| 72 | |
| 73 | reset() { |
| 74 | this.numTokens = 0 |
no test coverage detected