Skip invalid research service sources (#1583)
This commit is contained in:
parent
953305a5af
commit
0ad5cd783b
2 changed files with 2 additions and 0 deletions
|
|
@ -92,6 +92,7 @@ class ResearchService:
|
|||
relevance=s.get("relevance", 0.0),
|
||||
)
|
||||
for s in result.get("sources", [])
|
||||
if isinstance(s, dict)
|
||||
]
|
||||
return ResearchResult(
|
||||
query=topic,
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ class TestDictBackCompat:
|
|||
"sources": [
|
||||
{"url": "https://x.example", "title": "X",
|
||||
"snippet": "s", "relevance": 0.9},
|
||||
"bad source row",
|
||||
],
|
||||
"sections": ["intro"],
|
||||
"tokens_used": 42,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue