ai 5.0.62 → 5.0.63
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 +7 -0
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -17
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 5.0.63
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 22609f8: fix(ai): only parse experimental_output in generateText when finishReason is stop
|
|
8
|
+
- b552c94: fix(core): Fix image download behavior when the initial model is swapped out during prepareStep
|
|
9
|
+
|
|
3
10
|
## 5.0.62
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -791,7 +791,7 @@ function detectMediaType({
|
|
|
791
791
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
792
792
|
|
|
793
793
|
// src/version.ts
|
|
794
|
-
var VERSION = true ? "5.0.
|
|
794
|
+
var VERSION = true ? "5.0.63" : "0.0.0-test";
|
|
795
795
|
|
|
796
796
|
// src/util/download/download.ts
|
|
797
797
|
var download = async ({ url }) => {
|
|
@@ -2314,17 +2314,17 @@ async function generateText({
|
|
|
2314
2314
|
stepNumber: steps.length,
|
|
2315
2315
|
messages: stepInputMessages
|
|
2316
2316
|
}));
|
|
2317
|
+
const stepModel = resolveLanguageModel(
|
|
2318
|
+
(_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model
|
|
2319
|
+
);
|
|
2317
2320
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
2318
2321
|
prompt: {
|
|
2319
|
-
system: (
|
|
2320
|
-
messages: (
|
|
2322
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
2323
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
2321
2324
|
},
|
|
2322
|
-
supportedUrls: await
|
|
2325
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
2323
2326
|
download: download2
|
|
2324
2327
|
});
|
|
2325
|
-
const stepModel = resolveLanguageModel(
|
|
2326
|
-
(_c = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _c : model
|
|
2327
|
-
);
|
|
2328
2328
|
const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
|
|
2329
2329
|
tools,
|
|
2330
2330
|
toolChoice: (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _d : toolChoice,
|
|
@@ -2543,16 +2543,20 @@ async function generateText({
|
|
|
2543
2543
|
})
|
|
2544
2544
|
);
|
|
2545
2545
|
const lastStep = steps[steps.length - 1];
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
resolvedOutput
|
|
2546
|
+
let resolvedOutput;
|
|
2547
|
+
if (lastStep.finishReason === "stop") {
|
|
2548
|
+
resolvedOutput = await (output == null ? void 0 : output.parseOutput(
|
|
2549
2549
|
{ text: lastStep.text },
|
|
2550
2550
|
{
|
|
2551
2551
|
response: lastStep.response,
|
|
2552
2552
|
usage: lastStep.usage,
|
|
2553
2553
|
finishReason: lastStep.finishReason
|
|
2554
2554
|
}
|
|
2555
|
-
))
|
|
2555
|
+
));
|
|
2556
|
+
}
|
|
2557
|
+
return new DefaultGenerateTextResult({
|
|
2558
|
+
steps,
|
|
2559
|
+
resolvedOutput
|
|
2556
2560
|
});
|
|
2557
2561
|
}
|
|
2558
2562
|
});
|
|
@@ -4993,17 +4997,17 @@ var DefaultStreamTextResult = class {
|
|
|
4993
4997
|
stepNumber: recordedSteps.length,
|
|
4994
4998
|
messages: stepInputMessages
|
|
4995
4999
|
}));
|
|
5000
|
+
const stepModel = resolveLanguageModel(
|
|
5001
|
+
(_a17 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a17 : model
|
|
5002
|
+
);
|
|
4996
5003
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
4997
5004
|
prompt: {
|
|
4998
|
-
system: (
|
|
4999
|
-
messages: (
|
|
5005
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
5006
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
5000
5007
|
},
|
|
5001
|
-
supportedUrls: await
|
|
5008
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
5002
5009
|
download: download2
|
|
5003
5010
|
});
|
|
5004
|
-
const stepModel = resolveLanguageModel(
|
|
5005
|
-
(_c = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _c : model
|
|
5006
|
-
);
|
|
5007
5011
|
const { toolChoice: stepToolChoice, tools: stepTools } = prepareToolsAndToolChoice({
|
|
5008
5012
|
tools,
|
|
5009
5013
|
toolChoice: (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _d : toolChoice,
|