mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Address Perplexity attribution test review
This commit is contained in:
parent
9dbb06ca29
commit
b4419f2a21
1 changed files with 9 additions and 3 deletions
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue