[Feature Request]: 'connection_string' support for vector_store (cosmosdb)
Do you need to file an issue?
- [x] I have searched the existing issues and this feature is not already filed.
- [x] My model is hosted on OpenAI or Azure. If not, please look at the "model providers" issue and don't file a new one here.
- [x] I believe this is a legitimate feature request, not just a question. If this is a question, please use the Discussions area.
Is your feature request related to a problem? Please describe.
Hi, in graphrag 2.0, it seems that if we give a connection_string parameter for the Cosmosdb vector store config, it is ignored and not used by the CosmosdbVectoreStore. It is likely because, the vector store config class does not contain this parameter any more.
References: https://github.com/microsoft/graphrag/blob/bcb74789f15e88303a8a87c918bbeb5153ecee8e/graphrag/config/defaults.py#L390 https://github.com/microsoft/graphrag/blob/bcb74789f15e88303a8a87c918bbeb5153ecee8e/graphrag/config/models/vector_store_config.py#L12 https://github.com/microsoft/graphrag/blob/bcb74789f15e88303a8a87c918bbeb5153ecee8e/graphrag/vector_stores/cosmosdb.py#L43
Describe the solution you'd like
- We could include the connection_string parameter within the VectorStoreConfig class.
- Another solution is to store the access_key in the api_key parameter, and then call cosmos_client in (vector_stores/cosmosdb.py) like this:
access_key = kwargs.get("api_key")
if access_key:
self._cosmos_client = CosmosClient(
url=url, credential=access_key
)
else:
self._cosmos_client = CosmosClient(
url=url, credential=DefaultAzureCredential()
)
Additional context
No response
I’m encountering the same issue.
I tried providing connection_string in the vector_store config for CosmosDB, but it seems to be ignored, and the code still falls back to DefaultAzureCredential(), which results in a 403 error
@natoverse