utilitas 2001.1.86 → 2001.1.87

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
@@ -103,13 +103,13 @@ const MODEL_ICONS = {
103
103
 
104
104
  const FEATURE_ICONS = {
105
105
  audio: '🔊', deepsearch: '🔍', fast: '⚡️', hearing: '👂', hidden: '🙈',
106
- image: '🎨', json: '📊', reasoning: '🧠', tools: '🧰', video: '🎬',
106
+ image: '🎨', reasoning: '🧠', structured: '📊', tools: '🧰', video: '🎬',
107
107
  vision: '👁️', // finetune: '🔧',
108
108
  };
109
109
 
110
110
  const GEMINI_RULES = {
111
111
  source: GOOGLE, contextWindow: m(1.05), maxOutputTokens: k(65.5),
112
- hearing: true, json: true, reasoning: true, tools: true, vision: true,
112
+ hearing: true, reasoning: true, structured: true, tools: true, vision: true,
113
113
  supportedMimeTypes: [
114
114
  MIME_PNG, MIME_JPEG, MIME_MOV, MIME_MPEG, MIME_MP4, MIME_MPG, MIME_AVI,
115
115
  MIME_WMV, MIME_MPEGPS, MIME_FLV, MIME_PDF, MIME_AAC, MIME_FLAC,
@@ -120,7 +120,7 @@ const GEMINI_RULES = {
120
120
 
121
121
  const OPENAI_RULES = {
122
122
  source: OPENAI, contextWindow: k(400), maxOutputTokens: k(128),
123
- hearing: true, json: true, reasoning: true, tools: true, vision: true,
123
+ hearing: true, reasoning: true, structured: true, tools: true, vision: true,
124
124
  supportedMimeTypes: [
125
125
  MIME_PNG, MIME_JPEG, MIME_GIF, MIME_WEBP, MIME_PDF, MIME_WAV
126
126
  ], defaultProvider: OPENROUTER,
@@ -128,7 +128,7 @@ const OPENAI_RULES = {
128
128
 
129
129
  const DEEPSEEK_32_RULES = {
130
130
  source: DEEPSEEK, contextWindow: k(163.8), maxOutputTokens: k(65.5),
131
- json: true, tools: true, reasoning: true,
131
+ structured: true, tools: true, reasoning: true,
132
132
  };
133
133
 
134
134
  // https://platform.openai.com/docs/models
@@ -137,7 +137,7 @@ const DEEPSEEK_32_RULES = {
137
137
  const MODELS = {
138
138
  // fast and balanced models
139
139
  [GEMINI_30_FLASH]: { // https://gemini.google.com/app/c680748b3307790b
140
- ...GEMINI_RULES, fast: true, json: false, // issue with json output via OpenRouter
140
+ ...GEMINI_RULES, fast: true, structured: false, // issue with json output via OpenRouter
141
141
  },
142
142
  // strong and fast
143
143
  [GPT_52]: { ...OPENAI_RULES, fast: true },
@@ -169,7 +169,7 @@ const MODELS = {
169
169
  [GPT_51_CODEX]: { ...OPENAI_RULES },
170
170
  [CLOUD_OPUS_45]: {
171
171
  source: ANTHROPIC, contextWindow: k(200), maxOutputTokens: k(64),
172
- json: true, reasoning: true, tools: true, vision: true,
172
+ reasoning: true, structured: true, tools: true, vision: true,
173
173
  supportedMimeTypes: [
174
174
  MIME_TEXT, MIME_PNG, MIME_JPEG, MIME_GIF, MIME_WEBP, MIME_PDF,
175
175
  ], defaultProvider: OPENROUTER,
@@ -194,7 +194,7 @@ const MODELS = {
194
194
  // models with deepsearch capabilities
195
195
  [JINA_DEEPSEARCH]: { // @todo: parse more details from results, eg: "reed urls".
196
196
  maxInputTokens: Infinity, attachmentTokenCost: 0,
197
- deepsearch: true, json: true, reasoning: true, vision: true,
197
+ deepsearch: true, reasoning: true, structured: true, vision: true,
198
198
  supportedMimeTypes: [MIME_PNG, MIME_JPEG, MIME_TEXT, MIME_WEBP, MIME_PDF],
199
199
  defaultProvider: JINA,
200
200
  },
@@ -204,7 +204,7 @@ const MODELS = {
204
204
  // best local model
205
205
  [GEMMA_3_27B]: {
206
206
  source: GOOGLE, contextWindow: k(128), maxOutputTokens: k(8),
207
- fast: true, json: true, vision: true,
207
+ fast: true, structured: true, vision: true,
208
208
  supportedMimeTypes: [MIME_PNG, MIME_JPEG, MIME_GIF],
209
209
  defaultProvider: OLLAMA,
210
210
  },
@@ -252,7 +252,7 @@ for (const n in MODELS) {
252
252
  // }
253
253
  // // for other features, if any model supports it, then AUTO supports it
254
254
  // for (const key of [
255
- // 'json', 'reasoning', 'tools', 'vision', 'fast', 'deepsearch', 'image',
255
+ // 'structured', 'reasoning', 'tools', 'vision', 'fast', 'deepsearch', 'image',
256
256
  // ]) {
257
257
  // MODELS[AUTO][key] = MODELS[AUTO][key] || MODELS[n][key];
258
258
  // }
@@ -516,7 +516,7 @@ const packAi = (ais, options = {}) => {
516
516
 
517
517
  const getAi = async (id, options = {}) => {
518
518
  options?.select || (options.select = {});
519
- options?.jsonMode && (options.select.json = true);
519
+ options?.jsonMode && (options.select.structured = true);
520
520
  if (id) {
521
521
  const ai = ais.find(x => x.id === id);
522
522
  assert(ai, `AI not found: ${id}.`);
@@ -750,8 +750,8 @@ const packModelId = (model_reference, options = {}) => {
750
750
  };
751
751
 
752
752
  const buildPrompts = async (model, input, options = {}) => {
753
- assert(!(options.jsonMode && !model?.json),
754
- `This model does not support JSON output: ${model.name}`);
753
+ assert(!(options.jsonMode && !model?.structured),
754
+ `This model does not support structured output: ${model.name}`);
755
755
  assert(!(options.reasoning && !model?.reasoning),
756
756
  `This model does not support reasoning: ${model.name}`);
757
757
  options.attachments = (await Promise.all((
@@ -1499,7 +1499,7 @@ const analyzeSessions = async (sessionIds, options) => {
1499
1499
  if (sm.length) { sses[ids[i]] = sm; }
1500
1500
  }
1501
1501
  const ai = await getAi(options?.aiId, {
1502
- jsonMode: true, simple: true, select: { json: true, fast: true },
1502
+ jsonMode: true, simple: true, select: { structured: true, fast: true },
1503
1503
  ...options || {}
1504
1504
  });
1505
1505
  const pmt = options?.prompt || (
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": "2001.1.86",
4
+ "version": "2001.1.87",
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": "2001.1.86",
4
+ "version": "2001.1.87",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",