Skip to content

🚀 Feature: Add thinking tokens to the instrumentation #2774

@dinmukhamedm

Description

@dinmukhamedm

Which component is this feature for?

Anthropic Instrumentation

🔖 Feature description

We should track the content of thinking tokens for thinking models that return those, such as claude-sonnet-3-7-thinking

🎤 Why is this feature needed ?

It is extremely helpful in debugging prompts, especially for larger and more complex tasks

✌️ How do you aim to achieve this?

Anthropic returns its "thoughts" in a separate field. The only unclear thing is how to name the attributes.

I propose storing the thought as a separate role, i.e.

  • gen_ai.completions.0.role = "thinking"
  • gen_ai.completions.0.content = "I am asked to ... I should ..."

🔄️ Additional Information

No response

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions