mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Add tavily as web searh tool. (#5349)
### What problem does this PR solve? #5198 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -206,6 +206,8 @@ class FulltextQueryer:
|
||||
|
||||
sims = CosineSimilarity([avec], bvecs)
|
||||
tksim = self.token_similarity(atks, btkss)
|
||||
if np.sum(sims[0]) == 0:
|
||||
return np.array(tksim), tksim, sims[0]
|
||||
return np.array(sims[0]) * vtweight + np.array(tksim) * tkweight, tksim, sims[0]
|
||||
|
||||
def token_similarity(self, atks, btkss):
|
||||
|
||||
Reference in New Issue
Block a user