@posthog/ai 7.16.15 → 7.17.1
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/README.md +31 -0
- package/dist/anthropic/index.cjs +91 -95
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.mjs +91 -95
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +100 -106
- package/dist/gemini/index.cjs.map +1 -1
- package/dist/gemini/index.mjs +100 -106
- package/dist/gemini/index.mjs.map +1 -1
- package/dist/index.cjs +295 -335
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +83 -2
- package/dist/index.mjs +273 -314
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +11 -3
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.mjs +11 -3
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/openai/index.cjs +169 -185
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.mjs +169 -185
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +14 -12
- package/dist/openai-agents/index.cjs.map +1 -1
- package/dist/openai-agents/index.mjs +14 -12
- package/dist/openai-agents/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +133 -128
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.mjs +133 -128
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/langchain/index.mjs
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import * as uuid from 'uuid';
|
|
2
|
-
import '@posthog/core';
|
|
3
|
-
|
|
4
|
-
var version = "7.16.15";
|
|
5
2
|
|
|
6
3
|
// Type guards for safer type checking
|
|
7
4
|
|
|
@@ -142,6 +139,15 @@ const sanitizeLangChain = data => {
|
|
|
142
139
|
return processMessages(data, sanitizeLangChainImage);
|
|
143
140
|
};
|
|
144
141
|
|
|
142
|
+
const STRING_FORMAT = 'utf8';
|
|
143
|
+
|
|
144
|
+
// Reused across calls to avoid per-invocation allocation; truncate() runs
|
|
145
|
+
// hundreds of times for prompts with many parts.
|
|
146
|
+
new TextEncoder();
|
|
147
|
+
new TextDecoder(STRING_FORMAT, {
|
|
148
|
+
fatal: false
|
|
149
|
+
});
|
|
150
|
+
|
|
145
151
|
/**
|
|
146
152
|
* Safely converts content to a string, preserving structure for objects/arrays.
|
|
147
153
|
* - If content is already a string, returns it as-is
|
|
@@ -647,6 +653,8 @@ var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
|
|
|
647
653
|
}
|
|
648
654
|
};
|
|
649
655
|
|
|
656
|
+
var version = "7.17.1";
|
|
657
|
+
|
|
650
658
|
/** A run may either be a Span or a Generation */
|
|
651
659
|
|
|
652
660
|
/** Storage for run metadata */
|