utilitas 2000.3.56 → 2000.3.58

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
@@ -390,8 +390,10 @@ const buildAiId = (provider, model) => [
390
390
  ].map(x => ensureString(x, { case: 'SNAKE' })).join('_');
391
391
 
392
392
  const buildAiName = (provider, model) => [
393
- model?.icon || getProviderIcon(provider), provider,
394
- `(${isOpenrouter(provider, model) ? `${model.source}/` : ''}${model.label || model.name})`
393
+ model?.icon || getProviderIcon(provider), packModelLabel([
394
+ provider, isOpenrouter(provider, model) && model.source,
395
+ model.label || model.name
396
+ ])
395
397
  ].join(' ');
396
398
 
397
399
  const buildAiFeatures = model => Object.entries(FEATURE_ICONS).map(
@@ -1340,6 +1342,11 @@ const prompt = async (input, options = {}) => {
1340
1342
  const tag = packModelLabel([ai.provider, ai.model.source, ai.model.name]);
1341
1343
  options.log && log(`Prompt ${tag}: ${JSON.stringify(input || '[ATTACHMENTS]')}`);
1342
1344
  const resp = await ai.prompt(input, options);
1345
+ const msgs = options?.messages || [];
1346
+ const [rag_msgs, ctx_msgs] = [
1347
+ msgs.filter(x => !!x.score).length, msgs.filter(x => !x.score).length
1348
+ ];
1349
+ options.log && log(`w/ RAG: ${rag_msgs}, context: ${ctx_msgs}, attachments: ${~~options?.attachments?.length}.`);
1343
1350
  options.log && log(`Response ${tag}: ${JSON.stringify(resp.text)}`);
1344
1351
  return resp;
1345
1352
  };
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.56",
4
+ "version": "2000.3.58",
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.56",
4
+ "version": "2000.3.58",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",