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 {
23072307 this.tokens = await tokenHandler.countAsync({ role: this.role, content: this.content, name: this.name });
23082308 }
23092309
2310+ /**
2311+ * Adds an image to the message.
2312+ * @param {string} image Image URL or Data URL.
2313+ * @returns {Promise<void>}
2314+ */
23102315 async addImage(image) {
23112316 const textContent = this.content;
23122317 const isDataUrl = isDataURL(image);
@@ -2401,7 +2406,7 @@ class Message {
24012406 * @param {Object} prompt - The prompt object.
24022407 * @returns {Promise<Message>} A new instance of Message.
24032408 */
24042409 static async fromPromptAsync(prompt) {
24052410 return Message.createAsync(prompt.role, prompt.content, prompt.identifier);
24062411 }
24072412