mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Address comments
This commit is contained in:
@@ -1181,6 +1181,7 @@ class TestClaudeAgentTelemetry:
|
||||
mock_client = self._create_mock_client(messages)
|
||||
|
||||
monkeypatch.setattr(OBSERVABILITY_SETTINGS, "enable_instrumentation", False)
|
||||
monkeypatch.setattr(OBSERVABILITY_SETTINGS, "enable_sensitive_data", False)
|
||||
|
||||
with (
|
||||
patch("agent_framework_claude._agent.ClaudeSDKClient", return_value=mock_client),
|
||||
|
||||
@@ -691,7 +691,7 @@ class ObservabilitySettings:
|
||||
|
||||
Model diagnostics are enabled if either diagnostic is enabled or diagnostic with sensitive events is enabled.
|
||||
"""
|
||||
return self.enable_instrumentation or self.enable_sensitive_data
|
||||
return self.enable_instrumentation
|
||||
|
||||
@property
|
||||
def SENSITIVE_DATA_ENABLED(self) -> bool:
|
||||
|
||||
@@ -1015,30 +1015,6 @@ def test_observability_settings_is_setup_initial(monkeypatch):
|
||||
assert settings.is_setup is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("enable_instrumentation", "enable_sensitive_data", "expected"),
|
||||
[
|
||||
(False, False, False),
|
||||
(True, False, True),
|
||||
(False, True, True),
|
||||
(True, True, True),
|
||||
],
|
||||
)
|
||||
def test_observability_settings_enabled_property(
|
||||
monkeypatch, enable_instrumentation: bool, enable_sensitive_data: bool, expected: bool
|
||||
):
|
||||
"""ENABLED is True when either instrumentation or sensitive data is enabled."""
|
||||
from agent_framework.observability import ObservabilitySettings
|
||||
|
||||
monkeypatch.delenv("ENABLE_INSTRUMENTATION", raising=False)
|
||||
monkeypatch.delenv("ENABLE_SENSITIVE_DATA", raising=False)
|
||||
settings = ObservabilitySettings(
|
||||
enable_instrumentation=enable_instrumentation,
|
||||
enable_sensitive_data=enable_sensitive_data,
|
||||
)
|
||||
assert settings.ENABLED is expected
|
||||
|
||||
|
||||
# region Test enable_instrumentation function
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user