Skip to content
Snippets Groups Projects
Commit 94766893 authored by Simonas's avatar Simonas
Browse files

fix: typing hint

parent c3648c0f
Branches
Tags
No related merge requests found
......@@ -512,7 +512,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.18"
}
},
"nbformat": 4,
......
......@@ -6,7 +6,7 @@ from semantic_router.utils.logger import logger
class BM25Encoder(BaseEncoder):
model: Optional[Any] = None
idx_mapping: Optional[dict[int, int]] = None
idx_mapping: dict[int, int] | None = None
type: str = "sparse"
def __init__(
......
......@@ -20,7 +20,7 @@ class HybridRouteLayer:
def __init__(
self,
encoder: BaseEncoder,
sparse_encoder: Optional[BaseEncoder] = None,
sparse_encoder: Optional[BM25Encoder] = None,
routes: list[Route] = [],
alpha: float = 0.3,
):
......
......@@ -158,6 +158,7 @@ class RouteLayer:
encoder: Optional[BaseEncoder] = None,
llm: Optional[BaseLLM] = None,
routes: Optional[list[Route]] = None,
top_k_routes: int = 3,
):
logger.info("Initializing RouteLayer")
self.index = None
......
......@@ -23,6 +23,8 @@ class EncoderType(Enum):
class RouteChoice(BaseModel):
name: Optional[str] = None
function_call: Optional[dict] = None
similarity_score: Optional[float] = None
trigger: Optional[bool] = None
@dataclass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment