No awaitless async. Add JSDocs.

1ef31b63acecaa436b3f381e2b3b600df27fc3e1

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +6 -1Showing whitespace changes
public/scripts/openai.js+6 -1
@@ -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 }
23092309
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 }
24072412