refac: modernize imports, standardize type hints and docstrings
This commit is contained in:
1 parent
998c86a52b
commit
a59c967d7e
16 files changed
+118
-142
No files matched your search
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
import requests
|
||||
@@ -6,7 +8,6 @@ from yarl import URL
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def search_jina(api_key: str, query: str, count: int, base_url: str = '') -> list[SearchResult]:
|
||||
"""
|
||||
Search using Jina's Search API and return the results as a list of SearchResult objects.
|
||||
@@ -17,9 +18,9 @@ def search_jina(api_key: str, query: str, count: int, base_url: str = '') -> lis
|
||||
base_url (str): Optional custom base URL for the Jina API
|
||||
|
||||
Returns:
|
||||
list[SearchResult]: A list of search results
|
||||
A list of SearchResult objects.
|
||||
"""
|
||||
jina_search_endpoint = base_url if base_url else 'https://s.jina.ai/'
|
||||
jina_search_endpoint = base_url or 'https://s.jina.ai/'
|
||||
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
|
||||
Reference in new issue
Block a user