@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.cjs
CHANGED
|
@@ -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.
|
|
535
|
+
var version = "7.17.2";
|
|
528
536
|
|
|
529
537
|
/**
|
|
530
538
|
* Options for `captureAiGeneration`. Mirrors the `$ai_generation` event shape
|