Skip to content

feat: send X-Pplx-Integration header on Perplexity API requests (carries #1 by @qirh) - #4

Merged
docxology merged 1 commit into
mainfrom
feat/perplexity-integration-header-carried-forward
Nov 2, 2026
Merged

docxology merged 1 commit into
mainfrom
feat/perplexity-integration-header-carried-forward

Conversation

@docxology

Copy link
Copy Markdown
Collaborator

Carries forward #1 by @qirh as a commit of ours, so the change runs through CI here. The original PR's head branch was deleted upstream, so it cannot be merged directly; the content is unchanged.

Change

PerplexityProvider.__init__ now builds its OpenAI-compatible client with a static default_headers={"X-Pplx-Integration": "symposium"} alongside the existing base_url="https://api.perplexity.ai". The OpenRouter provider is unchanged and receives no default_headers. Authentication, models, request bodies and response handling are untouched.

The contributor's test assertions are kept as written: TestPerplexityProvider.test_init asserts the exact client construction (API key, Perplexity base URL, header) and TestOpenRouterProvider.test_init asserts default_headers is absent.

Validation

  • The Perplexity assertion fails without the source change (verified by running the test against the unmodified api.py).
  • Full suite: 621 passed, 9 skipped, coverage 88.82% (gate 80%).
  • ruff check and ruff format --check: clean.

Credit for the original change: @qirh (#1).

incorporates #1 by @qirh

Adds a static X-Pplx-Integration: symposium default header to the
OpenAI-compatible client in PerplexityProvider, which always targets
https://api.perplexity.ai. The OpenRouter provider is unchanged and receives no
default_headers.

Tests: TestPerplexityProvider.test_init asserts the client is built with the
Perplexity base URL and the header; TestOpenRouterProvider.test_init asserts
OpenRouter gets no default_headers. The Perplexity assertion fails without the
source change.

Validation: full suite 621 passed, 9 skipped, coverage 88.82% (gate 80%);
ruff check and format clean.

Co-authored-by: Saleh Alghusson <1331721+qirh@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@docxology
docxology merged commit b4d5e21 into main Nov 2, 2026
3 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.

1 participant