@@ -3427,11 +3427,12 @@ def test_text_completion_operation_name(
34273427 get_model_response ,
34283428 reset_litellm_executor ,
34293429):
3430- """text_completion calls get the text_completion op, not the chat fallback ."""
3430+ """text_completion calls get the text_completion op and record their prompt ."""
34313431 sentry_init (
3432- integrations = [LiteLLMIntegration ()],
3432+ integrations = [LiteLLMIntegration (include_prompts = True )],
34333433 disabled_integrations = [StdlibIntegration ],
34343434 traces_sample_rate = 1.0 ,
3435+ send_default_pii = True ,
34353436 stream_gen_ai_spans = False ,
34363437 )
34373438 events = capture_events ()
@@ -3476,6 +3477,9 @@ def test_text_completion_operation_name(
34763477 assert span ["op" ] == OP .GEN_AI_TEXT_COMPLETION
34773478 assert span ["description" ] == "text_completion gpt-3.5-turbo-instruct"
34783479 assert span ["data" ][SPANDATA .GEN_AI_OPERATION_NAME ] == "text_completion"
3480+ assert json .loads (span ["data" ][SPANDATA .GEN_AI_REQUEST_MESSAGES ]) == [
3481+ {"role" : "user" , "content" : "Hello!" }
3482+ ]
34793483
34803484
34813485def test_responses_operation_name (
@@ -3485,11 +3489,12 @@ def test_responses_operation_name(
34853489 nonstreaming_responses_model_response ,
34863490 reset_litellm_executor ,
34873491):
3488- """Responses API calls get the responses op, not the chat fallback ."""
3492+ """Responses API calls get the responses op and record their input ."""
34893493 sentry_init (
3490- integrations = [LiteLLMIntegration ()],
3494+ integrations = [LiteLLMIntegration (include_prompts = True )],
34913495 disabled_integrations = [StdlibIntegration ],
34923496 traces_sample_rate = 1.0 ,
3497+ send_default_pii = True ,
34933498 stream_gen_ai_spans = False ,
34943499 )
34953500 events = capture_events ()
@@ -3521,3 +3526,6 @@ def test_responses_operation_name(
35213526 assert span ["op" ] == OP .GEN_AI_RESPONSES
35223527 assert span ["description" ] == "responses gpt-4"
35233528 assert span ["data" ][SPANDATA .GEN_AI_OPERATION_NAME ] == "responses"
3529+ assert json .loads (span ["data" ][SPANDATA .GEN_AI_REQUEST_MESSAGES ]) == [
3530+ {"role" : "user" , "content" : "Hello!" }
3531+ ]
0 commit comments