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