Type score_threshold with union, not |, to support python <3.10

This commit is contained in:
Debanjum Singh Solanky
2023-03-10 18:18:31 -06:00
parent 198d9af8cf
commit b9caad458e

View File

@@ -2,7 +2,7 @@
import math import math
import yaml import yaml
import logging import logging
from typing import List, Optional from typing import List, Optional, Union
# External Packages # External Packages
from fastapi import APIRouter from fastapi import APIRouter
@@ -60,7 +60,7 @@ def search(
n: Optional[int] = 5, n: Optional[int] = 5,
t: Optional[SearchType] = None, t: Optional[SearchType] = None,
r: Optional[bool] = False, r: Optional[bool] = False,
score_threshold: Optional[float | None] = None, score_threshold: Optional[Union[float, None]] = None,
dedupe: Optional[bool] = True, dedupe: Optional[bool] = True,
): ):
results: List[SearchResponse] = [] results: List[SearchResponse] = []