@@ -404,18 +404,17 @@ async def invoke(
404404
405405 Args:
406406 arguments: A Pydantic model instance containing the arguments for the function.
407- otel_settings: Optional model diagnostics settings to override the default settings.
408407 kwargs: keyword arguments to pass to the function, will not be used if `arguments` is provided.
409408 """
410- global OTEL_SETTINGS
411- from .observability import OTEL_SETTINGS
409+ global OBSERVABILITY_SETTINGS
410+ from .observability import OBSERVABILITY_SETTINGS
412411
413412 tool_call_id = kwargs .pop ("tool_call_id" , None )
414413 if arguments is not None :
415414 if not isinstance (arguments , self .input_model ):
416415 raise TypeError (f"Expected { self .input_model .__name__ } , got { type (arguments ).__name__ } " )
417416 kwargs = arguments .model_dump (exclude_none = True )
418- if not OTEL_SETTINGS .ENABLED : # type: ignore[name-defined]
417+ if not OBSERVABILITY_SETTINGS .ENABLED : # type: ignore[name-defined]
419418 logger .info (f"Function name: { self .name } " )
420419 logger .debug (f"Function arguments: { kwargs } " )
421420 res = self .__call__ (** kwargs )
@@ -425,7 +424,7 @@ async def invoke(
425424 return result # type: ignore[reportReturnType]
426425
427426 attributes = get_function_span_attributes (self , tool_call_id = tool_call_id )
428- if OTEL_SETTINGS .SENSITIVE_DATA_ENABLED : # type: ignore[name-defined]
427+ if OBSERVABILITY_SETTINGS .SENSITIVE_DATA_ENABLED : # type: ignore[name-defined]
429428 attributes .update ({
430429 OtelAttr .TOOL_ARGUMENTS : arguments .model_dump_json ()
431430 if arguments
@@ -436,7 +435,7 @@ async def invoke(
436435 with get_function_span (attributes = attributes ) as span :
437436 attributes [OtelAttr .MEASUREMENT_FUNCTION_TAG_NAME ] = self .name
438437 logger .info (f"Function name: { self .name } " )
439- if OTEL_SETTINGS .SENSITIVE_DATA_ENABLED : # type: ignore[name-defined]
438+ if OBSERVABILITY_SETTINGS .SENSITIVE_DATA_ENABLED : # type: ignore[name-defined]
440439 logger .debug (f"Function arguments: { kwargs } " )
441440 start_time_stamp = perf_counter ()
442441 end_time_stamp : float | None = None
@@ -452,7 +451,7 @@ async def invoke(
452451 raise
453452 else :
454453 logger .info (f"Function { self .name } succeeded." )
455- if OTEL_SETTINGS .SENSITIVE_DATA_ENABLED : # type: ignore[name-defined]
454+ if OBSERVABILITY_SETTINGS .SENSITIVE_DATA_ENABLED : # type: ignore[name-defined]
456455 try :
457456 json_result = json .dumps (result )
458457 except (TypeError , OverflowError ):
0 commit comments