No awaitless async. Add JSDocs.
| @@ -2307,6 +2307,11 @@ class Message { | |||
| 2307 | this.tokens = await tokenHandler.countAsync({ role: this.role, content: this.content, name: this.name }); | 2307 | this.tokens = await tokenHandler.countAsync({ role: this.role, content: this.content, name: this.name }); |
| 2308 | } | 2308 | } |
| 2309 | 2309 | ||
| 2310 | /** | ||
| 2311 | * Adds an image to the message. | ||
| 2312 | * @param {string} image Image URL or Data URL. | ||
| 2313 | * @returns {Promise<void>} | ||
| 2314 | */ | ||
| 2310 | async addImage(image) { | 2315 | async addImage(image) { |
| 2311 | const textContent = this.content; | 2316 | const textContent = this.content; |
| 2312 | const isDataUrl = isDataURL(image); | 2317 | const isDataUrl = isDataURL(image); |
| @@ -2401,7 +2406,7 @@ class Message { | |||
| 2401 | * @param {Object} prompt - The prompt object. | 2406 | * @param {Object} prompt - The prompt object. |
| 2402 | * @returns {Promise<Message>} A new instance of Message. | 2407 | * @returns {Promise<Message>} A new instance of Message. |
| 2403 | */ | 2408 | */ |
| 2404 | static async fromPromptAsync(prompt) { | 2409 | static fromPromptAsync(prompt) { |
| 2405 | return Message.createAsync(prompt.role, prompt.content, prompt.identifier); | 2410 | return Message.createAsync(prompt.role, prompt.content, prompt.identifier); |
| 2406 | } | 2411 | } |
| 2407 | 2412 | ||