Skip to content

Commit 4102d04

Browse files
committed
update for 3.9 mypy
1 parent 5c0f6ba commit 4102d04

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

redisvl/extensions/router/semantic.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import random
21
from pathlib import Path
32
from typing import Any, Dict, List, Optional, Type
43

5-
import numpy as np
64
import redis.commands.search.reducers as reducers
75
import yaml
86
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr
@@ -162,7 +160,7 @@ def update_routing_config(self, routing_config: RoutingConfig):
162160
"""
163161
self.routing_config = routing_config
164162

165-
def update_route_thresholds(self, route_thresholds: Dict[str, float | None]):
163+
def update_route_thresholds(self, route_thresholds: Dict[str, Optional[float]]):
166164
"""Update the distance thresholds for each route.
167165
168166
Args:
@@ -363,7 +361,7 @@ def __call__(
363361
statement: Optional[str] = None,
364362
vector: Optional[List[float]] = None,
365363
aggregation_method: Optional[DistanceAggregationMethod] = None,
366-
distance_threshold: float | None = None,
364+
distance_threshold: Optional[float] = None,
367365
) -> RouteMatch:
368366
"""Query the semantic router with a given statement or vector.
369367
@@ -395,7 +393,7 @@ def route_many(
395393
statement: Optional[str] = None,
396394
vector: Optional[List[float]] = None,
397395
max_k: Optional[int] = None,
398-
distance_threshold: float | None = None,
396+
distance_threshold: Optional[float] = None,
399397
aggregation_method: Optional[DistanceAggregationMethod] = None,
400398
) -> List[RouteMatch]:
401399
"""Query the semantic router with a given statement or vector for multiple matches.

0 commit comments

Comments
 (0)