fix(completion): keep @tracer.wrap() on completion, not the dispatch context

The dispatch-extraction refactor inserted _CompletionDispatchContext and its
helpers between `return entry` and `completion`, which left completion's
@tracer.wrap() decorator stranded on the new frozen dataclass. That silently
dropped the tracing span from completion, the library's hottest entrypoint, and
instead had ddtrace wrap the dataclass constructor (replacing the class with a
function wrapper at runtime). Restore the decorator above @client on completion,
matching litellm_internal_staging, and remove it from the dataclass.
This commit is contained in:
mateo-berri 2026-06-19 06:00:05 +00:00
parent 1c2041177e
commit 20bcd775c4
No known key found for this signature in database

View file

@ -1085,7 +1085,6 @@ def _build_custom_pricing_entry(
return entry
@tracer.wrap()
@dataclass(frozen=True, slots=True)
class _CompletionDispatchContext:
_azure_detection_model: str
@ -5011,6 +5010,7 @@ def _complete_langflow(ctx: _CompletionDispatchContext):
return response
@tracer.wrap()
@client
def completion( # type: ignore
model: str,