Skip to content

[Feature Request: Add missing usage fields] #434

Open
@torstenrudolf

Description

@torstenrudolf

Feature Description

OpenAI /chat/completion API returns some "usage" information.
While this library makes some of that available in Usage.kt, the prompt_tokens_details and completion_tokens_details fields are missing.
Also see OpenAI doc for field details.

It would be great to make those details available.

Problem it Solves

Particular the prompt_tokens_details contains information about cached_tokens, which informs if OpenAI's caching is working as expected to avoid unexpected costs.

Proposed Solution

Add the missing fields to Usage.kt and read them from OpenAI's response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions