Closed krio-rogue closed 1 year ago
I agree. We need this for things like calculating how many tokens were used.
I submitted this PR that would accomplish this: https://github.com/openai-php/client/pull/187
You can now use the latest release which gives you access to the header / meta information on every response: https://github.com/openai-php/client#meta-information
Hi. When requesting
https://api.openai.com/v1/chat/completions
in streaming mode, the HTTP response contains a set of headers with service information likeX-Ratelimit-Remaining-Tokens:
.Is it possible to add a method to retrieve all headers from stream? Or make the
$response
property in theOpenAI\Responses\StreamResponse
class public?