Address Perplexity attribution test review

This commit is contained in:
Saleh Alghusson 2026-08-28 12:15:32 -04:00
parent 9dbb06ca29
commit b4419f2a21
No known key found for this signature in database

View file

@ -21,15 +21,21 @@ class TestPerplexityChatTransformation:
("headers", "expected"),
[({}, "litellm"), ({"x-pplx-integration": "custom"}, "custom")],
)
def test_integration_header_default_is_caller_overridable(self, headers, expected):
headers = PerplexityChatConfig().validate_environment(
def test_integration_header_default_is_caller_overridable(
self, headers: dict[str, str], expected: str
):
validated_headers = PerplexityChatConfig().validate_environment(
headers=headers,
model="sonar",
messages=[],
optional_params={},
litellm_params={},
)
request = httpx.Request("POST", "https://api.perplexity.ai/chat/completions", headers=headers)
request = httpx.Request(
"POST",
"https://api.perplexity.ai/chat/completions",
headers=validated_headers,
)
assert request.headers.get_list("x-pplx-integration") == [expected]