Skip to content
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

Create token_count attribute #2488

Closed

Conversation

kaylareopelle
Copy link
Contributor

BLOCKED: Behavior when a chat completion has more than one message in the request and/or the response is TBD

  • Adds token_count to ChatCompletionMessage and Embedding
  • Calculates token_count in OpenAI instrumentation

When a token count is available via a usage response object, assign the token_count to the event using that value.
When a token count is not available, attempt to run the customer-provided callback set by set_llm_token_callback.
If neither of these produce an integer greater than zero or nil, don't send the token_count attribute.

Closes #2450

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant