utilitas 1998.2.58 → 1998.2.59

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
@@ -54,7 +54,7 @@ const [
54
54
  CLAUDE_35_HAIKU, CLOUD_37_SONNET, AUDIO, WAV, CHATGPT_MINI, ATTACHMENTS,
55
55
  CHAT, OPENAI_VOICE, MEDIUM, LOW, HIGH, GPT_REASONING_EFFORT, THINK,
56
56
  THINK_STR, THINK_END, AZURE, TOOLS_STR, TOOLS_END, TOOLS, TEXT, THINKING,
57
- OK, FUNC, GPT_45, REDACTED_THINKING,
57
+ OK, FUNC, GPT_45, REDACTED_THINKING, GEMMA_3_27B,
58
58
  ] = [
59
59
  'OPENAI', 'GEMINI', 'CHATGPT', 'OPENAI_EMBEDDING', 'GEMINI_EMEDDING',
60
60
  'OPENAI_TRAINING', 'OLLAMA', 'CLAUDE', 'gpt-4o-mini', 'gpt-4o', 'o1',
@@ -67,7 +67,7 @@ const [
67
67
  '[ATTACHMENTS]', 'CHAT', 'OPENAI_VOICE', 'medium', 'low', 'high',
68
68
  'medium', 'think', '<think>', '</think>', 'AZURE', '<tools>',
69
69
  '</tools>', 'tools', 'text', 'thinking', 'OK', 'function',
70
- 'gpt-4.5-preview', 'redacted_thinking',
70
+ 'gpt-4.5-preview', 'redacted_thinking', 'gemma-3-27b-it',
71
71
  ];
72
72
 
73
73
  const [
@@ -305,6 +305,15 @@ const MODELS = {
305
305
  flac, mp3, m4a, mpga, opus, pcm, wav, webm, tgpp,
306
306
  ],
307
307
  },
308
+ [GEMMA_3_27B]: {
309
+ contextWindow: 128 * 1000,
310
+ imageCostTokens: 256,
311
+ maxImageSize: 896 * 896,
312
+ maxOutputTokens: 1024 * 8,
313
+ vision: true,
314
+ json: true,
315
+ supportedMimeTypes: [png, jpeg],
316
+ },
308
317
  [DEEPSEEK_R1]: {
309
318
  contextWindow: 128 * 1000,
310
319
  maxOutputTokens: 32768,
@@ -806,7 +815,8 @@ const buildPrompts = async (model, input, options = {}) => {
806
815
  prompt = buildOllamaMessage(content, options);
807
816
  break;
808
817
  case GEMINI:
809
- systemPrompt = buildGeminiHistory(options.systemPrompt, _system);
818
+ const _role = { role: options.model === GEMMA_3_27B ? user : system };
819
+ systemPrompt = buildGeminiHistory(options.systemPrompt, _role);
810
820
  prompt = options.toolsResult?.[options.toolsResult?.length - 1]?.parts
811
821
  || buildGeminiMessage(content, options)
812
822
  break;
@@ -844,6 +854,7 @@ const buildPrompts = async (model, input, options = {}) => {
844
854
  break;
845
855
  case GEMINI:
846
856
  history.push(
857
+ ...options.model === GEMMA_3_27B ? [systemPrompt] : [],
847
858
  ...options.toolsResult?.length ? [
848
859
  buildGeminiHistory(content, { ...options, role: user }),
849
860
  ...options.toolsResult.slice(0, options.toolsResult.length - 1)
@@ -861,6 +872,10 @@ const buildPrompts = async (model, input, options = {}) => {
861
872
  content = trimTailing(trimTailing(content).slice(0, -1)) + '...';
862
873
  }
863
874
  }, model.maxInputTokens - options.attachments?.length * ATTACHMENT_TOKEN_COST);
875
+ if ([CHATGPT, OLLAMA].includes(options.flavor)
876
+ || options.model === GEMMA_3_27B) {
877
+ systemPrompt = null;
878
+ }
864
879
  return { systemPrompt, history, prompt };
865
880
  };
866
881
 
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.58",
4
+ "version": "1998.2.59",
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.58",
4
+ "version": "1998.2.59",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",