Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
fix: Broken Omit attrbutes in OpenAI Agents sdk (#1090)
Ishan Jainc180c098e843
diff --git a/sdk/python/src/openlit/_instrumentors.py b/sdk/python/src/openlit/_instrumentors.pyindex 6bb25dec..a2564448 100644--- a/sdk/python/src/openlit/_instrumentors.py+++ b/sdk/python/src/openlit/_instrumentors.py@@ -173,7 +173,7 @@ def get_instrumentor_class(name):try:module = importlib.import_module(module_path)return getattr(module, class_name)- except (ImportError, AttributeError):+ except Exception:return Nonediff --git a/sdk/python/src/openlit/instrumentation/openai/utils.py b/sdk/python/src/openlit/instrumentation/openai/utils.pyindex ff37f8ef..6aab926a 100644--- a/sdk/python/src/openlit/instrumentation/openai/utils.py+++ b/sdk/python/src/openlit/instrumentation/openai/utils.py@@ -33,9 +33,10 @@ logger = logging.getLogger(__name__)def handle_not_given(value, default=None):"""- Handle OpenAI's NotGiven values and None values by converting them to appropriate defaults.+ Handle OpenAI's NotGiven/Omit sentinel values and None by converting them to defaults.+ The Responses API uses 'Omit' while the Chat Completions API uses 'NotGiven'."""- if hasattr(value, "__class__") and value.__class__.__name__ == "NotGiven":+ if hasattr(value, "__class__") and value.__class__.__name__ in ("NotGiven", "Omit"):return defaultif value is None:return defaultdiff --git a/sdk/python/src/openlit/instrumentation/openai_agents/processor.py b/sdk/python/src/openlit/instrumentation/openai_agents/processor.pyindex 5d02a084..6c536766 100644--- a/sdk/python/src/openlit/instrumentation/openai_agents/processor.py+++ b/sdk/python/src/openlit/instrumentation/openai_agents/processor.py@@ -36,7 +36,7 @@ try:if TYPE_CHECKING:from agents import Trace, SpanTRACING_AVAILABLE = True-except ImportError:+except Exception:class TracingProcessor:"""Dummy TracingProcessor for when agents is not available."""