ai 4.3.3 → 4.3.5
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/CHANGELOG.md +17 -0
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
@@ -6304,7 +6304,7 @@ async function transcribe({
|
|
6304
6304
|
headers
|
6305
6305
|
}) {
|
6306
6306
|
const { retry } = prepareRetries({ maxRetries: maxRetriesArg });
|
6307
|
-
const audioData = audio instanceof URL ?
|
6307
|
+
const audioData = audio instanceof URL ? (await download({ url: audio })).data : convertDataContentToUint8Array(audio);
|
6308
6308
|
const result = await retry(
|
6309
6309
|
() => {
|
6310
6310
|
var _a17;
|
@@ -6313,7 +6313,7 @@ async function transcribe({
|
|
6313
6313
|
abortSignal,
|
6314
6314
|
headers,
|
6315
6315
|
providerOptions,
|
6316
|
-
|
6316
|
+
mediaType: (_a17 = detectMimeType({
|
6317
6317
|
data: audioData,
|
6318
6318
|
signatures: audioMimeTypeSignatures
|
6319
6319
|
})) != null ? _a17 : "audio/wav"
|
@@ -7473,6 +7473,7 @@ var MCPClient = class {
|
|
7473
7473
|
async tools({
|
7474
7474
|
schemas = "automatic"
|
7475
7475
|
} = {}) {
|
7476
|
+
var _a17;
|
7476
7477
|
const tools = {};
|
7477
7478
|
try {
|
7478
7479
|
const listToolsResult = await this.listTools();
|
@@ -7480,14 +7481,18 @@ var MCPClient = class {
|
|
7480
7481
|
if (schemas !== "automatic" && !(name17 in schemas)) {
|
7481
7482
|
continue;
|
7482
7483
|
}
|
7483
|
-
const parameters = schemas === "automatic" ? jsonSchema(
|
7484
|
+
const parameters = schemas === "automatic" ? jsonSchema({
|
7485
|
+
...inputSchema,
|
7486
|
+
properties: (_a17 = inputSchema.properties) != null ? _a17 : {},
|
7487
|
+
additionalProperties: false
|
7488
|
+
}) : schemas[name17].parameters;
|
7484
7489
|
const self = this;
|
7485
7490
|
const toolWithExecute = tool({
|
7486
7491
|
description,
|
7487
7492
|
parameters,
|
7488
7493
|
execute: async (args, options) => {
|
7489
|
-
var
|
7490
|
-
(
|
7494
|
+
var _a18;
|
7495
|
+
(_a18 = options == null ? void 0 : options.abortSignal) == null ? void 0 : _a18.throwIfAborted();
|
7491
7496
|
return self.callTool({
|
7492
7497
|
name: name17,
|
7493
7498
|
args,
|