@sprucelabs/sprucebot-llm 15.1.3 → 15.1.4

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.
@@ -66,7 +66,8 @@ class AnthropicAdapter {
66
66
  type: this.isThinkingEnabled ? 'adaptive' : 'disabled',
67
67
  },
68
68
  }, sendOptions);
69
- this.log?.info('Received response from Anthropic', JSON.stringify(response, null, 2));
69
+ const { usage } = response;
70
+ this.log?.info(`[TOKEN USAGE] input=${usage.input_tokens} cache_create=${usage.cache_creation_input_tokens ?? 0} cache_read=${usage.cache_read_input_tokens ?? 0} output=${usage.output_tokens}`);
70
71
  const text = response.content
71
72
  .filter((block) => block.type === 'text')
72
73
  ?.map((block) => block.text)
@@ -39,7 +39,7 @@ class AnthropicAdapter {
39
39
  }
40
40
  sendHandler(params, sendOptions) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
- var _a, _b;
42
+ var _a, _b, _c, _d;
43
43
  const { messages: openAiMessages, model } = params;
44
44
  const messages = [];
45
45
  const cacheMarkerIdx = openAiMessages.findIndex((msg) => msg.cache_marker);
@@ -71,9 +71,10 @@ class AnthropicAdapter {
71
71
  type: this.isThinkingEnabled ? 'adaptive' : 'disabled',
72
72
  },
73
73
  }, sendOptions);
74
- (_a = this.log) === null || _a === void 0 ? void 0 : _a.info('Received response from Anthropic', JSON.stringify(response, null, 2));
75
- const text = (_b = response.content
76
- .filter((block) => block.type === 'text')) === null || _b === void 0 ? void 0 : _b.map((block) => block.text).join('').trim();
74
+ const { usage } = response;
75
+ (_a = this.log) === null || _a === void 0 ? void 0 : _a.info(`[TOKEN USAGE] input=${usage.input_tokens} cache_create=${(_b = usage.cache_creation_input_tokens) !== null && _b !== void 0 ? _b : 0} cache_read=${(_c = usage.cache_read_input_tokens) !== null && _c !== void 0 ? _c : 0} output=${usage.output_tokens}`);
76
+ const text = (_d = response.content
77
+ .filter((block) => block.type === 'text')) === null || _d === void 0 ? void 0 : _d.map((block) => block.text).join('').trim();
77
78
  return text;
78
79
  });
79
80
  }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "eta"
9
9
  ]
10
10
  },
11
- "version": "15.1.3",
11
+ "version": "15.1.4",
12
12
  "files": [
13
13
  "build"
14
14
  ],