Przeglądaj źródła

SearchApi - Return error message instead of raising a ValueError (#11083)

tags/0.12.1
SebastjanPrachovskij 11 miesięcy temu
rodzic
commit
17ee731546
No account linked to committer's email address

+ 1
- 1
api/core/tools/provider/builtin/searchapi/tools/google.py Wyświetl plik

@@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict, type: str) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]

toret = ""
if type == "text":

+ 1
- 1
api/core/tools/provider/builtin/searchapi/tools/google_jobs.py Wyświetl plik

@@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict, type: str) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]

toret = ""
if type == "text":

+ 1
- 1
api/core/tools/provider/builtin/searchapi/tools/google_news.py Wyświetl plik

@@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict, type: str) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]

toret = ""
if type == "text":

+ 1
- 1
api/core/tools/provider/builtin/searchapi/tools/youtube_transcripts.py Wyświetl plik

@@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]

toret = ""
if "transcripts" in res and "text" in res["transcripts"][0]:

Ładowanie…
Anuluj
Zapisz