@posthog/ai 8.18.5 → 8.18.6

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.
@@ -388,7 +388,7 @@ function addDefaults(params) {
388
388
  }
389
389
  //#endregion
390
390
  //#region package.json
391
- var version = "8.18.5";
391
+ var version = "8.18.6";
392
392
  //#endregion
393
393
  //#region src/serializeError.ts
394
394
  const DEFAULT_MAX_DEPTH = 3;
@@ -1140,6 +1140,7 @@ var WrappedMessages = class extends AnthropicOriginal.Messages {
1140
1140
  ...Object.fromEntries(Object.entries(chunk.usage).filter(([, value]) => value != null))
1141
1141
  };
1142
1142
  usage.outputTokens = chunk.usage.output_tokens ?? 0;
1143
+ if (chunk.usage.output_tokens_details?.thinking_tokens != null) usage.reasoningTokens = chunk.usage.output_tokens_details.thinking_tokens;
1143
1144
  usage.inputTokens = Math.max(usage.inputTokens ?? 0, chunk.usage.input_tokens ?? 0);
1144
1145
  usage.cacheCreationInputTokens = Math.max(usage.cacheCreationInputTokens ?? 0, chunk.usage.cache_creation_input_tokens ?? 0);
1145
1146
  usage.cacheReadInputTokens = Math.max(usage.cacheReadInputTokens ?? 0, chunk.usage.cache_read_input_tokens ?? 0);
@@ -1237,6 +1238,7 @@ var WrappedMessages = class extends AnthropicOriginal.Messages {
1237
1238
  usage: {
1238
1239
  inputTokens: result.usage.input_tokens ?? 0,
1239
1240
  outputTokens: result.usage.output_tokens ?? 0,
1241
+ reasoningTokens: result.usage.output_tokens_details?.thinking_tokens ?? 0,
1240
1242
  cacheCreationInputTokens: result.usage.cache_creation_input_tokens ?? 0,
1241
1243
  cacheReadInputTokens: result.usage.cache_read_input_tokens ?? 0,
1242
1244
  webSearchCount: result.usage.server_tool_use?.web_search_requests ?? 0,