Spaces:
Sleeping
Sleeping
update requirements and hybrid_retriever_tool files
Browse files
tools/__pycache__/hybrid_retriever_tool.cpython-313.pyc
ADDED
|
Binary file (4.57 kB). View file
|
|
|
tools/hybrid_retriever_tool.py
CHANGED
|
@@ -3,12 +3,12 @@ from rank_bm25 import BM25Okapi
|
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
from tavily import TavilyClient
|
| 5 |
from openai import OpenAI
|
|
|
|
| 6 |
import os
|
| 7 |
|
| 8 |
-
class HybridRetrieverTool:
|
| 9 |
-
""
|
| 10 |
-
|
| 11 |
-
"""
|
| 12 |
|
| 13 |
def __init__(self, alpha=0.6):
|
| 14 |
self.alpha = alpha
|
|
|
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
from tavily import TavilyClient
|
| 5 |
from openai import OpenAI
|
| 6 |
+
from crewai_tools import BaseTool
|
| 7 |
import os
|
| 8 |
|
| 9 |
+
class HybridRetrieverTool(BaseTool):
|
| 10 |
+
name = "Hybrid Retriever Tool"
|
| 11 |
+
description = "Combines BM25 keyword scoring with semantic similarity for hybrid retrieval"
|
|
|
|
| 12 |
|
| 13 |
def __init__(self, alpha=0.6):
|
| 14 |
self.alpha = alpha
|