Skip to content

Commit 0af6a11

Browse files
committed
fixed vector search type
1 parent b03d8c1 commit 0af6a11

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

google/cloud/firestore_v1/async_query.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,16 @@
2020
"""
2121
from __future__ import annotations
2222

23-
from typing import TYPE_CHECKING, Any, AsyncGenerator, List, Optional, Type
23+
from typing import (
24+
TYPE_CHECKING,
25+
Any,
26+
AsyncGenerator,
27+
List,
28+
Optional,
29+
Type,
30+
Union,
31+
Sequence,
32+
)
2433

2534
from google.api_core import gapic_v1
2635
from google.api_core import retry_async as retries
@@ -248,7 +257,7 @@ async def get(
248257
def find_nearest(
249258
self,
250259
vector_field: str,
251-
query_vector: Vector,
260+
query_vector: Union[Vector, Sequence[float]],
252261
limit: int,
253262
distance_measure: DistanceMeasure,
254263
*,
@@ -261,7 +270,7 @@ def find_nearest(
261270
Args:
262271
vector_field (str): An indexed vector field to search upon. Only documents which contain
263272
vectors whose dimensionality match the query_vector can be returned.
264-
query_vector (Vector): The query vector that we are searching on. Must be a vector of no more
273+
query_vector (Vector | Sequence[float]): The query vector that we are searching on. Must be a vector of no more
265274
than 2048 dimensions.
266275
limit (int): The number of nearest neighbors to return. Must be a positive integer of no more than 1000.
267276
distance_measure (:class:`DistanceMeasure`): The Distance Measure to use.

0 commit comments

Comments
 (0)