hrvojecukman / chat_gpt_flutter

MIT License
18 stars 9 forks source link

Not able to get totalToken #4

Closed AnandSaran closed 1 year ago

AnandSaran commented 1 year ago

Hi, I have implemented createChatCompletionStream. But in the StreamCompletionResponse not able to get the token information model UsageResponse.

iBog commented 1 year ago

As I see response objects in stream mode does not contain 'usage' section with tokens stats:

{
    "id": "cmpl-7BO0U7TFWJVvEJAYVJWjsRTqZO2w1",
    "object": "text_completion",
    "created": 1682948246,
    "choices": [
        {
            "text": " indicators",
            "index": 0,
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "model": "text-davinci-003"
}