@@ -1651,7 +1651,7 @@ def test_multiple_providers(
16511651 openai_client .completions ._client ._client ,
16521652 "send" ,
16531653 return_value = openai_model_response ,
1654- ), start_transaction (name = "test gpt-3.5-turbo" ):
1654+ ), sentry_sdk . traces . start_span (name = "test gpt-3.5-turbo" ):
16551655 litellm .completion (
16561656 model = "gpt-3.5-turbo" ,
16571657 messages = messages ,
@@ -1673,7 +1673,7 @@ def test_multiple_providers(
16731673 anthropic_client ,
16741674 "post" ,
16751675 return_value = anthropic_model_response ,
1676- ), start_transaction (name = "test claude-3-opus-20240229" ):
1676+ ), sentry_sdk . traces . start_span (name = "test claude-3-opus-20240229" ):
16771677 litellm .completion (
16781678 model = "claude-3-opus-20240229" ,
16791679 messages = messages ,
@@ -1695,7 +1695,7 @@ def test_multiple_providers(
16951695 gemini_client ,
16961696 "post" ,
16971697 return_value = gemini_model_response ,
1698- ), start_transaction (name = "test gemini/gemini-pro" ):
1698+ ), sentry_sdk . traces . start_span (name = "test gemini/gemini-pro" ):
16991699 litellm .completion (
17001700 model = "gemini/gemini-pro" ,
17011701 messages = messages ,
@@ -1708,6 +1708,8 @@ def test_multiple_providers(
17081708 sentry_sdk .flush ()
17091709 spans = [item .payload for item in items ]
17101710 for span in spans :
1711+ if span ["is_segment" ] is True :
1712+ continue
17111713 # The provider should be detected by litellm.get_llm_provider
17121714 assert SPANDATA .GEN_AI_SYSTEM in span ["attributes" ]
17131715 elif stream_gen_ai_spans :
0 commit comments