fix - add stricter type check for OTEL when args[0] is not dict

This commit is contained in:
Ishaan Jaff 2024-09-25 13:48:50 -07:00
parent 7cbcf538c6
commit 2444d76fda

View file

@ -157,6 +157,7 @@ def log_to_opentelemetry(func):
# https://docs.litellm.ai/docs/observability/custom_callback#callback-functions # https://docs.litellm.ai/docs/observability/custom_callback#callback-functions
args is not None args is not None
and len(args) > 0 and len(args) > 0
and isinstance(args[0], dict)
): ):
passed_kwargs = args[0] passed_kwargs = args[0]
parent_otel_span = _get_parent_otel_span_from_kwargs( parent_otel_span = _get_parent_otel_span_from_kwargs(