From db3e236f34fa78b061e6af9edb6d0e83a28136ee Mon Sep 17 00:00:00 2001 From: LE Quoc Dat Date: Sat, 19 Apr 2025 15:10:15 +0100 Subject: [PATCH] fix crawl tool --- backend/agent/tools/web_search_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/agent/tools/web_search_tool.py b/backend/agent/tools/web_search_tool.py index e375cf39..aea336cf 100644 --- a/backend/agent/tools/web_search_tool.py +++ b/backend/agent/tools/web_search_tool.py @@ -278,7 +278,7 @@ class WebSearchTool(Tool): formatted_result = { "Title": item.get("title"), "URL": item.get("url") or url, - "Text": item.get("content") or item.get("text") or "", + "Text":item.get("raw_content") or item.get("content") or item.get("text") } if item.get("published_date"): formatted_result["Published Date"] = item["published_date"] @@ -312,7 +312,8 @@ if __name__ == "__main__": """Test function for the webpage crawl tool""" search_tool = WebSearchTool() result = await search_tool.crawl_webpage( - url="https://google.com" + # url="https://google.com", + url = "https://www.wired.com/story/anthropic-benevolent-artificial-intelligence/", ) print(result)