-
Notifications
You must be signed in to change notification settings - Fork 39
client: add extra_headers to stream_request() #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: add extra_headers to stream_request() #173
Conversation
…poe into feature/default_headers
src/fastapi_poe/client.py
Outdated
@property | ||
def headers(self) -> dict[str, str]: | ||
headers = {"Accept": "application/json"} | ||
headers = {**self.default_headers, "Accept": "application/json"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the order here intentional to not allow overriding the "Accept" header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was intentional, but this was added before adding extra_headers
to stream_request()
. Now I feel like it makes more sense to rename this field to extra_headers
too, and allow overriding existing header values. Updated the logic here, PLMK if you have concerns with the new logic.
Description
Added extra_headers as an optional param on stream_request() to allow passing custom headers
Changes Made
Testing Done
Version
Breaking Changes
Checklist