Skip to content

Commit

Permalink
Merge pull request vanna-ai#490 from Anush008/qdrant-suffix-fix
Browse files Browse the repository at this point in the history
fix: Qdrant id_suffixes when using custom collection names
  • Loading branch information
zainhoda authored Jun 10, 2024
2 parents 7ad88c1 + e0ff865 commit 56b782b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/vanna/qdrant/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ class Qdrant_VectorStore(VannaBase):
TypeError: If config["client"] is not a `qdrant_client.QdrantClient` instance
"""

documentation_collection_name = "documentation"
ddl_collection_name = "ddl"
sql_collection_name = "sql"

id_suffixes = {
ddl_collection_name: "ddl",
documentation_collection_name: "doc",
sql_collection_name: "sql",
}

def __init__(
self,
config={},
Expand Down Expand Up @@ -80,15 +70,21 @@ def __init__(
self.collection_params = config.get("collection_params", {})
self.distance_metric = config.get("distance_metric", models.Distance.COSINE)
self.documentation_collection_name = config.get(
"documentation_collection_name", self.documentation_collection_name
"documentation_collection_name", "documentation"
)
self.ddl_collection_name = config.get(
"ddl_collection_name", self.ddl_collection_name
"ddl_collection_name", "ddl"
)
self.sql_collection_name = config.get(
"sql_collection_name", self.sql_collection_name
"sql_collection_name", "sql"
)

self.id_suffixes = {
self.ddl_collection_name: "ddl",
self.documentation_collection_name: "doc",
self.sql_collection_name: "sql",
}

self._setup_collections()

def add_question_sql(self, question: str, sql: str, **kwargs) -> str:
Expand Down

0 comments on commit 56b782b

Please sign in to comment.