irudnyts / openai

An R package-wrapper around OpenAI API
https://irudnyts.github.io/openai/
Other
164 stars 28 forks source link

Return entire response to enable rate limit monitoring #51

Open m-g-h opened 9 months ago

m-g-h commented 9 months ago

The headers of the response contain information about the remaining requests and tokens before limits are exceeded.

Returning the response headers along with the content (or just the entire response as is) could give access to users which need to slow down their requests.

irudnyts commented 9 months ago

Hmm, I see what you mean. If I remember correctly, the official Python package does not return the header of the response, right? What I can do then is to create a new branch, with the code that returns the entire response as is, rather than extracting and parsing the body.