Skip to content

GetStreamingResponseAsync: ChatResponseUpdate missing LoadDuration and TotalDuration metrics #368

@JerryJian

Description

@JerryJian

Is your feature request related to a problem? Please describe.

Currently, when using GetStreamingResponseAsync, the streaming chunks provide the message content effectively. However, the final stream object (where Done is true) does not expose crucial performance metrics such as LoadDuration, TotalDuration, PromptEvalCount, and EvalCount.

While the underlying Ollama API returns these metrics in the final JSON chunk of the stream, OllamaSharp currently does not map or expose them in the ChatResponseUpdate object. This makes it difficult to track latency and token usage statistics when using the streaming interface.

Describe the solution you'd like

I would like the ChatResponseUpdate (or the final stream chunk where Done == true) to include properties for:

  • LoadDuration
  • TotalDuration
  • PromptEvalDuration
  • EvalDueration

These values should be populated from the final JSON response provided by the Ollama API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions