ai 3.4.28 → 3.4.30

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,22 @@
1
1
  # ai
2
2
 
3
+ ## 3.4.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a85c965]
8
+ - @ai-sdk/ui-utils@0.0.50
9
+ - @ai-sdk/react@0.0.69
10
+ - @ai-sdk/solid@0.0.54
11
+ - @ai-sdk/svelte@0.0.57
12
+ - @ai-sdk/vue@0.0.59
13
+
14
+ ## 3.4.29
15
+
16
+ ### Patch Changes
17
+
18
+ - 54b56f7: feat (ai/core): send tool and tool choice telemetry data
19
+
3
20
  ## 3.4.28
4
21
 
5
22
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3444,6 +3444,16 @@ async function generateText({
3444
3444
  "ai.prompt.messages": {
3445
3445
  input: () => JSON.stringify(promptMessages)
3446
3446
  },
3447
+ "ai.prompt.tools": {
3448
+ // convert the language model level tools:
3449
+ input: () => {
3450
+ var _a12;
3451
+ return (_a12 = mode.tools) == null ? void 0 : _a12.map((tool2) => JSON.stringify(tool2));
3452
+ }
3453
+ },
3454
+ "ai.prompt.toolChoice": {
3455
+ input: () => mode.toolChoice != null ? JSON.stringify(mode.toolChoice) : void 0
3456
+ },
3447
3457
  // standardized gen-ai llm span attributes:
3448
3458
  "gen_ai.system": model.provider,
3449
3459
  "gen_ai.request.model": model.modelId,
@@ -4135,6 +4145,10 @@ async function streamText({
4135
4145
  modelSupportsImageUrls: model.supportsImageUrls,
4136
4146
  modelSupportsUrl: model.supportsUrl
4137
4147
  });
4148
+ const mode = {
4149
+ type: "regular",
4150
+ ...prepareToolsAndToolChoice({ tools, toolChoice, activeTools })
4151
+ };
4138
4152
  const {
4139
4153
  result: { stream: stream2, warnings: warnings2, rawResponse: rawResponse2, request: request2 },
4140
4154
  doStreamSpan: doStreamSpan2,
@@ -4156,6 +4170,16 @@ async function streamText({
4156
4170
  "ai.prompt.messages": {
4157
4171
  input: () => JSON.stringify(promptMessages)
4158
4172
  },
4173
+ "ai.prompt.tools": {
4174
+ // convert the language model level tools:
4175
+ input: () => {
4176
+ var _a11;
4177
+ return (_a11 = mode.tools) == null ? void 0 : _a11.map((tool2) => JSON.stringify(tool2));
4178
+ }
4179
+ },
4180
+ "ai.prompt.toolChoice": {
4181
+ input: () => mode.toolChoice != null ? JSON.stringify(mode.toolChoice) : void 0
4182
+ },
4159
4183
  // standardized gen-ai llm span attributes:
4160
4184
  "gen_ai.system": model.provider,
4161
4185
  "gen_ai.request.model": model.modelId,
@@ -4175,14 +4199,7 @@ async function streamText({
4175
4199
  // get before the call
4176
4200
  doStreamSpan: doStreamSpan3,
4177
4201
  result: await model.doStream({
4178
- mode: {
4179
- type: "regular",
4180
- ...prepareToolsAndToolChoice({
4181
- tools,
4182
- toolChoice,
4183
- activeTools
4184
- })
4185
- },
4202
+ mode,
4186
4203
  ...prepareCallSettings(settings),
4187
4204
  inputFormat: promptFormat,
4188
4205
  prompt: promptMessages,