mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-31 05:42:00 +08:00
Fix: tavily search error. (#5653)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
78b2e0be89
commit
e5041749a2
@ -118,7 +118,7 @@ class DeepResearcher:
|
||||
|
||||
if self.prompt_config.get("tavily_api_key"):
|
||||
tav = Tavily(self.prompt_config["tavily_api_key"])
|
||||
tav_res = tav.retrieve_chunks(" ".join(search_query))
|
||||
tav_res = tav.retrieve_chunks(search_query)
|
||||
kbinfos["chunks"].extend(tav_res["chunks"])
|
||||
kbinfos["doc_aggs"].extend(tav_res["doc_aggs"])
|
||||
if self.prompt_config.get("use_kg") and self._kg_retrieve:
|
||||
|
@ -38,6 +38,7 @@ class Tavily:
|
||||
def retrieve_chunks(self, question):
|
||||
chunks = []
|
||||
aggs = []
|
||||
logging.info("[Tavily]Q: " + question)
|
||||
for r in self.search(question):
|
||||
id = get_uuid()
|
||||
chunks.append({
|
||||
@ -62,5 +63,5 @@ class Tavily:
|
||||
"count": 1,
|
||||
"url": r["url"]
|
||||
})
|
||||
logging.info("[Tavily]: "+r["content"][:128]+"...")
|
||||
logging.info("[Tavily]R: "+r["content"][:128]+"...")
|
||||
return {"chunks": chunks, "doc_aggs": aggs}
|
Loading…
x
Reference in New Issue
Block a user