utilitas 1999.1.71 → 1999.1.72

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/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": "1999.1.71",
4
+ "version": "1999.1.72",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/speech.mjs CHANGED
@@ -3,7 +3,7 @@ import { getApiKeyCredentials, hash } from './encryption.mjs';
3
3
  import { getFfmpeg, packPcmToWav } from './media.mjs';
4
4
  import { get } from './web.mjs';
5
5
  import { convert, getTempPath } from './storage.mjs';
6
- import { ensureString } from './utilitas.mjs';
6
+ import { ensureString, mergeAtoB } from './utilitas.mjs';
7
7
 
8
8
  import {
9
9
  call, countKeys, ignoreErrFunc, inBrowser,
@@ -180,7 +180,7 @@ const ttsGoogle = async (contents, options) => {
180
180
  assert(await countTokens(contents) <= k(32), 'Text is too long.', 400);
181
181
  const resp = await clients.tts({
182
182
  model: options?.model || defaultGeminiTtsModel, contents,
183
- config: {
183
+ config: mergeAtoB(options?.config, {
184
184
  responseModalities: ['AUDIO'],
185
185
  speechConfig: {
186
186
  voiceConfig: {
@@ -189,7 +189,7 @@ const ttsGoogle = async (contents, options) => {
189
189
  },
190
190
  },
191
191
  },
192
- },
192
+ }),
193
193
  });
194
194
  const rawAudio = resp?.candidates?.[0]?.content?.parts?.[0]?.inlineData;
195
195
  assert(rawAudio, 'Failed to generate audio.', 500);
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": "1999.1.71",
4
+ "version": "1999.1.72",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",