Skip to content

.Net: Bug: Chatcompletion usage object reflects only last LLM call even when multiple has been made #12617

Open
@AlesRuzickaEu

Description

@AlesRuzickaEu

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Perform IChatCompletionService.GetChatMessageContentAsync
  2. Extract usage object (for example for OpenAI)
  3. Check Token count
  4. Token count is just last API call, which can be fraction of reality

Expected behavior
I expect usage object that sums all OpenAI api calls for proper accounting

Platform

  • Language: C#
  • Source: NuGet package 1.54.0
  • AI model: OpenAI:GPT-4o-mini

Additional context
To have proper accounting of tokens spend per customer, it is a must to be able to get to proper token count somehow

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETIssue or Pull requests regarding .NET codebugSomething isn't workingtriage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions