Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kevlu94
Copy link
Contributor

@kevlu94 kevlu94 commented Jun 13, 2025

Description

Added extra_headers as an optional param on stream_request() to allow passing custom headers

Changes Made

  • Added extra_headers

Testing Done

  • Added unit tests to cover the updated headers building logic

Version

  • Updated to version 0.0.64

Breaking Changes

  • N/A

Checklist

  • Tests added
  • Documentation updated
  • Version bumped
  • Changes tested locally

@kevlu94 kevlu94 requested a review from a team as a code owner June 13, 2025 22:09
@property
def headers(self) -> dict[str, str]:
headers = {"Accept": "application/json"}
headers = {**self.default_headers, "Accept": "application/json"}
Copy link
Contributor

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?

Copy link
Contributor Author

@kevlu94 kevlu94 Jun 17, 2025

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.

@kevlu94 kevlu94 changed the title client: add default_headers to _BotContext client: add extra_headers to stream_request() Jun 17, 2025
@kevlu94 kevlu94 requested a review from agamble-quora June 17, 2025 16:54
@agamble-quora agamble-quora merged commit f042849 into poe-platform:main Jun 19, 2025
14 checks passed
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