Skip to content

Commit

Permalink
update init output and make url parameter optional due to connection …
Browse files Browse the repository at this point in the history
…string possibility
  • Loading branch information
jgbradley1 committed Jan 14, 2025
1 parent 30cd48a commit a712953
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions graphrag/config/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@
UPDATE_STORAGE_BASE_DIR = "update_output"

VECTOR_STORE = f"""
type: {VectorStoreType.LanceDB.value}
type: {VectorStoreType.LanceDB.value} # one of [lancedb, azure_ai_search, cosmosdb]
db_uri: '{(Path(STORAGE_BASE_DIR) / "lancedb")!s}'
container_name: default
collection_name: default
overwrite: true\
"""

VECTOR_STORE_DICT = {
"type": VectorStoreType.LanceDB.value,
"db_uri": str(Path(STORAGE_BASE_DIR) / "lancedb"),
"container_name": "default",
"collection_name": "default",
"overwrite": True,
}

Expand Down
4 changes: 2 additions & 2 deletions graphrag/vector_stores/cosmosdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def __init__(self, **kwargs: Any) -> None:

def connect(self, **kwargs: Any) -> Any:
"""Connect to CosmosDB vector storage."""
url = kwargs["url"]
connection_string = kwargs.get("connection_string")
if connection_string:
self._cosmos_client = CosmosClient.from_connection_string(connection_string)
else:
if url is None:
url = kwargs.get("url")
if not url:
msg = "Either connection_string or url must be provided."
raise ValueError(msg)
self._cosmos_client = CosmosClient(
Expand Down

0 comments on commit a712953

Please sign in to comment.