OpenAI icon indicating copy to clipboard operation
OpenAI copied to clipboard

Add support for completion_tokens_details

Open nezhyborets opened this issue 11 months ago • 0 comments

Is your feature request related to a problem? Please describe. While reviewing #255 that improves support for Reasoning Models, in the reasoning models guide I saw that they made changes to usage.completion_tokens_details. We don't have the field at all, so it was impossible to implement all the changes discussed in the guide.

Describe the solution you'd like Add completionTokenDetails: CompletionTokensDetails to ChatResult.CompletionUsage. See if it can be non-optional. See if its fields can be non-optional.

Additional context Completion tokens details and its fields seem to appear only in special cases: Predicted Outputs, Reasoning Models, Audio input. So it may be hard to test, debug and research, because currently Demo doesn't support any of the listed features. Here is a task that may be related https://github.com/MacPaw/OpenAI/issues/257

nezhyborets avatar Feb 02 '25 17:02 nezhyborets