Skip to content

feat: send X-Pplx-Integration header on Perplexity API requests - #1

Closed
qirh wants to merge 1 commit into
ActiveInferenceInstitute:mainfrom
qirh:feat/perplexity-integration-header
Closed

qirh wants to merge 1 commit into
ActiveInferenceInstitute:mainfrom
qirh:feat/perplexity-integration-header

Conversation

@qirh

@qirh qirh commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

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 does not receive the header.

This lets Perplexity attribute API traffic to Symposium. Authentication, models, request bodies and response handling are unchanged.

Tests: TestPerplexityProvider.test_init now asserts the client is built with the Perplexity base URL and the header, and TestOpenRouterProvider.test_init asserts OpenRouter gets no default_headers.

Verification (locally, matching CI):

  • ruff check src/ tests/ and ruff format --check src/ tests/ pass.
  • python -m pytest --no-header: 188 passed, 8 skipped, coverage 86.26% (gate 80%). The updated Perplexity assertion fails without the source change.

docxology added a commit that referenced this pull request Nov 2, 2026
…ntegration-header-carried-forward

Carries forward #1 by @qirh as our own commit so the change runs through CI here.

The original PR's head branch was deleted upstream, so it could not be merged directly; the content is unchanged and the contributor's test assertions are kept as written.

Validation: full suite 621 passed / 9 skipped / coverage 88.82%; ruff check and format clean; the Perplexity assertion fails without the source change. Remote CI run 41376147431 passed on 3.12, 3.13 and 3.14.
@docxology

Copy link
Copy Markdown
Collaborator

The head branch for this pull request was deleted upstream, so it could not be merged directly. The change is carried forward in this repository as commit 4e1cde8 (merge b4d5e21), with credit to @qirh: PerplexityProvider now sends the X-Pplx-Integration: symposium default header, the OpenRouter provider is unchanged, and your test assertions are kept exactly as written (the Perplexity assertion fails without the source change). It passed CI on Python 3.12, 3.13 and 3.14.

Closing this PR as superseded by #4. Thank you for the change, @qirh.

@docxology docxology closed this Nov 2, 2026
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