utilitas 2000.3.18 → 2000.3.20

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
@@ -844,6 +844,12 @@ const promptOpenAI = async (aiId, content, options = {}) => {
844
844
  const packedTools = (targetModel.endsWith(ONLINE)
845
845
  ? _tools.filter(x => x?.replaced !== ONLINE)
846
846
  : _tools).map(x => x.def);
847
+ if (source === S_GOOGLE) {
848
+ packedTools.push(...[
849
+ { googleSearch: {} }, { codeExecution: {} }, { urlContext: {} },
850
+ // { googleMaps: {} }, // https://ai.google.dev/gemini-api/docs/maps-grounding // NOT for Gemini 3
851
+ ]);
852
+ }
847
853
  const resp = await client.chat.completions.create({
848
854
  model: targetModel, ...history,
849
855
  ...options.jsonMode ? { response_format: { type: JSON_OBJECT } } : {},
package/lib/cache.mjs CHANGED
@@ -23,7 +23,14 @@ const init = async (options) => {
23
23
  }
24
24
  }
25
25
  assert(redis, 'Redis has not been initialized.', 501);
26
- return { del, get, redis, set, setEx };
26
+ return redis;
27
+ };
28
+
29
+ const end = async () => {
30
+ if (redis) {
31
+ await redis.quit();
32
+ redis = null;
33
+ }
27
34
  };
28
35
 
29
36
  const assertKey = key => {
@@ -47,6 +54,7 @@ export {
47
54
  init,
48
55
  set,
49
56
  setEx,
57
+ end,
50
58
  };
51
59
 
52
60
 
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": "2000.3.18",
4
+ "version": "2000.3.20",
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": "2000.3.18",
4
+ "version": "2000.3.20",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",