@posthog/ai 8.18.5 → 8.19.0

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.
@@ -3,7 +3,7 @@ let _google_adk = require("@google/adk");
3
3
  let uuid = require("uuid");
4
4
  let _posthog_core = require("@posthog/core");
5
5
  //#region package.json
6
- var version = "8.18.5";
6
+ var version = "8.19.0";
7
7
  //#endregion
8
8
  //#region src/typeGuards.ts
9
9
  const isObject = (value) => {
@@ -2,7 +2,7 @@ import { BasePlugin } from "@google/adk";
2
2
  import { v4 } from "uuid";
3
3
  import { toJsonSafeValue, uuidv7 } from "@posthog/core";
4
4
  //#region package.json
5
- var version = "8.18.5";
5
+ var version = "8.19.0";
6
6
  //#endregion
7
7
  //#region src/typeGuards.ts
8
8
  const isObject = (value) => {
@@ -415,7 +415,7 @@ function addDefaults(params) {
415
415
  }
416
416
  //#endregion
417
417
  //#region package.json
418
- var version = "8.18.5";
418
+ var version = "8.19.0";
419
419
  //#endregion
420
420
  //#region src/serializeError.ts
421
421
  const DEFAULT_MAX_DEPTH = 3;
@@ -1167,6 +1167,7 @@ var WrappedMessages = class extends _anthropic_ai_sdk.default.Messages {
1167
1167
  ...Object.fromEntries(Object.entries(chunk.usage).filter(([, value]) => value != null))
1168
1168
  };
1169
1169
  usage.outputTokens = chunk.usage.output_tokens ?? 0;
1170
+ if (chunk.usage.output_tokens_details?.thinking_tokens != null) usage.reasoningTokens = chunk.usage.output_tokens_details.thinking_tokens;
1170
1171
  usage.inputTokens = Math.max(usage.inputTokens ?? 0, chunk.usage.input_tokens ?? 0);
1171
1172
  usage.cacheCreationInputTokens = Math.max(usage.cacheCreationInputTokens ?? 0, chunk.usage.cache_creation_input_tokens ?? 0);
1172
1173
  usage.cacheReadInputTokens = Math.max(usage.cacheReadInputTokens ?? 0, chunk.usage.cache_read_input_tokens ?? 0);
@@ -1264,6 +1265,7 @@ var WrappedMessages = class extends _anthropic_ai_sdk.default.Messages {
1264
1265
  usage: {
1265
1266
  inputTokens: result.usage.input_tokens ?? 0,
1266
1267
  outputTokens: result.usage.output_tokens ?? 0,
1268
+ reasoningTokens: result.usage.output_tokens_details?.thinking_tokens ?? 0,
1267
1269
  cacheCreationInputTokens: result.usage.cache_creation_input_tokens ?? 0,
1268
1270
  cacheReadInputTokens: result.usage.cache_read_input_tokens ?? 0,
1269
1271
  webSearchCount: result.usage.server_tool_use?.web_search_requests ?? 0,