mirror of
https://github.com/livekit/agents.git
synced 2026-12-06 04:48:36 +00:00
17 lines
566 B
Python
17 lines
566 B
Python
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from livekit.plugins.perplexity import LLM, __version__
|
|
|
|
pytestmark = pytest.mark.plugin("perplexity")
|
|
|
|
|
|
def test_attribution_header_attached(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
"""X-Pplx-Integration must be attached on every outgoing chat request."""
|
|
monkeypatch.setenv("PERPLEXITY_API_KEY", "test-key")
|
|
llm = LLM()
|
|
extra_headers = llm._extra_kwargs["extra_headers"]
|
|
assert isinstance(extra_headers, dict)
|
|
assert extra_headers["X-Pplx-Integration"] == f"livekit-agents/{__version__}"
|