Skip to content

Optionally preserve headers#81

Merged
wkok merged 4 commits intowkok:mainfrom
Kimbsy:preserve-headers
Jul 31, 2025
Merged

Optionally preserve headers#81
wkok merged 4 commits intowkok:mainfrom
Kimbsy:preserve-headers

Conversation

@Kimbsy
Copy link
Contributor

@Kimbsy Kimbsy commented Jul 21, 2025

The OpenAI response contains useful information in the headers (notably this is where the rate limiting info is returned).

This change allows the user to specify that they want the whole response returned instead of just the :body, by setting the :full-response? option.

I think returning the body by default is still sensible as this is normally what the user wants, and so it simplifies their use of the library.

This change should be backwards compatible and so shouldn't break existing code.

Kimbsy and others added 4 commits June 20, 2025 10:05
The only breaking change was martian moving from
`martian.interceptors/encode-body` to
`martian.interceptors/encode-request`.
The OpenAI response contains useful information in the
headers (notably this is where the [rate limiting
info](https://platform.openai.com/docs/guides/rate-limits#rate-limits-in-headers) is returned).

This change allows the user to specify that they want the whole
response returned instead of just the body, by setting the
`:full-response?` option.

This change should be backwards compatible and so shouldn't break
existing code.
@Kimbsy
Copy link
Contributor Author

Kimbsy commented Jul 21, 2025

tests are failing due to not having an openai api key configured 🤷

@wkok
Copy link
Owner

wkok commented Jul 31, 2025

Thanks!

@wkok wkok merged commit 05e1e9b into wkok:main Jul 31, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants