diff --git a/src/puter-js/src/modules/AI.js b/src/puter-js/src/modules/AI.js index 5a37c410f..928e76e0e 100644 --- a/src/puter-js/src/modules/AI.js +++ b/src/puter-js/src/modules/AI.js @@ -144,10 +144,15 @@ class AI{ } // ai.chat(prompt) + if(typeof args[0] === 'string'){ + options = { messages: [{ content: args[0] }] }; + } + // ai.chat(prompt, testMode) if (typeof args[0] === 'string' && (!args[1] || typeof args[1] === 'boolean')) { options = { messages: [{ content: args[0] }] }; } + // ai.chat(prompt, imageURL/File) // ai.chat(prompt, imageURL/File, testMode) else if (typeof args[0] === 'string' && (typeof args[1] === 'string' || args[1] instanceof File)) { @@ -211,6 +216,7 @@ class AI{ } } + // does settings contain `model`? add it to options if (settings.model) { options.model = settings.model;