Skip to content

Commit

Permalink
fix(rdb_summary-wide_table): delete database profile
Browse files Browse the repository at this point in the history
  • Loading branch information
dongzhancai1 committed Dec 18, 2024
1 parent 767539d commit c6318c8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dbgpt/rag/summary/db_summary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,26 @@ def init_db_profile(self, db_summary_client, dbname):
def delete_db_profile(self, dbname):
"""Delete db profile."""
vector_store_name = dbname + "_profile"
table_vector_store_name = dbname + "_profile"
field_vector_store_name = dbname + "_profile_field"
from dbgpt.serve.rag.connector import VectorStoreConnector
from dbgpt.storage.vector_store.base import VectorStoreConfig

vector_store_config = VectorStoreConfig(name=vector_store_name)
vector_connector = VectorStoreConnector.from_default(
table_vector_store_config = VectorStoreConfig(name=vector_store_name)
field_vector_store_config = VectorStoreConfig(name=field_vector_store_name)
table_vector_connector = VectorStoreConnector.from_default(
CFG.VECTOR_STORE_TYPE,
self.embeddings,
vector_store_config=vector_store_config,
vector_store_config=table_vector_store_config,
)
vector_connector.delete_vector_name(vector_store_name)
field_vector_connector = VectorStoreConnector.from_default(
CFG.VECTOR_STORE_TYPE,
self.embeddings,
vector_store_config=field_vector_store_config,
)

table_vector_connector.delete_vector_name(table_vector_store_name)
field_vector_connector.delete_vector_name(field_vector_store_name)
logger.info(f"delete db profile {dbname} success")

@staticmethod
Expand Down

0 comments on commit c6318c8

Please sign in to comment.