-
Notifications
You must be signed in to change notification settings - Fork 299
GenAI: added reasoning tokens usage attribute #3222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
GenAI: added reasoning tokens usage attribute #3222
Conversation
model/gen-ai/registry.yaml
Outdated
| - id: gen_ai.usage.reasoning_tokens | ||
| stability: development | ||
| type: int | ||
| brief: The number of tokens used in the GenAI reasoning or thinking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably explicit if the reasoning tokens are included in gen_ai.usage.output_tokens or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great point, updated to reflect this.
| | [`gen_ai.request.choice.count`](/docs/registry/attributes/gen-ai.md) |  | `Conditionally Required` if available, in the request, and !=1 | int | The target number of candidate completions to return. | `3` | | ||
| | [`gen_ai.request.model`](/docs/registry/attributes/gen-ai.md) |  | `Conditionally Required` If available. | string | The name of the GenAI model a request is being made to. [7] | `gpt-4` | | ||
| | [`gen_ai.request.seed`](/docs/registry/attributes/gen-ai.md) |  | `Conditionally Required` if applicable and if the request includes a seed | int | Requests with same seed value more likely to return same result. | `100` | | ||
| | [`gen_ai.usage.reasoning_tokens`](/docs/registry/attributes/gen-ai.md) |  | `Conditionally Required` when available | int | The number of tokens used in the GenAI reasoning or thinking, only set this if the GenAI model provides a separate count for reasoning tokens and they are not also included in input or output tokens. | `180` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would reasoning tokens only be set if not included in output count? I think it'd be better to just state whether they're counted as part of output or not (ideally yes, so that output is consistent regardless of whether reasoning tokens are separated out by a provider), and then an implementation can do the math to ensure the values match the convention based on whether the provider includes reasoning in the output it reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, they should be a subset of output tokens.
Fixes #3194
Changes
Adds reasoning tokens as a attribute to the
gen_ai.usagefield.Merge requirement checklist
[chore]