@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.
- package/dist/anthropic/index.cjs +9 -1
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.mjs +9 -1
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +9 -1
- package/dist/gemini/index.cjs.map +1 -1
- package/dist/gemini/index.mjs +9 -1
- package/dist/gemini/index.mjs.map +1 -1
- package/dist/index.cjs +29 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +29 -18
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +10 -1
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.mjs +10 -1
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/openai/index.cjs +9 -1
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.mjs +9 -1
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +13 -10
- package/dist/openai-agents/index.cjs.map +1 -1
- package/dist/openai-agents/index.mjs +13 -10
- package/dist/openai-agents/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +30 -18
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.mjs +30 -18
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/openai/index.mjs
CHANGED
|
@@ -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.
|
|
531
|
+
var version = "7.17.2";
|
|
524
532
|
|
|
525
533
|
/**
|
|
526
534
|
* Options for `captureAiGeneration`. Mirrors the `$ai_generation` event shape
|