@posthog/ai 8.15.1 → 8.16.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.
@@ -459,7 +459,7 @@ function addDefaults(params) {
459
459
  }
460
460
  //#endregion
461
461
  //#region package.json
462
- var version = "8.15.1";
462
+ var version = "8.16.0";
463
463
  //#endregion
464
464
  //#region src/serializeError.ts
465
465
  const DEFAULT_MAX_DEPTH = 3;
@@ -715,7 +715,7 @@ function formatToolResult(content, client, maxBytes = 5e3) {
715
715
  /** Map Gemini usage metadata to PostHog's provider-agnostic token fields. */
716
716
  function mapGeminiUsage(metadata, additionalUsage = {}) {
717
717
  return {
718
- inputTokens: metadata?.promptTokenCount ?? 0,
718
+ inputTokens: (metadata?.promptTokenCount ?? 0) + (metadata?.toolUsePromptTokenCount ?? 0),
719
719
  outputTokens: metadata?.candidatesTokenCount ?? 0,
720
720
  reasoningTokens: metadata?.thoughtsTokenCount ?? 0,
721
721
  cacheReadInputTokens: metadata?.cachedContentTokenCount ?? 0,