utilitas 2000.3.17 → 2000.3.19

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
@@ -844,6 +844,12 @@ const promptOpenAI = async (aiId, content, options = {}) => {
844
844
  const packedTools = (targetModel.endsWith(ONLINE)
845
845
  ? _tools.filter(x => x?.replaced !== ONLINE)
846
846
  : _tools).map(x => x.def);
847
+ if (source === S_GOOGLE) {
848
+ packedTools.push(...[
849
+ { googleSearch: {} }, { codeExecution: {} }, { urlContext: {} },
850
+ // { googleMaps: {} }, // https://ai.google.dev/gemini-api/docs/maps-grounding // NOT for Gemini 3
851
+ ]);
852
+ }
847
853
  const resp = await client.chat.completions.create({
848
854
  model: targetModel, ...history,
849
855
  ...options.jsonMode ? { response_format: { type: JSON_OBJECT } } : {},
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.17",
4
+ "version": "2000.3.19",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/vision.mjs CHANGED
@@ -13,8 +13,8 @@ const _NEED = ['office-text-extractor', 'pdfjs-dist', 'pdf-lib', 'tesseract.js']
13
13
  const clients = {};
14
14
  const errorMessage = 'Invalid input data.';
15
15
  const log = content => _log(content, import.meta.url);
16
- const [DEFAULT_LANG, GOOGLE_MISTRAL, MISTRAL_OCR_MODEL]
17
- = ['eng', 'GOOGLE_MISTRAL', 'mistral-ocr-2505'];
16
+ const [DEFAULT_LANG, GOOGLE_MISTRAL, MISTRAL_OCR_MODEL, MISTRAL_PAGE_LIMIT]
17
+ = ['eng', 'GOOGLE_MISTRAL', 'mistral-ocr-2505', 30];
18
18
 
19
19
  const init = async (options) => {
20
20
  const provider = ensureString(options?.provider || GOOGLE_MISTRAL, { case: 'UP' });
@@ -148,7 +148,7 @@ const ocr = async (file, options = {}) => {
148
148
  case GOOGLE_MISTRAL:
149
149
  const key = await getGoogleAuthTokenByAuth(client.auth);
150
150
  const inputPdfs = await splitPdf(file, {
151
- ...options, expected: DATAURL, size: 2,
151
+ ...options, expected: DATAURL, size: MISTRAL_PAGE_LIMIT,
152
152
  });
153
153
  const resps = (await Promise.all(inputPdfs.map(
154
154
  async document_url => await (await fetch(
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.17",
4
+ "version": "2000.3.19",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",