Files
livekit-agents/python/tests/test_plugin_perplexity.py
T

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__}"