ai 6.0.73 → 6.0.74

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.74
4
+
5
+ ### Patch Changes
6
+
7
+ - 471009b: fix(ai): pass reasoning text in telemetry
8
+
3
9
  ## 6.0.73
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1205,7 +1205,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1205
1205
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1206
1206
 
1207
1207
  // src/version.ts
1208
- var VERSION = true ? "6.0.73" : "0.0.0-test";
1208
+ var VERSION = true ? "6.0.74" : "0.0.0-test";
1209
1209
 
1210
1210
  // src/util/download/download.ts
1211
1211
  var download = async ({ url }) => {
@@ -2831,6 +2831,14 @@ async function executeToolCall({
2831
2831
  });
2832
2832
  }
2833
2833
 
2834
+ // src/generate-text/extract-reasoning-content.ts
2835
+ function extractReasoningContent(content) {
2836
+ const parts = content.filter(
2837
+ (content2) => content2.type === "reasoning"
2838
+ );
2839
+ return parts.length === 0 ? void 0 : parts.map((content2) => content2.text).join("\n");
2840
+ }
2841
+
2834
2842
  // src/generate-text/extract-text-content.ts
2835
2843
  function extractTextContent(content) {
2836
2844
  const parts = content.filter(
@@ -4192,6 +4200,9 @@ async function generateText({
4192
4200
  "ai.response.text": {
4193
4201
  output: () => extractTextContent(result.content)
4194
4202
  },
4203
+ "ai.response.reasoning": {
4204
+ output: () => extractReasoningContent(result.content)
4205
+ },
4195
4206
  "ai.response.toolCalls": {
4196
4207
  output: () => {
4197
4208
  const toolCalls = asToolCalls(result.content);
@@ -4377,6 +4388,9 @@ async function generateText({
4377
4388
  "ai.response.text": {
4378
4389
  output: () => extractTextContent(currentModelResponse.content)
4379
4390
  },
4391
+ "ai.response.reasoning": {
4392
+ output: () => extractReasoningContent(currentModelResponse.content)
4393
+ },
4380
4394
  "ai.response.toolCalls": {
4381
4395
  output: () => {
4382
4396
  const toolCalls = asToolCalls(currentModelResponse.content);
@@ -6474,6 +6488,9 @@ var DefaultStreamTextResult = class {
6474
6488
  attributes: {
6475
6489
  "ai.response.finishReason": finishReason,
6476
6490
  "ai.response.text": { output: () => finalStep.text },
6491
+ "ai.response.reasoning": {
6492
+ output: () => finalStep.reasoningText
6493
+ },
6477
6494
  "ai.response.toolCalls": {
6478
6495
  output: () => {
6479
6496
  var _a21;
@@ -7019,6 +7036,14 @@ var DefaultStreamTextResult = class {
7019
7036
  "ai.response.text": {
7020
7037
  output: () => activeText
7021
7038
  },
7039
+ "ai.response.reasoning": {
7040
+ output: () => {
7041
+ const reasoningParts = recordedContent.filter(
7042
+ (c) => c.type === "reasoning"
7043
+ );
7044
+ return reasoningParts.length > 0 ? reasoningParts.map((r) => r.text).join("\n") : void 0;
7045
+ }
7046
+ },
7022
7047
  "ai.response.toolCalls": {
7023
7048
  output: () => stepToolCallsJson
7024
7049
  },
@@ -9150,14 +9175,6 @@ var experimental_generateImage = generateImage;
9150
9175
  // src/generate-object/generate-object.ts
9151
9176
  var import_provider_utils28 = require("@ai-sdk/provider-utils");
9152
9177
 
9153
- // src/generate-text/extract-reasoning-content.ts
9154
- function extractReasoningContent(content) {
9155
- const parts = content.filter(
9156
- (content2) => content2.type === "reasoning"
9157
- );
9158
- return parts.length === 0 ? void 0 : parts.map((content2) => content2.text).join("\n");
9159
- }
9160
-
9161
9178
  // src/generate-object/output-strategy.ts
9162
9179
  var import_provider30 = require("@ai-sdk/provider");
9163
9180
  var import_provider_utils26 = require("@ai-sdk/provider-utils");