feat(retrieval): add Perplexity attribution header (#24833)

Signed-off-by: James Liounis <james.liounis@perplexity.ai>
This commit is contained in:
James Liounis
2026-06-01 16:40:52 -04:00
committed by GitHub
parent c8eb8edca4
commit 69c88e163d
2 changed files with 4 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import logging
from typing import Literal, Optional
import requests
from open_webui.env import VERSION
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
MODELS = Literal[
@@ -64,6 +65,7 @@ def search_perplexity(
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
'X-Pplx-Integration': f'open-webui/{VERSION}',
}
# Make the API request

View File

@@ -2,6 +2,7 @@ import logging
from typing import Literal, Optional
import requests
from open_webui.env import VERSION
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
from open_webui.utils.headers import include_user_info_headers
@@ -47,6 +48,7 @@ def search_perplexity_search(
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
'X-Pplx-Integration': f'open-webui/{VERSION}',
}
# Forward user info headers if user is provided