@fallom/trace 0.2.14 → 0.2.15

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 CHANGED
@@ -2474,10 +2474,9 @@ function createGenerateTextWrapper(aiModule, sessionCtx, debug = false) {
2474
2474
  const result = await aiModule.generateText(wrappedParams);
2475
2475
  const endTime = Date.now();
2476
2476
  if (debug || isDebugMode()) {
2477
- console.log(
2478
- "\n\u{1F50D} [Fallom Debug] generateText raw result:",
2479
- JSON.stringify(result, null, 2)
2480
- );
2477
+ console.log("\n\u{1F50D} [Fallom Debug] generateText result:");
2478
+ console.log(" toolCalls:", result?.toolCalls?.length || 0);
2479
+ console.log(" steps:", result?.steps?.length || 0);
2481
2480
  }
2482
2481
  const modelId = result?.response?.modelId || params?.model?.modelId || String(params?.model || "unknown");
2483
2482
  const attributes = {
@@ -2496,15 +2495,15 @@ function createGenerateTextWrapper(aiModule, sessionCtx, debug = false) {
2496
2495
  const mapToolCall = (tc) => ({
2497
2496
  toolCallId: tc?.toolCallId,
2498
2497
  toolName: tc?.toolName,
2499
- args: tc?.args,
2500
- // The actual arguments passed to the tool!
2498
+ args: tc?.args ?? tc?.input,
2499
+ // v4: args, v5: input
2501
2500
  type: tc?.type
2502
2501
  });
2503
2502
  const mapToolResult = (tr) => ({
2504
2503
  toolCallId: tr?.toolCallId,
2505
2504
  toolName: tr?.toolName,
2506
- result: tr?.result,
2507
- // The actual result from the tool!
2505
+ result: tr?.result ?? tr?.output,
2506
+ // v4: result, v5: output
2508
2507
  type: tr?.type
2509
2508
  });
2510
2509
  attributes["fallom.raw.response"] = JSON.stringify({
@@ -2817,15 +2816,15 @@ function createStreamTextWrapper(aiModule, sessionCtx, debug = false) {
2817
2816
  const mapToolCall = (tc) => ({
2818
2817
  toolCallId: tc?.toolCallId,
2819
2818
  toolName: tc?.toolName,
2820
- args: tc?.args,
2821
- // The actual arguments passed to the tool!
2819
+ args: tc?.args ?? tc?.input,
2820
+ // v4: args, v5: input
2822
2821
  type: tc?.type
2823
2822
  });
2824
2823
  const mapToolResult = (tr) => ({
2825
2824
  toolCallId: tr?.toolCallId,
2826
2825
  toolName: tr?.toolName,
2827
- result: tr?.result,
2828
- // The actual result from the tool!
2826
+ result: tr?.result ?? tr?.output,
2827
+ // v4: result, v5: output
2829
2828
  type: tr?.type
2830
2829
  });
2831
2830
  attributes["fallom.raw.request"] = JSON.stringify({
package/dist/index.mjs CHANGED
@@ -1479,10 +1479,9 @@ function createGenerateTextWrapper(aiModule, sessionCtx, debug = false) {
1479
1479
  const result = await aiModule.generateText(wrappedParams);
1480
1480
  const endTime = Date.now();
1481
1481
  if (debug || isDebugMode()) {
1482
- console.log(
1483
- "\n\u{1F50D} [Fallom Debug] generateText raw result:",
1484
- JSON.stringify(result, null, 2)
1485
- );
1482
+ console.log("\n\u{1F50D} [Fallom Debug] generateText result:");
1483
+ console.log(" toolCalls:", result?.toolCalls?.length || 0);
1484
+ console.log(" steps:", result?.steps?.length || 0);
1486
1485
  }
1487
1486
  const modelId = result?.response?.modelId || params?.model?.modelId || String(params?.model || "unknown");
1488
1487
  const attributes = {
@@ -1501,15 +1500,15 @@ function createGenerateTextWrapper(aiModule, sessionCtx, debug = false) {
1501
1500
  const mapToolCall = (tc) => ({
1502
1501
  toolCallId: tc?.toolCallId,
1503
1502
  toolName: tc?.toolName,
1504
- args: tc?.args,
1505
- // The actual arguments passed to the tool!
1503
+ args: tc?.args ?? tc?.input,
1504
+ // v4: args, v5: input
1506
1505
  type: tc?.type
1507
1506
  });
1508
1507
  const mapToolResult = (tr) => ({
1509
1508
  toolCallId: tr?.toolCallId,
1510
1509
  toolName: tr?.toolName,
1511
- result: tr?.result,
1512
- // The actual result from the tool!
1510
+ result: tr?.result ?? tr?.output,
1511
+ // v4: result, v5: output
1513
1512
  type: tr?.type
1514
1513
  });
1515
1514
  attributes["fallom.raw.response"] = JSON.stringify({
@@ -1822,15 +1821,15 @@ function createStreamTextWrapper(aiModule, sessionCtx, debug = false) {
1822
1821
  const mapToolCall = (tc) => ({
1823
1822
  toolCallId: tc?.toolCallId,
1824
1823
  toolName: tc?.toolName,
1825
- args: tc?.args,
1826
- // The actual arguments passed to the tool!
1824
+ args: tc?.args ?? tc?.input,
1825
+ // v4: args, v5: input
1827
1826
  type: tc?.type
1828
1827
  });
1829
1828
  const mapToolResult = (tr) => ({
1830
1829
  toolCallId: tr?.toolCallId,
1831
1830
  toolName: tr?.toolName,
1832
- result: tr?.result,
1833
- // The actual result from the tool!
1831
+ result: tr?.result ?? tr?.output,
1832
+ // v4: result, v5: output
1834
1833
  type: tr?.type
1835
1834
  });
1836
1835
  attributes["fallom.raw.request"] = JSON.stringify({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fallom/trace",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Model A/B testing and tracing for LLM applications. Zero latency, production-ready.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",