utilitas 1998.2.44 → 1998.2.45

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
@@ -786,7 +786,7 @@ const buildPrompts = async (model, input, options = {}) => {
786
786
  prompt = buildGptMessage(content, options);
787
787
  break;
788
788
  case CLAUDE:
789
- systemPrompt = buildClaudeMessage(options.systemPrompt, _system);
789
+ systemPrompt = options.systemPrompt;
790
790
  prompt = buildClaudeMessage(content, options)
791
791
  break;
792
792
  case OLLAMA:
@@ -824,9 +824,11 @@ const buildPrompts = async (model, input, options = {}) => {
824
824
  });
825
825
  switch (options.flavor) {
826
826
  case CHATGPT: case CLAUDE: case OLLAMA:
827
- history.push(prompt, ...options.toolsResult?.length
828
- ? options.toolsResult : []);
829
- history = messages(history);
827
+ history = messages([
828
+ ...options.flavor === CLAUDE ? [] : [systemPrompt],
829
+ ...history, prompt,
830
+ ...options.toolsResult?.length ? options.toolsResult : []
831
+ ]);
830
832
  break;
831
833
  case GEMINI:
832
834
  history.push(
@@ -1045,11 +1047,11 @@ const promptClaude = async (content, options = {}) => {
1045
1047
  [], false
1046
1048
  ];
1047
1049
  const { client } = await getClaudeClient(options);
1048
- const { history }
1050
+ const { systemPrompt: system, history }
1049
1051
  = await buildPrompts(_MODEL, content, { ...options, flavor: CLAUDE });
1050
1052
  const resp = await client.beta.messages.create({
1051
1053
  model: options.model, max_tokens: _MODEL.maxOutputTokens, ...history,
1052
- stream: true, ...options.reasoning ?? _MODEL?.reasoning ? {
1054
+ system, stream: true, ...options.reasoning ?? _MODEL?.reasoning ? {
1053
1055
  thinking: options.thinking || { type: 'enabled', budget_tokens: 1024 },
1054
1056
  } : {}, ..._MODEL?.tools ? { // https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking
1055
1057
  tools: options.tools ?? toolsClaude.map(x => x.def),
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.44",
4
+ "version": "1998.2.45",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -20,7 +20,7 @@ const manifest = {
20
20
  },
21
21
  "dependencies": {
22
22
  "file-type": "^20.4.0",
23
- "mathjs": "^14.3.0",
23
+ "mathjs": "^14.3.1",
24
24
  "uuid": "^11.1.0"
25
25
  },
26
26
  "devDependencies": {
@@ -32,36 +32,36 @@ const manifest = {
32
32
  "@google-cloud/storage": "^7.15.2",
33
33
  "@google-cloud/text-to-speech": "^5.8.1",
34
34
  "@google-cloud/vision": "^4.3.3",
35
- "@google/generative-ai": "^0.22.0",
35
+ "@google/generative-ai": "^0.24.0",
36
36
  "@mozilla/readability": "github:mozilla/readability",
37
37
  "@ngrok/ngrok": "^1.4.1",
38
- "@sentry/node": "^9.3.0",
39
- "@sentry/profiling-node": "^9.3.0",
38
+ "@sentry/node": "^9.5.0",
39
+ "@sentry/profiling-node": "^9.5.0",
40
40
  "acme-client": "^5.4.0",
41
41
  "browserify-fs": "^1.0.0",
42
42
  "buffer": "^6.0.3",
43
43
  "fast-geoip": "^1.1.88",
44
44
  "fluent-ffmpeg": "^2.1.3",
45
45
  "form-data": "^4.0.2",
46
- "ioredis": "^5.5.0",
46
+ "ioredis": "^5.6.0",
47
47
  "js-tiktoken": "^1.0.19",
48
48
  "jsdom": "^26.0.0",
49
49
  "lorem-ipsum": "^2.0.8",
50
- "mailgun.js": "^12.0.0",
50
+ "mailgun.js": "^12.0.1",
51
51
  "mailparser": "^3.7.2",
52
52
  "mime": "^4.0.6",
53
- "mysql2": "^3.12.0",
54
- "node-mailjet": "^6.0.6",
53
+ "mysql2": "^3.13.0",
54
+ "node-mailjet": "^6.0.7",
55
55
  "node-polyfill-webpack-plugin": "^4.1.0",
56
56
  "office-text-extractor": "^3.0.3",
57
57
  "ollama": "^0.5.14",
58
- "openai": "^4.86.1",
58
+ "openai": "^4.86.2",
59
59
  "pdfjs-dist": "^4.10.38",
60
60
  "pg": "^8.13.3",
61
61
  "pgvector": "^0.2.0",
62
62
  "ping": "^0.4.4",
63
63
  "process": "^0.11.10",
64
- "puppeteer": "^24.3.0",
64
+ "puppeteer": "^24.4.0",
65
65
  "say": "^0.16.0",
66
66
  "telegraf": "^4.16.3",
67
67
  "telesignsdk": "^3.0.2",
@@ -70,7 +70,7 @@ const manifest = {
70
70
  "url": "github:Leask/node-url",
71
71
  "webpack-cli": "^6.0.1",
72
72
  "whisper-node": "^1.1.1",
73
- "wrangler": "^3.111.0",
73
+ "wrangler": "^3.114.0",
74
74
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz",
75
75
  "youtube-transcript": "^1.2.1"
76
76
  }
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.44",
4
+ "version": "1998.2.45",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "file-type": "^20.4.0",
34
- "mathjs": "^14.3.0",
34
+ "mathjs": "^14.3.1",
35
35
  "uuid": "^11.1.0"
36
36
  },
37
37
  "devDependencies": {
@@ -43,36 +43,36 @@
43
43
  "@google-cloud/storage": "^7.15.2",
44
44
  "@google-cloud/text-to-speech": "^5.8.1",
45
45
  "@google-cloud/vision": "^4.3.3",
46
- "@google/generative-ai": "^0.22.0",
46
+ "@google/generative-ai": "^0.24.0",
47
47
  "@mozilla/readability": "github:mozilla/readability",
48
48
  "@ngrok/ngrok": "^1.4.1",
49
- "@sentry/node": "^9.3.0",
50
- "@sentry/profiling-node": "^9.3.0",
49
+ "@sentry/node": "^9.5.0",
50
+ "@sentry/profiling-node": "^9.5.0",
51
51
  "acme-client": "^5.4.0",
52
52
  "browserify-fs": "^1.0.0",
53
53
  "buffer": "^6.0.3",
54
54
  "fast-geoip": "^1.1.88",
55
55
  "fluent-ffmpeg": "^2.1.3",
56
56
  "form-data": "^4.0.2",
57
- "ioredis": "^5.5.0",
57
+ "ioredis": "^5.6.0",
58
58
  "js-tiktoken": "^1.0.19",
59
59
  "jsdom": "^26.0.0",
60
60
  "lorem-ipsum": "^2.0.8",
61
- "mailgun.js": "^12.0.0",
61
+ "mailgun.js": "^12.0.1",
62
62
  "mailparser": "^3.7.2",
63
63
  "mime": "^4.0.6",
64
- "mysql2": "^3.12.0",
65
- "node-mailjet": "^6.0.6",
64
+ "mysql2": "^3.13.0",
65
+ "node-mailjet": "^6.0.7",
66
66
  "node-polyfill-webpack-plugin": "^4.1.0",
67
67
  "office-text-extractor": "^3.0.3",
68
68
  "ollama": "^0.5.14",
69
- "openai": "^4.86.1",
69
+ "openai": "^4.86.2",
70
70
  "pdfjs-dist": "^4.10.38",
71
71
  "pg": "^8.13.3",
72
72
  "pgvector": "^0.2.0",
73
73
  "ping": "^0.4.4",
74
74
  "process": "^0.11.10",
75
- "puppeteer": "^24.3.0",
75
+ "puppeteer": "^24.4.0",
76
76
  "say": "^0.16.0",
77
77
  "telegraf": "^4.16.3",
78
78
  "telesignsdk": "^3.0.2",
@@ -81,7 +81,7 @@
81
81
  "url": "github:Leask/node-url",
82
82
  "webpack-cli": "^6.0.1",
83
83
  "whisper-node": "^1.1.1",
84
- "wrangler": "^3.111.0",
84
+ "wrangler": "^3.114.0",
85
85
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz",
86
86
  "youtube-transcript": "^1.2.1"
87
87
  }