utilitas 1998.2.26 → 1998.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +6 -8
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -556,7 +556,6 @@ const buildGeminiMessage = (content, options) => {
|
|
|
556
556
|
const attachments = (options?.attachments || []).map(x => ({
|
|
557
557
|
inlineData: { mimeType: x.mime_type, data: x.data }
|
|
558
558
|
}));
|
|
559
|
-
|
|
560
559
|
return String.isString(content) ? (options?.history ? {
|
|
561
560
|
role: options?.role || user,
|
|
562
561
|
parts: buildGeminiParts(content, attachments),
|
|
@@ -1020,13 +1019,12 @@ const promptGemini = async (content, options) => {
|
|
|
1020
1019
|
), `This model does not support JSON output: ${genModel} `);
|
|
1021
1020
|
const chat = generative.startChat({
|
|
1022
1021
|
history: [
|
|
1023
|
-
...options?.messages && !options?.attachments?.length
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
options
|
|
1027
|
-
] : [],
|
|
1028
|
-
],
|
|
1029
|
-
...generationConfig(options),
|
|
1022
|
+
...options?.messages && !options?.attachments?.length
|
|
1023
|
+
? options.messages : [],
|
|
1024
|
+
...options?.toolsResult ? [{
|
|
1025
|
+
role: user, parts: buildGeminiMessage(content, options)
|
|
1026
|
+
}, options?.toolsResult[0]] : [],
|
|
1027
|
+
], ...generationConfig(options),
|
|
1030
1028
|
});
|
|
1031
1029
|
const resp = chat[options?.stream ? 'sendMessageStream' : 'sendMessage'](
|
|
1032
1030
|
options?.toolsResult ?
|
package/lib/manifest.mjs
CHANGED