spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

How to expose vendor specific usage information

Open markpollack opened this issue 1 year ago • 0 comments

OpenAI added a new usage field,

    "usage": {
        "prompt_tokens": 13,
        "completion_tokens": 7,
        "total_tokens": 20,
        "completion_tokens_details": {
            "reasoning_tokens": 0
        }
    },

this should be made available in some way via the org.springframework.ai.chat.metadata.Usage interface

See https://github.com/spring-projects/spring-ai/pull/1394

markpollack avatar Sep 24 '24 21:09 markpollack