Skip to content

[FEATURE]: add option to skip first function variable (self) for input in LLMObs decorators #14849

@yann-combarnous

Description

@yann-combarnous

Package Name

ddtrace

Package Version(s)

3.16.0

Describe the goal of the feature

Currently LLMObs decorator also include the current instance of object when applied to class functions.

This is not useful for LLMObs, and in Traces preview, only the first argument of function is shown, so would be nice to be able to skip, either by option of auto-detection.

Reproduce

from ddtrace.llmobs.decorators import tool
...
class ABC
...
   @tool(name="my_span")
   def my_function(self, a, b):
      ...

Actual

{
   "input": {
      "self": "<ABC object at 0x7fd6fe122120>",
      "a": ...
   }   
}

Expected

{
   "input": {
      "a": ...
   }   
}

Is your feature request related to a problem?

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions