Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading