mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-15 03:04:44 +08:00
refine the research prompt (#460)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import logging
|
||||
import json
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
|
||||
@@ -15,6 +16,8 @@ from src.tools.tavily_search.tavily_search_api_wrapper import (
|
||||
EnhancedTavilySearchAPIWrapper,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TavilySearchResultsWithImages(TavilySearchResults): # type: ignore[override, override]
|
||||
"""Tool that queries the Tavily Search API and gets back json.
|
||||
@@ -123,7 +126,9 @@ class TavilySearchResultsWithImages(TavilySearchResults): # type: ignore[overri
|
||||
except Exception as e:
|
||||
return repr(e), {}
|
||||
cleaned_results = self.api_wrapper.clean_results_with_images(raw_results)
|
||||
print("sync", json.dumps(cleaned_results, indent=2, ensure_ascii=False))
|
||||
logger.debug(
|
||||
"sync: %s", json.dumps(cleaned_results, indent=2, ensure_ascii=False)
|
||||
)
|
||||
return cleaned_results, raw_results
|
||||
|
||||
async def _arun(
|
||||
@@ -147,5 +152,7 @@ class TavilySearchResultsWithImages(TavilySearchResults): # type: ignore[overri
|
||||
except Exception as e:
|
||||
return repr(e), {}
|
||||
cleaned_results = self.api_wrapper.clean_results_with_images(raw_results)
|
||||
print("async", json.dumps(cleaned_results, indent=2, ensure_ascii=False))
|
||||
logger.debug(
|
||||
"async: %s", json.dumps(cleaned_results, indent=2, ensure_ascii=False)
|
||||
)
|
||||
return cleaned_results, raw_results
|
||||
|
||||
Reference in New Issue
Block a user