@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.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var uuid = require('uuid');
|
|
4
|
-
require('@posthog/core');
|
|
5
4
|
|
|
6
5
|
function _interopNamespace(e) {
|
|
7
6
|
if (e && e.__esModule) return e;
|
|
@@ -23,8 +22,6 @@ function _interopNamespace(e) {
|
|
|
23
22
|
|
|
24
23
|
var uuid__namespace = /*#__PURE__*/_interopNamespace(uuid);
|
|
25
24
|
|
|
26
|
-
var version = "7.16.15";
|
|
27
|
-
|
|
28
25
|
// Type guards for safer type checking
|
|
29
26
|
|
|
30
27
|
const isString = value => {
|
|
@@ -164,6 +161,15 @@ const sanitizeLangChain = data => {
|
|
|
164
161
|
return processMessages(data, sanitizeLangChainImage);
|
|
165
162
|
};
|
|
166
163
|
|
|
164
|
+
const STRING_FORMAT = 'utf8';
|
|
165
|
+
|
|
166
|
+
// Reused across calls to avoid per-invocation allocation; truncate() runs
|
|
167
|
+
// hundreds of times for prompts with many parts.
|
|
168
|
+
new TextEncoder();
|
|
169
|
+
new TextDecoder(STRING_FORMAT, {
|
|
170
|
+
fatal: false
|
|
171
|
+
});
|
|
172
|
+
|
|
167
173
|
/**
|
|
168
174
|
* Safely converts content to a string, preserving structure for objects/arrays.
|
|
169
175
|
* - If content is already a string, returns it as-is
|
|
@@ -669,6 +675,8 @@ var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
|
|
|
669
675
|
}
|
|
670
676
|
};
|
|
671
677
|
|
|
678
|
+
var version = "7.17.1";
|
|
679
|
+
|
|
672
680
|
/** A run may either be a Span or a Generation */
|
|
673
681
|
|
|
674
682
|
/** Storage for run metadata */
|