Skip to content

[Bug]: It does not support OpenAI's new parameter include_usage to retrieve completion token usage at the end of the stream chunk. #604

Closed as not planned
@niknir

Description

@niknir

Description

[Bug]: It does not support OpenAI's new parameter include_usage to retrieve completion token usage at the end of the stream chunk.

Please support in your SDK.

Steps To Reproduce

$promt = [
                    'model' => $model,
                    'temperature' => $temperature,
                    'response_format' => ["type" => "json_object"],
                    'messages' => [['role' => 'user', 'content' => $prompt]],
                    'stream' => true,
                    'stream_options' => ['include_usage' => true]
                ];
                $stream = OpenAI::chat()->createStreamed($promtLog);

OpenAI PHP Client Version

^0.7.8

PHP Version

8.2

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions