@xsai-ext/telemetry 0.4.0-beta.8 → 0.4.0-beta.9
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/dist/index.js +8 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -416,11 +416,17 @@ const streamText = (options) => {
|
|
|
416
416
|
for (const toolCall of choice.delta.tool_calls) {
|
|
417
417
|
const { index } = toolCall;
|
|
418
418
|
if (!tool_calls.at(index)) {
|
|
419
|
-
tool_calls[index] =
|
|
419
|
+
tool_calls[index] = {
|
|
420
|
+
...toolCall,
|
|
421
|
+
function: {
|
|
422
|
+
...toolCall.function,
|
|
423
|
+
arguments: toolCall.function.arguments
|
|
424
|
+
}
|
|
425
|
+
};
|
|
420
426
|
pushEvent({ toolCallId: toolCall.id, toolName: toolCall.function.name, type: "tool-call-streaming-start" });
|
|
421
427
|
} else {
|
|
422
428
|
tool_calls[index].function.arguments += toolCall.function.arguments;
|
|
423
|
-
pushEvent({ argsTextDelta: toolCall.function.arguments, toolCallId: toolCall.id, toolName: toolCall.function.name, type: "tool-call-delta" });
|
|
429
|
+
pushEvent({ argsTextDelta: toolCall.function.arguments, toolCallId: toolCall.id, toolName: toolCall.function.name ?? tool_calls[index].function.name, type: "tool-call-delta" });
|
|
424
430
|
}
|
|
425
431
|
}
|
|
426
432
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai-ext/telemetry",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.0-beta.
|
|
4
|
+
"version": "0.4.0-beta.9",
|
|
5
5
|
"description": "extra-small AI SDK.",
|
|
6
6
|
"author": "Moeru AI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@opentelemetry/api": "^1.9.0",
|
|
33
|
-
"xsai": "~0.4.0-beta.
|
|
33
|
+
"xsai": "~0.4.0-beta.9"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@opentelemetry/sdk-trace-base": "^2.0.1",
|