Skip to content

Commit 1d85f5a

Browse files
fix(oceanbase): fix vector index creation for oceanbase (#3209)
Co-authored-by: Wendong-Fan <133094783+Wendong-Fan@users.noreply.github.com>
1 parent d485e6f commit 1d85f5a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

camel/storages/vectordb_storages/oceanbase.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ def __init__(
113113
# Create vector index
114114
index_params: IndexParams = IndexParams()
115115
index_params.add_index(
116-
IndexParam(
117-
index_name="embedding_idx",
118-
field_name="embedding",
119-
distance=self.distance,
120-
type="hnsw",
121-
m=16,
122-
ef_construction=256,
123-
)
116+
field_name="embedding",
117+
index_type="hnsw",
118+
index_name="embedding_idx",
119+
distance=self.distance,
120+
m=16,
121+
ef_construction=256,
124122
)
125123

124+
# Get the first index parameter
125+
first_index_param = next(iter(index_params))
126126
self._client.create_vidx_with_vec_index_param(
127-
table_name=self.table_name, vidx_param=index_params.params[0]
127+
table_name=self.table_name, vidx_param=first_index_param
128128
)
129129

130130
logger.info(f"Created table {self.table_name} with vector index")

0 commit comments

Comments
 (0)