Skip to content

Commit c76f087

Browse files
feat: add Vector Index API (#894)
* chore: Update gapic-generator-python to v1.16.1 PiperOrigin-RevId: 618243632 Source-Link: googleapis/googleapis@078a38b Source-Link: googleapis/googleapis-gen@7af768c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2FmNzY4YzNmOGNlNTg5OTQ0ODIzNTBmNzQwMTE3MzMyOTk1MGEzMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add Vector Index API PiperOrigin-RevId: 618867415 Source-Link: googleapis/googleapis@277145d Source-Link: googleapis/googleapis-gen@adcd307 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWRjZDMwNzY3ODRiNWFlNGU1M2E3YjliZTE1ZDc3MjBjMmMwN2RlNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent fc7b906 commit c76f087

File tree

3 files changed

+2010
-81
lines changed

3 files changed

+2010
-81
lines changed

google/cloud/firestore_admin_v1/types/index.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ class IndexField(proto.Message):
177177
Indicates that this field supports operations on
178178
``array_value``\ s.
179179
180+
This field is a member of `oneof`_ ``value_mode``.
181+
vector_config (google.cloud.firestore_admin_v1.types.Index.IndexField.VectorConfig):
182+
Indicates that this field supports nearest
183+
neighbors and distance operations on vector.
184+
180185
This field is a member of `oneof`_ ``value_mode``.
181186
"""
182187

@@ -211,6 +216,41 @@ class ArrayConfig(proto.Enum):
211216
ARRAY_CONFIG_UNSPECIFIED = 0
212217
CONTAINS = 1
213218

219+
class VectorConfig(proto.Message):
220+
r"""The index configuration to support vector search operations
221+
222+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
223+
224+
Attributes:
225+
dimension (int):
226+
Required. The vector dimension this
227+
configuration applies to.
228+
The resulting index will only include vectors of
229+
this dimension, and can be used for vector
230+
search with the same dimension.
231+
flat (google.cloud.firestore_admin_v1.types.Index.IndexField.VectorConfig.FlatIndex):
232+
Indicates the vector index is a flat index.
233+
234+
This field is a member of `oneof`_ ``type``.
235+
"""
236+
237+
class FlatIndex(proto.Message):
238+
r"""An index that stores vectors in a flat data structure, and
239+
supports exhaustive search.
240+
241+
"""
242+
243+
dimension: int = proto.Field(
244+
proto.INT32,
245+
number=1,
246+
)
247+
flat: "Index.IndexField.VectorConfig.FlatIndex" = proto.Field(
248+
proto.MESSAGE,
249+
number=2,
250+
oneof="type",
251+
message="Index.IndexField.VectorConfig.FlatIndex",
252+
)
253+
214254
field_path: str = proto.Field(
215255
proto.STRING,
216256
number=1,
@@ -227,6 +267,12 @@ class ArrayConfig(proto.Enum):
227267
oneof="value_mode",
228268
enum="Index.IndexField.ArrayConfig",
229269
)
270+
vector_config: "Index.IndexField.VectorConfig" = proto.Field(
271+
proto.MESSAGE,
272+
number=4,
273+
oneof="value_mode",
274+
message="Index.IndexField.VectorConfig",
275+
)
230276

231277
name: str = proto.Field(
232278
proto.STRING,

0 commit comments

Comments
 (0)