File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change 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
2020from 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 ,
You can’t perform that action at this time.
0 commit comments