@posthog/ai 8.6.5 → 8.6.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.
@@ -151,7 +151,7 @@ const truncate = input => {
151
151
  return `${truncatedStr}... [truncated]`;
152
152
  };
153
153
 
154
- var version = "8.6.5";
154
+ var version = "8.6.6";
155
155
 
156
156
  // Warn when a wrapper's base_url points at the PostHog AI Gateway: the gateway
157
157
  // emits its own $ai_generation, so each call would be captured (and, for billable
@@ -149,7 +149,7 @@ const truncate = input => {
149
149
  return `${truncatedStr}... [truncated]`;
150
150
  };
151
151
 
152
- var version = "8.6.5";
152
+ var version = "8.6.6";
153
153
 
154
154
  // Warn when a wrapper's base_url points at the PostHog AI Gateway: the gateway
155
155
  // emits its own $ai_generation, so each call would be captured (and, for billable
@@ -408,7 +408,7 @@ function sanitizeValues(obj) {
408
408
  return jsonSafe;
409
409
  }
410
410
 
411
- var version = "8.6.5";
411
+ var version = "8.6.6";
412
412
 
413
413
  const DEFAULT_MAX_DEPTH = 3;
414
414
  const MAX_STACK_LINES = 20;
@@ -606,7 +606,9 @@ const captureAiGeneration = async (client, options) => {
606
606
  $ai_output_tokens: usage.outputTokens
607
607
  } : {}),
608
608
  ...additionalTokenValues,
609
- $ai_latency: options.latency ?? 0,
609
+ ...(options.latency !== undefined ? {
610
+ $ai_latency: options.latency
611
+ } : {}),
610
612
  ...(options.timeToFirstToken !== undefined ? {
611
613
  $ai_time_to_first_token: options.timeToFirstToken
612
614
  } : {}),