@posthog/ai 8.6.1 → 8.6.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 +10 -5
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.mjs +11 -6
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +10 -5
- package/dist/gemini/index.cjs.map +1 -1
- package/dist/gemini/index.mjs +11 -6
- package/dist/gemini/index.mjs.map +1 -1
- package/dist/index.cjs +126 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +127 -79
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +10 -30
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.mjs +10 -30
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/openai/index.cjs +10 -5
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.mjs +11 -6
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +24 -4
- package/dist/openai-agents/index.cjs.map +1 -1
- package/dist/openai-agents/index.d.ts +1 -1
- package/dist/openai-agents/index.mjs +24 -4
- package/dist/openai-agents/index.mjs.map +1 -1
- package/dist/otel/index.cjs +5 -3
- package/dist/otel/index.cjs.map +1 -1
- package/dist/otel/index.mjs +5 -3
- package/dist/otel/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +127 -81
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.mjs +128 -82
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/openai/index.cjs
CHANGED
|
@@ -537,7 +537,7 @@ function formatOpenAIResponsesInput(input, instructions) {
|
|
|
537
537
|
return messages;
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
var version = "8.6.
|
|
540
|
+
var version = "8.6.2";
|
|
541
541
|
|
|
542
542
|
const DEFAULT_MAX_DEPTH = 3;
|
|
543
543
|
const MAX_STACK_LINES = 20;
|
|
@@ -656,8 +656,13 @@ const captureAiGeneration$1 = async (client, options) => {
|
|
|
656
656
|
const eventType = options.eventType ?? AIEvent.Generation;
|
|
657
657
|
const privacyMode = options.privacyMode ?? false;
|
|
658
658
|
const usage = options.usage ?? {};
|
|
659
|
-
|
|
660
|
-
|
|
659
|
+
|
|
660
|
+
// Check privacy before reading or traversing input/output. Besides avoiding
|
|
661
|
+
// needless work, this ensures hostile getters/proxies cannot observe a value
|
|
662
|
+
// that the caller explicitly requested us to redact.
|
|
663
|
+
const shouldRedact = withPrivacyMode(client, privacyMode, false) === null;
|
|
664
|
+
const safeInput = shouldRedact ? null : core.toJsonSafeValue(options.input);
|
|
665
|
+
const safeOutput = shouldRedact ? null : core.toJsonSafeValue(options.output);
|
|
661
666
|
let httpStatus = options.httpStatus;
|
|
662
667
|
let errorData = {};
|
|
663
668
|
if (options.error) {
|
|
@@ -718,8 +723,8 @@ const captureAiGeneration$1 = async (client, options) => {
|
|
|
718
723
|
$ai_provider: options.providerOverride ?? options.provider,
|
|
719
724
|
$ai_model: options.modelOverride ?? options.model,
|
|
720
725
|
$ai_model_parameters: options.modelParameters ?? {},
|
|
721
|
-
$ai_input:
|
|
722
|
-
$ai_output_choices:
|
|
726
|
+
$ai_input: safeInput,
|
|
727
|
+
$ai_output_choices: safeOutput,
|
|
723
728
|
$ai_http_status: httpStatus,
|
|
724
729
|
$ai_input_tokens: usage.inputTokens ?? 0,
|
|
725
730
|
...(usage.outputTokens !== undefined ? {
|