ai 3.4.27 → 3.4.29
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 +12 -0
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/dist/index.d.mts +19 -1
- package/test/dist/index.d.ts +19 -1
- package/test/dist/index.js +31 -2
- package/test/dist/index.js.map +1 -1
- package/test/dist/index.mjs +29 -1
- package/test/dist/index.mjs.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# ai
|
2
2
|
|
3
|
+
## 3.4.29
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 54b56f7: feat (ai/core): send tool and tool choice telemetry data
|
8
|
+
|
9
|
+
## 3.4.28
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 29f1390: feat (ai/test): add simulateReadableStream helper
|
14
|
+
|
3
15
|
## 3.4.27
|
4
16
|
|
5
17
|
### 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,
|