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:
Kevin Hu
2025-02-26 10:21:04 +08:00
committed by GitHub
parent e5e9ca0015
commit 53b9e7b52f
6 changed files with 3248 additions and 3080 deletions

View File

@ -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):