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/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 ? options.messages : [],
1024
- ...options?.toolsResult ? [
1025
- { role: user, parts: buildGeminiMessage(content, options) },
1026
- options?.toolsResult[0]
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
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1998.2.26",
4
+ "version": "1998.2.28",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1998.2.26",
4
+ "version": "1998.2.28",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",