Skip to content

Commit 05a7d85

Browse files
fix: missing base64 filtering calls
1 parent 8da6920 commit 05a7d85

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

posthog/ai/openai/openai.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ def _capture_streaming_event(
430430
"$ai_model": kwargs.get("model"),
431431
"$ai_model_parameters": get_model_params(kwargs),
432432
"$ai_input": with_privacy_mode(
433-
self._client._ph_client, posthog_privacy_mode, kwargs.get("messages")
433+
self._client._ph_client,
434+
posthog_privacy_mode,
435+
sanitize_openai(kwargs.get("messages")),
434436
),
435437
"$ai_output_choices": with_privacy_mode(
436438
self._client._ph_client,

posthog/ai/openai/openai_async.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
get_model_params,
1717
with_privacy_mode,
1818
)
19-
from posthog.ai.sanitization import sanitize_openai_response
19+
from posthog.ai.sanitization import sanitize_openai, sanitize_openai_response
2020
from posthog.client import Client as PostHogClient
2121

2222

@@ -434,7 +434,9 @@ async def _capture_streaming_event(
434434
"$ai_model": kwargs.get("model"),
435435
"$ai_model_parameters": get_model_params(kwargs),
436436
"$ai_input": with_privacy_mode(
437-
self._client._ph_client, posthog_privacy_mode, kwargs.get("messages")
437+
self._client._ph_client,
438+
posthog_privacy_mode,
439+
sanitize_openai(kwargs.get("messages")),
438440
),
439441
"$ai_output_choices": with_privacy_mode(
440442
self._client._ph_client,

0 commit comments

Comments
 (0)