@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.
@@ -166,6 +166,14 @@ function getTokensSource(posthogProperties) {
166
166
  }
167
167
  return 'sdk';
168
168
  }
169
+ const STRING_FORMAT = 'utf8';
170
+
171
+ // Reused across calls to avoid per-invocation allocation; truncate() runs
172
+ // hundreds of times for prompts with many parts.
173
+ new TextEncoder();
174
+ new TextDecoder(STRING_FORMAT, {
175
+ fatal: false
176
+ });
169
177
 
170
178
  /**
171
179
  * Safely converts content to a string, preserving structure for objects/arrays.
@@ -524,7 +532,7 @@ function formatOpenAIResponsesInput(input, instructions) {
524
532
  return messages;
525
533
  }
526
534
 
527
- var version = "7.17.0";
535
+ var version = "7.17.2";
528
536
 
529
537
  /**
530
538
  * Options for `captureAiGeneration`. Mirrors the `$ai_generation` event shape