mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-13 13:01:14 +00:00
if first args in puter.chat is a string, it's the prompt
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user