@botbotgo/better-call 0.1.37 → 0.1.38

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/demo.mjs +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/better-call",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Small-model tool-call reliability layer for LangChain and custom agent runtimes.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/scripts/demo.mjs CHANGED
@@ -158,6 +158,19 @@ try {
158
158
  };
159
159
  }
160
160
 
161
+ const gatewayRepair =
162
+ gatewayResult != null && typeof gatewayResult === "object"
163
+ ? gatewayResult
164
+ : {
165
+ status: "error",
166
+ originalToolName: "research",
167
+ toolName: null,
168
+ reason: "repairToolCall returned no result.",
169
+ errorType: null,
170
+ errorMessage: null,
171
+ errorCause: null,
172
+ };
173
+
161
174
  const repairedCalls = Array.isArray(reliableResult?.calls) ? reliableResult.calls : null;
162
175
  const repairedCall = repairedCalls && repairedCalls.length > 0 ? repairedCalls[0] : null;
163
176
 
@@ -171,7 +184,7 @@ const report = {
171
184
  repaired: repairedCall,
172
185
  diagnostics: reliableResult?.diagnostics ?? null,
173
186
  },
174
- gatewayRepair: gatewayResult,
187
+ gatewayRepair,
175
188
  };
176
189
 
177
190
  if (json) {