utilitas 1998.1.18 → 1998.1.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
@@ -358,10 +358,10 @@ const init = async (options) => {
358
358
  }
359
359
  break;
360
360
  case OLLAMA:
361
- (clients[provider] || options?.host) && (clients[provider] = {
361
+ clients[provider] || (options?.host && (clients[provider] = {
362
362
  client: new (await need('ollama', { raw: true })).Ollama(options),
363
363
  model: options?.model || DEFAULT_MODELS[OLLAMA],
364
- });
364
+ }));
365
365
  break;
366
366
  default:
367
367
  throwError(`Invalid AI provider: ${options?.provider || 'null'}`);
@@ -543,6 +543,8 @@ const packResp = async (resp, options) => {
543
543
  if (lines[0] === '<think>' && indexOfEnd !== -1) {
544
544
  lines[0] = '```think';
545
545
  lines[indexOfEnd] = '```';
546
+ lines.slice(0, indexOfEnd - 1).join('').trim()
547
+ || (lines = lines.slice(indexOfEnd + 1));
546
548
  richText = lines.join('\n');
547
549
  }
548
550
  }
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.1.18",
4
+ "version": "1998.1.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": "1998.1.18",
4
+ "version": "1998.1.20",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",