feat: add websearch endpoint to RAG API

fix: google PSE endpoint uses GET

fix: google PSE returns link, not url

fix: serper wrong field
This commit is contained in:
Jun Siang Cheah
2024-05-06 17:09:04 +08:00
parent 501ff7a98b
commit 99e4edd364
4 changed files with 76 additions and 38 deletions
+2 -2
View File
@@ -31,9 +31,9 @@ def search_serper(api_key: str, query: str) -> list[SearchResult]:
)
return [
SearchResult(
link=result["url"],
link=result["link"],
title=result.get("title"),
snippet=result.get("description"),
)
for result in results
for result in results[:5]
]