@posthog/ai 7.2.1 → 7.2.2

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.
@@ -1,7 +1,7 @@
1
1
  import 'buffer';
2
2
  import * as uuid from 'uuid';
3
3
 
4
- var version = "7.2.1";
4
+ var version = "7.2.2";
5
5
 
6
6
  // Type guards for safer type checking
7
7
 
@@ -500,7 +500,7 @@ var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
500
500
  }
501
501
  static fromMethods(methods) {
502
502
  class Handler extends BaseCallbackHandler {
503
- name = uuid.v4();
503
+ name = uuid.v7();
504
504
  constructor() {
505
505
  super();
506
506
  Object.assign(this, methods);
@@ -516,6 +516,15 @@ const isBaseCallbackHandler = (x) => {
516
516
 
517
517
  const REDACTED_IMAGE_PLACEHOLDER = '[base64 image redacted]';
518
518
 
519
+ // ============================================
520
+ // Multimodal Feature Toggle
521
+ // ============================================
522
+
523
+ const isMultimodalEnabled = () => {
524
+ const val = process.env._INTERNAL_LLMA_MULTIMODAL || '';
525
+ return val.toLowerCase() === 'true' || val === '1' || val.toLowerCase() === 'yes';
526
+ };
527
+
519
528
  // ============================================
520
529
  // Base64 Detection Helpers
521
530
  // ============================================
@@ -543,6 +552,7 @@ const isRawBase64 = str => {
543
552
  return str.length > 20 && /^[A-Za-z0-9+/]+=*$/.test(str);
544
553
  };
545
554
  function redactBase64DataUrl(str) {
555
+ if (isMultimodalEnabled()) return str;
546
556
  if (!isString(str)) return str;
547
557
 
548
558
  // Check for data URL format
@@ -611,6 +621,7 @@ const sanitizeLangChainImage = item => {
611
621
 
612
622
  // Anthropic style
613
623
  if (item.type === 'image' && 'source' in item && isObject(item.source) && 'data' in item.source) {
624
+ if (isMultimodalEnabled()) return item;
614
625
  return {
615
626
  ...item,
616
627
  source: {