diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index b98e7045b2ba..4a5b22aa2e5a 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_ca3d235eb7" + "Tag": "python/ai/azure-ai-projects_f19313ab67" } diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py index 7af815061a80..5894722ed72d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py b/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py index 53b05aaae755..f199e86ba35c 100644 --- a/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py +++ b/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py index 504f027fceba..4c36b4518c79 100644 --- a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py +++ b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py b/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py index de03b8994f9d..cd0c322c6fbc 100644 --- a/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py +++ b/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py @@ -13,7 +13,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py b/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py index bfd9b593ec6c..ce37089d20d6 100644 --- a/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py +++ b/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py index 45893855fd07..590c85480b27 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py b/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py index 6780d5e032b3..bb5a5c55dac4 100644 --- a/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py +++ b/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py index 0ea4b80ebde7..d63ac05e7eb4 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py @@ -15,7 +15,7 @@ from devtools_testutils import recorded_by_proxy from azure.ai.projects.models import PromptAgentDefinition, FunctionTool -from test_base import servicePreparer +from test_base import servicePreparer, recorded_by_proxy_httpx from test_ai_instrumentor_base import TestAiAgentsInstrumentorBase, CONTENT_TRACING_ENV_VARIABLE settings.tracing_implementation = "OpenTelemetry" @@ -180,10 +180,9 @@ def set_env_var(var_name, value): finally: self.cleanup() - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_non_streaming_with_content_recording(self, **kwargs): """Test synchronous non-streaming responses with content recording enabled.""" self.cleanup() @@ -255,10 +254,9 @@ def test_sync_non_streaming_with_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_non_streaming_without_content_recording(self, **kwargs): """Test synchronous non-streaming responses with content recording disabled.""" self.cleanup() @@ -330,10 +328,9 @@ def test_sync_non_streaming_without_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_streaming_with_content_recording(self, **kwargs): """Test synchronous streaming responses with content recording enabled.""" from openai.types.responses.response_input_param import FunctionCallOutput @@ -415,10 +412,9 @@ def test_sync_streaming_with_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_conversations_create(self, **kwargs): """Test synchronous conversations.create() method.""" self.cleanup() @@ -457,10 +453,9 @@ def test_sync_conversations_create(self, **kwargs): attributes_match = GenAiTraceVerifier().check_span_attributes(span, expected_attributes) assert attributes_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_list_conversation_items_with_content_recording(self, **kwargs): """Test synchronous list_conversation_items with content recording enabled.""" self.cleanup() @@ -504,10 +499,9 @@ def test_sync_list_conversation_items_with_content_recording(self, **kwargs): attributes_match = GenAiTraceVerifier().check_span_attributes(span, expected_attributes) assert attributes_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_list_conversation_items_without_content_recording(self, **kwargs): """Test synchronous list_conversation_items with content recording disabled.""" self.cleanup() @@ -587,10 +581,9 @@ def test_no_instrumentation_no_spans(self): exporter.shutdown() trace._TRACER_PROVIDER = None - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_non_streaming_without_conversation(self, **kwargs): """Test synchronous non-streaming responses without conversation parameter.""" self.cleanup() @@ -1652,10 +1645,9 @@ def test_sync_function_tool_list_conversation_items_without_content_recording(se content = tool_event_attrs["gen_ai.event.content"] assert content == "{}" # Should be empty JSON object - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_multiple_text_inputs_with_content_recording_non_streaming(self, **kwargs): """Test synchronous non-streaming responses with multiple text inputs and content recording enabled.""" self.cleanup() @@ -1740,10 +1732,9 @@ def test_sync_multiple_text_inputs_with_content_recording_non_streaming(self, ** events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_multiple_text_inputs_with_content_recording_streaming(self, **kwargs): """Test synchronous streaming responses with multiple text inputs and content recording enabled.""" self.cleanup() @@ -1836,10 +1827,9 @@ def test_sync_multiple_text_inputs_with_content_recording_streaming(self, **kwar events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_multiple_text_inputs_without_content_recording_non_streaming(self, **kwargs): """Test synchronous non-streaming responses with multiple text inputs and content recording disabled.""" self.cleanup() @@ -1924,10 +1914,9 @@ def test_sync_multiple_text_inputs_without_content_recording_non_streaming(self, events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_sync_multiple_text_inputs_without_content_recording_streaming(self, **kwargs): """Test synchronous streaming responses with multiple text inputs and content recording disabled.""" self.cleanup() @@ -2018,10 +2007,9 @@ def test_sync_multiple_text_inputs_without_content_recording_streaming(self, **k events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_off_binary_off_non_streaming(self, **kwargs): """Test image only with content recording OFF and binary data OFF (non-streaming).""" self.cleanup() @@ -2079,10 +2067,9 @@ def test_image_only_content_off_binary_off_non_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_off_binary_on_non_streaming(self, **kwargs): """Test image only with content recording OFF and binary data ON (non-streaming).""" self.cleanup() @@ -2139,10 +2126,9 @@ def test_image_only_content_off_binary_on_non_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_on_binary_off_non_streaming(self, **kwargs): """Test image only with content recording ON and binary data OFF (non-streaming).""" self.cleanup() @@ -2199,10 +2185,9 @@ def test_image_only_content_on_binary_off_non_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_on_binary_on_non_streaming(self, **kwargs): """Test image only with content recording ON and binary data ON (non-streaming).""" self.cleanup() @@ -2263,10 +2248,9 @@ def test_image_only_content_on_binary_on_non_streaming(self, **kwargs): # Binary Data Tracing Tests (Text + Image) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_off_binary_off_non_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data OFF (non-streaming).""" self.cleanup() @@ -2327,10 +2311,9 @@ def test_text_and_image_content_off_binary_off_non_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_off_binary_on_non_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data ON (non-streaming).""" self.cleanup() @@ -2390,10 +2373,9 @@ def test_text_and_image_content_off_binary_on_non_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_on_binary_off_non_streaming(self, **kwargs): """Test text + image with content recording ON and binary data OFF (non-streaming).""" self.cleanup() @@ -2453,10 +2435,9 @@ def test_text_and_image_content_on_binary_off_non_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_on_binary_on_non_streaming(self, **kwargs): """Test text + image with content recording ON and binary data ON (non-streaming).""" self.cleanup() @@ -2520,10 +2501,9 @@ def test_text_and_image_content_on_binary_on_non_streaming(self, **kwargs): # Binary Data Tracing Tests - Streaming (Image Only) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_off_binary_off_streaming(self, **kwargs): """Test image only with content recording OFF and binary data OFF (streaming).""" self.cleanup() @@ -2589,10 +2569,9 @@ def test_image_only_content_off_binary_off_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_off_binary_on_streaming(self, **kwargs): """Test image only with content recording OFF and binary data ON (streaming).""" self.cleanup() @@ -2657,10 +2636,9 @@ def test_image_only_content_off_binary_on_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_on_binary_off_streaming(self, **kwargs): """Test image only with content recording ON and binary data OFF (streaming).""" self.cleanup() @@ -2725,10 +2703,9 @@ def test_image_only_content_on_binary_off_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_image_only_content_on_binary_on_streaming(self, **kwargs): """Test image only with content recording ON and binary data ON (streaming).""" self.cleanup() @@ -2797,10 +2774,9 @@ def test_image_only_content_on_binary_on_streaming(self, **kwargs): # Binary Data Tracing Tests - Streaming (Text + Image) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_off_binary_off_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data OFF (streaming).""" self.cleanup() @@ -2868,10 +2844,9 @@ def test_text_and_image_content_off_binary_off_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_off_binary_on_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data ON (streaming).""" self.cleanup() @@ -2939,10 +2914,9 @@ def test_text_and_image_content_off_binary_on_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_on_binary_off_streaming(self, **kwargs): """Test text + image with content recording ON and binary data OFF (streaming).""" self.cleanup() @@ -3010,10 +2984,9 @@ def test_text_and_image_content_on_binary_off_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_text_and_image_content_on_binary_on_streaming(self, **kwargs): """Test text + image with content recording ON and binary data ON (streaming).""" self.cleanup() @@ -3085,10 +3058,9 @@ def test_text_and_image_content_on_binary_on_streaming(self, **kwargs): # responses.stream() Method Tests # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_responses_stream_method_with_content_recording(self, **kwargs): """Test sync responses.stream() method with content recording enabled.""" os.environ["AZURE_TRACING_GEN_AI_INSTRUMENT_RESPONSES_API"] = "True" @@ -3157,10 +3129,9 @@ def test_responses_stream_method_with_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_responses_stream_method_without_content_recording(self, **kwargs): """Test sync responses.stream() method without content recording.""" os.environ["AZURE_TRACING_GEN_AI_INSTRUMENT_RESPONSES_API"] = "True" @@ -3229,10 +3200,9 @@ def test_responses_stream_method_without_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_responses_stream_method_with_tools_with_content_recording(self, **kwargs): """Test sync responses.stream() method with function tools and content recording enabled.""" from openai.types.responses.response_input_param import FunctionCallOutput @@ -3374,10 +3344,9 @@ def test_responses_stream_method_with_tools_with_content_recording(self, **kwarg events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_responses_stream_method_with_tools_without_content_recording(self, **kwargs): """Test sync responses.stream() method with function tools without content recording.""" from openai.types.responses.response_input_param import FunctionCallOutput diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py index ad8ef6c04d6d..797e3af15e14 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py @@ -14,7 +14,7 @@ from devtools_testutils.aio import recorded_by_proxy_async -from test_base import servicePreparer +from test_base import servicePreparer, recorded_by_proxy_async_httpx from test_ai_instrumentor_base import TestAiAgentsInstrumentorBase, CONTENT_TRACING_ENV_VARIABLE BINARY_DATA_TRACING_ENV_VARIABLE = "AZURE_TRACING_GEN_AI_INCLUDE_BINARY_DATA" @@ -29,10 +29,9 @@ class TestResponsesInstrumentor(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with real endpoints (async).""" - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_non_streaming_with_content_recording(self, **kwargs): """Test asynchronous non-streaming responses with content recording enabled.""" self.cleanup() @@ -106,10 +105,9 @@ async def test_async_non_streaming_with_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_streaming_with_content_recording(self, **kwargs): """Test asynchronous streaming responses with content recording enabled.""" self.cleanup() @@ -191,10 +189,9 @@ async def test_async_streaming_with_content_recording(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_conversations_create(self, **kwargs): """Test asynchronous conversations.create() method.""" self.cleanup() @@ -236,10 +233,9 @@ async def test_async_conversations_create(self, **kwargs): attributes_match = GenAiTraceVerifier().check_span_attributes(span, expected_attributes) assert attributes_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_list_conversation_items_with_content_recording(self, **kwargs): """Test asynchronous list_conversation_items with content recording enabled.""" self.cleanup() @@ -675,10 +671,9 @@ async def test_async_function_tool_without_content_recording_streaming(self, **k events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_multiple_text_inputs_with_content_recording_non_streaming(self, **kwargs): """Test asynchronous non-streaming responses with multiple text inputs and content recording enabled.""" self.cleanup() @@ -763,10 +758,9 @@ async def test_async_multiple_text_inputs_with_content_recording_non_streaming(s events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_multiple_text_inputs_with_content_recording_streaming(self, **kwargs): """Test asynchronous streaming responses with multiple text inputs and content recording enabled.""" self.cleanup() @@ -859,10 +853,9 @@ async def test_async_multiple_text_inputs_with_content_recording_streaming(self, events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_multiple_text_inputs_without_content_recording_non_streaming(self, **kwargs): """Test asynchronous non-streaming responses with multiple text inputs and content recording disabled.""" self.cleanup() @@ -951,10 +944,9 @@ async def test_async_multiple_text_inputs_without_content_recording_non_streamin # Binary Data Tracing Tests (Image Only) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_off_binary_off_non_streaming(self, **kwargs): """Test image only with content recording OFF and binary data OFF (non-streaming).""" self.cleanup() @@ -1013,10 +1005,9 @@ async def test_async_image_only_content_off_binary_off_non_streaming(self, **kwa events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_off_binary_on_non_streaming(self, **kwargs): """Test image only with content recording OFF and binary data ON (non-streaming).""" self.cleanup() @@ -1074,10 +1065,9 @@ async def test_async_image_only_content_off_binary_on_non_streaming(self, **kwar events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_on_binary_off_non_streaming(self, **kwargs): """Test image only with content recording ON and binary data OFF (non-streaming).""" self.cleanup() @@ -1135,10 +1125,9 @@ async def test_async_image_only_content_on_binary_off_non_streaming(self, **kwar events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_on_binary_on_non_streaming(self, **kwargs): """Test image only with content recording ON and binary data ON (non-streaming).""" self.cleanup() @@ -1200,10 +1189,9 @@ async def test_async_image_only_content_on_binary_on_non_streaming(self, **kwarg # Binary Data Tracing Tests (Text + Image) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_off_binary_off_non_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data OFF (non-streaming).""" self.cleanup() @@ -1265,10 +1253,9 @@ async def test_async_text_and_image_content_off_binary_off_non_streaming(self, * events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_off_binary_on_non_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data ON (non-streaming).""" self.cleanup() @@ -1329,10 +1316,9 @@ async def test_async_text_and_image_content_off_binary_on_non_streaming(self, ** events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_on_binary_off_non_streaming(self, **kwargs): """Test text + image with content recording ON and binary data OFF (non-streaming).""" self.cleanup() @@ -1393,10 +1379,9 @@ async def test_async_text_and_image_content_on_binary_off_non_streaming(self, ** events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_on_binary_on_non_streaming(self, **kwargs): """Test text + image with content recording ON and binary data ON (non-streaming).""" self.cleanup() @@ -1461,10 +1446,9 @@ async def test_async_text_and_image_content_on_binary_on_non_streaming(self, **k # Binary Data Tracing Tests - Streaming (Image Only) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_off_binary_off_streaming(self, **kwargs): """Test image only with content recording OFF and binary data OFF (streaming).""" self.cleanup() @@ -1531,10 +1515,9 @@ async def test_async_image_only_content_off_binary_off_streaming(self, **kwargs) events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_off_binary_on_streaming(self, **kwargs): """Test image only with content recording OFF and binary data ON (streaming).""" self.cleanup() @@ -1600,10 +1583,9 @@ async def test_async_image_only_content_off_binary_on_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_on_binary_off_streaming(self, **kwargs): """Test image only with content recording ON and binary data OFF (streaming).""" self.cleanup() @@ -1669,10 +1651,9 @@ async def test_async_image_only_content_on_binary_off_streaming(self, **kwargs): events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_image_only_content_on_binary_on_streaming(self, **kwargs): """Test image only with content recording ON and binary data ON (streaming).""" self.cleanup() @@ -1742,10 +1723,9 @@ async def test_async_image_only_content_on_binary_on_streaming(self, **kwargs): # Binary Data Tracing Tests - Streaming (Text + Image) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_off_binary_off_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data OFF (streaming).""" self.cleanup() @@ -1814,10 +1794,9 @@ async def test_async_text_and_image_content_off_binary_off_streaming(self, **kwa events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_off_binary_on_streaming(self, **kwargs): """Test text + image with content recording OFF and binary data ON (streaming).""" self.cleanup() @@ -1886,10 +1865,9 @@ async def test_async_text_and_image_content_off_binary_on_streaming(self, **kwar events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_on_binary_off_streaming(self, **kwargs): """Test text + image with content recording ON and binary data OFF (streaming).""" self.cleanup() @@ -1958,10 +1936,9 @@ async def test_async_text_and_image_content_on_binary_off_streaming(self, **kwar events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_text_and_image_content_on_binary_on_streaming(self, **kwargs): """Test text + image with content recording ON and binary data ON (streaming).""" self.cleanup() @@ -2030,10 +2007,9 @@ async def test_async_text_and_image_content_on_binary_on_streaming(self, **kwarg events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_multiple_text_inputs_without_content_recording_streaming(self, **kwargs): """Test asynchronous streaming responses with multiple text inputs and content recording disabled.""" self.cleanup() @@ -2130,10 +2106,9 @@ async def test_async_multiple_text_inputs_without_content_recording_streaming(se # responses.stream() Method Tests (Async) # ======================================== - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_responses_stream_method_with_content_recording(self, **kwargs): """Test async responses.stream() method with content recording enabled.""" self.cleanup() @@ -2206,10 +2181,9 @@ async def test_async_responses_stream_method_with_content_recording(self, **kwar events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_responses_stream_method_without_content_recording(self, **kwargs): """Test async responses.stream() method without content recording.""" self.cleanup() @@ -2282,10 +2256,9 @@ async def test_async_responses_stream_method_without_content_recording(self, **k events_match = GenAiTraceVerifier().check_span_events(span, expected_events) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_responses_stream_method_with_tools_with_content_recording(self, **kwargs): """Test async responses.stream() method with function tools and content recording enabled.""" from openai.types.responses.response_input_param import FunctionCallOutput @@ -2431,10 +2404,9 @@ async def test_async_responses_stream_method_with_tools_with_content_recording(s events_match = GenAiTraceVerifier().check_span_events(span2, expected_events_2) assert events_match == True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy_async + @recorded_by_proxy_async_httpx async def test_async_responses_stream_method_with_tools_without_content_recording(self, **kwargs): """Test async responses.stream() method with function tools without content recording.""" from openai.types.responses.response_input_param import FunctionCallOutput diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py index aca19fb23464..2abcda48d3f5 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py @@ -13,10 +13,7 @@ from opentelemetry.sdk.metrics.export import InMemoryMetricReader from opentelemetry import metrics from openai import OpenAI - -from devtools_testutils import recorded_by_proxy - -from test_base import servicePreparer +from test_base import servicePreparer, recorded_by_proxy_httpx from test_ai_instrumentor_base import TestAiAgentsInstrumentorBase, CONTENT_TRACING_ENV_VARIABLE settings.tracing_implementation = "OpenTelemetry" @@ -62,10 +59,9 @@ def _get_metrics_data(self): return operation_duration_metrics, token_usage_metrics - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_metrics_collection_non_streaming_responses(self, **kwargs): """Test that metrics are collected for non-streaming responses API calls.""" self.cleanup() @@ -104,10 +100,9 @@ def test_metrics_collection_non_streaming_responses(self, **kwargs): # The test passes if we got here without errors and the API calls worked assert True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_metrics_collection_streaming_responses(self, **kwargs): """Test that metrics are collected for streaming responses API calls.""" self.cleanup() @@ -155,10 +150,9 @@ def test_metrics_collection_streaming_responses(self, **kwargs): # The test passes if we got here without errors and streaming worked assert True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_metrics_collection_conversation_create(self, **kwargs): """Test that metrics are collected for conversation creation calls.""" self.cleanup() @@ -190,10 +184,9 @@ def test_metrics_collection_conversation_create(self, **kwargs): # The test passes if we got here without errors and the conversation was created assert True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_with_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_metrics_collection_multiple_operations(self, **kwargs): """Test that metrics are collected correctly for multiple operations.""" self.cleanup() @@ -237,10 +230,9 @@ def test_metrics_collection_multiple_operations(self, **kwargs): # The test passes if we got here without errors and multiple calls worked assert True - @pytest.mark.skip(reason="recordings not working for responses API") @pytest.mark.usefixtures("instrument_without_content") @servicePreparer() - @recorded_by_proxy + @recorded_by_proxy_httpx def test_metrics_collection_without_content_recording(self, **kwargs): """Test that metrics are still collected when content recording is disabled.""" self.cleanup() diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml new file mode 100644 index 000000000000..80b8dc2ae282 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ai/Azure.AI.Projects +commit: 78bfd335c31b8764578cfb9840f3b74349c10354 +repo: Azure/azure-rest-api-specs-pr +additionalDirectories: