feat(retrieval): add Perplexity attribution header (#24833)
Signed-off-by: James Liounis <james.liounis@perplexity.ai>
This commit is contained in:
1 parent
c8eb8edca4
commit
69c88e163d
2 files changed
+4
No files matched your search
@@ -2,6 +2,7 @@ import logging
|
|||||||
from typing import Literal, Optional
|
from typing import Literal, Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from open_webui.env import VERSION
|
||||||
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
||||||
|
|
||||||
MODELS = Literal[
|
MODELS = Literal[
|
||||||
@@ -64,6 +65,7 @@ def search_perplexity(
|
|||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {api_key}',
|
'Authorization': f'Bearer {api_key}',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'X-Pplx-Integration': f'open-webui/{VERSION}',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make the API request
|
# Make the API request
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import logging
|
|||||||
from typing import Literal, Optional
|
from typing import Literal, Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from open_webui.env import VERSION
|
||||||
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
||||||
from open_webui.utils.headers import include_user_info_headers
|
from open_webui.utils.headers import include_user_info_headers
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ def search_perplexity_search(
|
|||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {api_key}',
|
'Authorization': f'Bearer {api_key}',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'X-Pplx-Integration': f'open-webui/{VERSION}',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Forward user info headers if user is provided
|
# Forward user info headers if user is provided
|
||||||
|
|||||||
Reference in new issue
Block a user