ai 3.3.38 → 3.3.39
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.d.mts +16 -7
- package/dist/index.d.ts +16 -7
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -2998,6 +2998,7 @@ async function generateText({
|
|
2998
2998
|
generateId: generateId3 = originalGenerateId3,
|
2999
2999
|
currentDate = () => /* @__PURE__ */ new Date()
|
3000
3000
|
} = {},
|
3001
|
+
onStepFinish,
|
3001
3002
|
...settings
|
3002
3003
|
}) {
|
3003
3004
|
var _a11;
|
@@ -3159,7 +3160,7 @@ async function generateText({
|
|
3159
3160
|
usage.completionTokens += currentUsage.completionTokens;
|
3160
3161
|
usage.promptTokens += currentUsage.promptTokens;
|
3161
3162
|
usage.totalTokens += currentUsage.totalTokens;
|
3162
|
-
|
3163
|
+
const currentStep = {
|
3163
3164
|
text: (_b = currentModelResponse.text) != null ? _b : "",
|
3164
3165
|
toolCalls: currentToolCalls,
|
3165
3166
|
toolResults: currentToolResults,
|
@@ -3170,8 +3171,11 @@ async function generateText({
|
|
3170
3171
|
response: {
|
3171
3172
|
...currentModelResponse.response,
|
3172
3173
|
headers: (_c = currentModelResponse.rawResponse) == null ? void 0 : _c.headers
|
3173
|
-
}
|
3174
|
-
|
3174
|
+
},
|
3175
|
+
experimental_providerMetadata: currentModelResponse.providerMetadata
|
3176
|
+
};
|
3177
|
+
steps.push(currentStep);
|
3178
|
+
await (onStepFinish == null ? void 0 : onStepFinish(currentStep));
|
3175
3179
|
const newResponseMessages = toResponseMessages({
|
3176
3180
|
text: currentModelResponse.text,
|
3177
3181
|
toolCalls: currentToolCalls,
|
@@ -4037,7 +4041,8 @@ var DefaultStreamTextResult = class {
|
|
4037
4041
|
warnings: self.warnings,
|
4038
4042
|
logprobs: stepLogProbs,
|
4039
4043
|
response: stepResponse,
|
4040
|
-
rawResponse: self.rawResponse
|
4044
|
+
rawResponse: self.rawResponse,
|
4045
|
+
experimental_providerMetadata: stepProviderMetadata
|
4041
4046
|
};
|
4042
4047
|
stepResults.push(stepResult);
|
4043
4048
|
await (onStepFinish == null ? void 0 : onStepFinish(stepResult));
|