@posthog/ai 8.6.3 → 8.6.4

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.
@@ -143,7 +143,7 @@ const truncate = input => {
143
143
  return `${truncatedStr}... [truncated]`;
144
144
  };
145
145
 
146
- var version = "8.6.3";
146
+ var version = "8.6.4";
147
147
 
148
148
  // Warn when a wrapper's base_url points at the PostHog AI Gateway: the gateway
149
149
  // emits its own $ai_generation, so each call would be captured (and, for billable
@@ -141,7 +141,7 @@ const truncate = input => {
141
141
  return `${truncatedStr}... [truncated]`;
142
142
  };
143
143
 
144
- var version = "8.6.3";
144
+ var version = "8.6.4";
145
145
 
146
146
  // Warn when a wrapper's base_url points at the PostHog AI Gateway: the gateway
147
147
  // emits its own $ai_generation, so each call would be captured (and, for billable
@@ -397,7 +397,7 @@ function sanitizeValues(obj) {
397
397
  return jsonSafe;
398
398
  }
399
399
 
400
- var version = "8.6.3";
400
+ var version = "8.6.4";
401
401
 
402
402
  const DEFAULT_MAX_DEPTH = 3;
403
403
  const MAX_STACK_LINES = 20;
@@ -530,6 +530,8 @@ const captureAiGeneration = async (client, options) => {
530
530
  if (httpStatus === undefined) {
531
531
  if (typeof options.error === 'object' && 'status' in options.error && typeof options.error.status === 'number') {
532
532
  httpStatus = options.error.status;
533
+ } else if (typeof options.error === 'object' && 'statusCode' in options.error && typeof options.error.statusCode === 'number') {
534
+ httpStatus = options.error.statusCode;
533
535
  } else {
534
536
  httpStatus = 500;
535
537
  }