@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.
@@ -406,7 +406,7 @@ function sanitizeValues(obj) {
406
406
  return jsonSafe;
407
407
  }
408
408
 
409
- var version = "8.6.5";
409
+ var version = "8.6.6";
410
410
 
411
411
  const DEFAULT_MAX_DEPTH = 3;
412
412
  const MAX_STACK_LINES = 20;
@@ -604,7 +604,9 @@ const captureAiGeneration = async (client, options) => {
604
604
  $ai_output_tokens: usage.outputTokens
605
605
  } : {}),
606
606
  ...additionalTokenValues,
607
- $ai_latency: options.latency ?? 0,
607
+ ...(options.latency !== undefined ? {
608
+ $ai_latency: options.latency
609
+ } : {}),
608
610
  ...(options.timeToFirstToken !== undefined ? {
609
611
  $ai_time_to_first_token: options.timeToFirstToken
610
612
  } : {}),