@posthog/ai 7.17.0 → 7.17.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.
@@ -161,6 +161,15 @@ const sanitizeLangChain = data => {
161
161
  return processMessages(data, sanitizeLangChainImage);
162
162
  };
163
163
 
164
+ const STRING_FORMAT = 'utf8';
165
+
166
+ // Reused across calls to avoid per-invocation allocation; truncate() runs
167
+ // hundreds of times for prompts with many parts.
168
+ new TextEncoder();
169
+ new TextDecoder(STRING_FORMAT, {
170
+ fatal: false
171
+ });
172
+
164
173
  /**
165
174
  * Safely converts content to a string, preserving structure for objects/arrays.
166
175
  * - If content is already a string, returns it as-is
@@ -666,7 +675,7 @@ var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
666
675
  }
667
676
  };
668
677
 
669
- var version = "7.17.0";
678
+ var version = "7.17.2";
670
679
 
671
680
  /** A run may either be a Span or a Generation */
672
681