mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-10 07:38:59 +08:00
fix: serply credential check query might return empty records (#12784)
This commit is contained in:
parent
3defd24087
commit
5ff08e241a
@ -43,7 +43,7 @@ class SerplyApi:
|
||||
def parse_results(res: dict) -> str:
|
||||
"""Process response from Serply Job Search."""
|
||||
jobs = res.get("jobs", [])
|
||||
if not jobs:
|
||||
if not res or "jobs" not in res:
|
||||
raise ValueError(f"Got error from Serply: {res}")
|
||||
|
||||
string = []
|
||||
|
@ -43,7 +43,7 @@ class SerplyApi:
|
||||
def parse_results(res: dict) -> str:
|
||||
"""Process response from Serply News Search."""
|
||||
news = res.get("entries", [])
|
||||
if not news:
|
||||
if not res or "entries" not in res:
|
||||
raise ValueError(f"Got error from Serply: {res}")
|
||||
|
||||
string = []
|
||||
|
@ -43,7 +43,7 @@ class SerplyApi:
|
||||
def parse_results(res: dict) -> str:
|
||||
"""Process response from Serply News Search."""
|
||||
articles = res.get("articles", [])
|
||||
if not articles:
|
||||
if not res or "articles" not in res:
|
||||
raise ValueError(f"Got error from Serply: {res}")
|
||||
|
||||
string = []
|
||||
|
@ -42,7 +42,7 @@ class SerplyApi:
|
||||
def parse_results(res: dict) -> str:
|
||||
"""Process response from Serply Web Search."""
|
||||
results = res.get("results", [])
|
||||
if not results:
|
||||
if not res or "results" not in res:
|
||||
raise ValueError(f"Got error from Serply: {res}")
|
||||
|
||||
string = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user