Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix(oceanbase): fix vector index creation for oceanbase (#3209)

zhouyh1d85f5a14195
diff --git a/camel/storages/vectordb_storages/oceanbase.py b/camel/storages/vectordb_storages/oceanbase.py
index 5c7f4e249..60ec1d0ef 100644
--- a/camel/storages/vectordb_storages/oceanbase.py
+++ b/camel/storages/vectordb_storages/oceanbase.py
@@ -113,18 +113,18 @@ class OceanBaseStorage(BaseVectorStorage):
# Create vector index
index_params: IndexParams = IndexParams()
index_params.add_index(
- IndexParam(
- index_name="embedding_idx",
- field_name="embedding",
- distance=self.distance,
- type="hnsw",
- m=16,
- ef_construction=256,
- )
+ field_name="embedding",
+ index_type="hnsw",
+ index_name="embedding_idx",
+ distance=self.distance,
+ m=16,
+ ef_construction=256,
)
+ # Get the first index parameter
+ first_index_param = next(iter(index_params))
self._client.create_vidx_with_vec_index_param(
- table_name=self.table_name, vidx_param=index_params.params[0]
+ table_name=self.table_name, vidx_param=first_index_param
)
logger.info(f"Created table {self.table_name} with vector index")