@posthog/ai 8.14.1 → 8.14.3
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 +35 -1
- package/dist/adk/index.cjs +16 -6
- package/dist/adk/index.cjs.map +1 -1
- package/dist/adk/index.mjs +16 -6
- package/dist/adk/index.mjs.map +1 -1
- package/dist/anthropic/index.cjs +156 -15
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.d.ts +1 -0
- package/dist/anthropic/index.mjs +156 -15
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/claude-agent-sdk/index.cjs +111 -37
- package/dist/claude-agent-sdk/index.cjs.map +1 -1
- package/dist/claude-agent-sdk/index.mjs +111 -37
- package/dist/claude-agent-sdk/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +175 -39
- package/dist/gemini/index.cjs.map +1 -1
- package/dist/gemini/index.d.ts +1 -1
- package/dist/gemini/index.mjs +175 -39
- package/dist/gemini/index.mjs.map +1 -1
- package/dist/index.cjs +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15 -8
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +15 -5
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.mjs +15 -5
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/langchain/middleware/index.cjs +15 -5
- package/dist/langchain/middleware/index.cjs.map +1 -1
- package/dist/langchain/middleware/index.mjs +15 -5
- package/dist/langchain/middleware/index.mjs.map +1 -1
- package/dist/openai/index.cjs +181 -21
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.mjs +181 -21
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +15 -5
- package/dist/openai-agents/index.cjs.map +1 -1
- package/dist/openai-agents/index.mjs +15 -5
- package/dist/openai-agents/index.mjs.map +1 -1
- package/dist/otel/index.cjs +12 -3
- package/dist/otel/index.cjs.map +1 -1
- package/dist/otel/index.mjs +12 -3
- package/dist/otel/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +15 -8
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.mjs +15 -8
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -167,17 +167,26 @@ var BinaryContentRedactor = class {
|
|
|
167
167
|
this.visited = /* @__PURE__ */ new WeakSet();
|
|
168
168
|
return this.walk(value, mediaType ? new MediaTypeContext(void 0, void 0, mediaType) : MediaTypeContext.EMPTY);
|
|
169
169
|
}
|
|
170
|
+
/** Redact one leaf while a caller owns bounded, type-preserving traversal. @internal */
|
|
171
|
+
redactLeaf(value, context) {
|
|
172
|
+
return typeof value === "string" ? this.redactString(value, context) : this.placeholderFor(context.inferMediaType());
|
|
173
|
+
}
|
|
170
174
|
walk(value, ctx) {
|
|
171
175
|
if (value === null || value === void 0) return value;
|
|
172
|
-
if (typeof value === "string") return this.
|
|
176
|
+
if (typeof value === "string") return this.redactLeaf(value, ctx);
|
|
173
177
|
if (typeof value !== "object") return value;
|
|
174
|
-
if (typeof Uint8Array !== "undefined" && value instanceof Uint8Array) return this.
|
|
178
|
+
if (typeof Uint8Array !== "undefined" && value instanceof Uint8Array) return this.redactLeaf(value, ctx);
|
|
175
179
|
if (this.visited.has(value)) return null;
|
|
176
180
|
this.visited.add(value);
|
|
177
181
|
if (Array.isArray(value)) return value.map((item) => this.walk(item, ctx));
|
|
178
182
|
const obj = value;
|
|
179
183
|
const out = {};
|
|
180
|
-
for (const k of Object.keys(obj))
|
|
184
|
+
for (const k of Object.keys(obj)) Object.defineProperty(out, k, {
|
|
185
|
+
value: this.walk(obj[k], new MediaTypeContext(obj, k)),
|
|
186
|
+
enumerable: true,
|
|
187
|
+
writable: true,
|
|
188
|
+
configurable: true
|
|
189
|
+
});
|
|
181
190
|
return out;
|
|
182
191
|
}
|
|
183
192
|
redactString(value, ctx) {
|
|
@@ -252,8 +261,9 @@ const getModelParams = (params, responseServiceTier) => {
|
|
|
252
261
|
if (responseServiceTier != null) modelParams.service_tier = responseServiceTier;
|
|
253
262
|
return modelParams;
|
|
254
263
|
};
|
|
264
|
+
const isPrivacyModeEnabled = (client, privacyMode) => Boolean(client.privacy_mode || privacyMode);
|
|
255
265
|
const withPrivacyMode = (client, privacyMode, input) => {
|
|
256
|
-
return client
|
|
266
|
+
return isPrivacyModeEnabled(client, privacyMode) ? null : input;
|
|
257
267
|
};
|
|
258
268
|
function sanitizeValues(obj) {
|
|
259
269
|
if (obj === void 0 || obj === null) return obj;
|
|
@@ -265,7 +275,7 @@ function sanitizeValues(obj) {
|
|
|
265
275
|
}
|
|
266
276
|
//#endregion
|
|
267
277
|
//#region package.json
|
|
268
|
-
var version = "8.14.
|
|
278
|
+
var version = "8.14.3";
|
|
269
279
|
//#endregion
|
|
270
280
|
//#region src/serializeError.ts
|
|
271
281
|
const DEFAULT_MAX_DEPTH = 3;
|