Skip to content

[Bugfix] Fixes broken link in README. Improves naming consistency #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datastore/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def get_datastore() -> DataStore:
)

return ElasticsearchDataStore()
case "mongodb":
case "mongodb-atlas":
from datastore.providers.mongodb_atlas_datastore import (
MongoDBAtlasDataStore,
)
Expand All @@ -77,5 +77,5 @@ async def get_datastore() -> DataStore:
case _:
raise ValueError(
f"Unsupported vector database: {datastore}. "
f"Try one of the following: llama, elasticsearch, pinecone, weaviate, milvus, zilliz, redis, azuresearch, or qdrant"
f"Try one of the following: mongodb-atlas, llama, elasticsearch, pinecone, weaviate, milvus, zilliz, redis, azuresearch, or qdrant"
)
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ You can confirm that the required ones have been set like this: `assert "MONGOD
| `MONGODB_DATABASE` | Database name | SQUAD |
| `MONGODB_COLLECTION` | Collection name | Beyonce |
| `MONGODB_INDEX` | Search index name | vector_index |
| `DATASTORE` | Datastore name | [must be] mongodb |
| `DATASTORE` | Datastore name | [must be] mongodb-atlas |
| `EMBEDDING_MODEL` | OpenAI Embedding Model | text-embedding-3-small |
| `EMBEDDING_DIMENSION` | Length of Embedding Vectors | 1536 |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
" * Create a MongoDB Atlas cluster.\n",
" * Add a Vector Index Search to it.<br><br>\n",
"\n",
" Begin by following the detailed steps in **[setup.md](https://github.com/caseyclements/chatgpt-retrieval-plugin/blob/mongodb/docs/providers/mongodb/setup.md)**.\n",
" Begin by following the detailed steps in **[setup.md](https://github.com/caseyclements/chatgpt-retrieval-plugin/blob/mongodb/docs/providers/mongodb_atlas/setup.md)**.\n",
" Once completed, you will have a running Cluster, with a Database, a Collection, and a Vector Search Index attached to it.\n",
"\n",
" You will also have a number of required environment variables. These need to be available to run this example.\n",
Expand Down Expand Up @@ -93,7 +93,7 @@
"import os\n",
"required_vars = {'BEARER_TOKEN', 'OPENAI_API_KEY', 'DATASTORE', 'EMBEDDING_DIMENSION', 'EMBEDDING_MODEL',\n",
" 'MONGODB_COLLECTION', 'MONGODB_DATABASE', 'MONGODB_INDEX', 'MONGODB_URI'}\n",
"assert os.environ[\"DATASTORE\"] == 'mongodb'\n",
"assert os.environ[\"DATASTORE\"] == 'mongodb-atlas'\n",
"missing = required_vars - set(os.environ)\n",
"if missing:\n",
" print(f\"It is strongly recommended to set these additional environment variables. {missing}=\")"
Expand Down Expand Up @@ -418,7 +418,7 @@
"\n",
"Posting an `upsert` request to the ChatGPT Retrieval Plugin API performs two tasks on the backend. First, it inserts into (or updates) your data in the MONGODB_COLLECTION in the MongoDB Cluster that you setup. Second, Atlas asynchronously begins populating a Vector Search Index on the embedding key. \n",
"\n",
"If you have already created the Collection and a Vector Search Index through the Atlas UI while Setting up MongoDB Atlas Cluster in [setup.md](https://github.com/caseyclements/chatgpt-retrieval-plugin/blob/main/docs/providers/mongodb/setup.md), then indexing will begin immediately.\n",
"If you have already created the Collection and a Vector Search Index through the Atlas UI while Setting up MongoDB Atlas Cluster in [setup.md](https://github.com/caseyclements/chatgpt-retrieval-plugin/blob/main/docs/providers/mongodb_atlas/setup.md), then indexing will begin immediately.\n",
"\n",
"If you haven't set up the Atlas Vector Search yet, no problem. `upsert` will insert the data. To start indexing, simply go back to the Atlas UI and add a Search Index. This will trigger indexing. Once complete, we can begin semantic queries!\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions tests/datastore/providers/mongodb_atlas/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Integration Tests of ChatGPT Retrieval Plugin
with MongoDB Atlas Vector Datastore and OPENAI Embedding model.

As described in docs/providers/mongodb/setup.md, to run this, one must
As described in docs/providers/mongodb_atlas/setup.md, to run this, one must
have a running MongoDB Atlas Cluster, and
provide a valid OPENAI_API_KEY.
"""
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_required_vars() -> None:
"""Confirm that the environment has all it needs"""
required_vars = {'BEARER_TOKEN', 'OPENAI_API_KEY', 'DATASTORE', 'EMBEDDING_DIMENSION', 'EMBEDDING_MODEL',
'MONGODB_COLLECTION', 'MONGODB_DATABASE', 'MONGODB_INDEX', 'MONGODB_URI'}
assert os.environ["DATASTORE"] == 'mongodb'
assert os.environ["DATASTORE"] == 'mongodb-atlas'
missing = required_vars - set(os.environ)
assert len(missing) == 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Integration tests of MongoDB Atlas Datastore.

These tests require one to have a running Cluster, Database, Collection and Atlas Search Index
as described in docs/providers/mongodb/setup.md.
as described in docs/providers/mongodb_atlas/setup.md.

One will also have to set the same environment variables. Although one CAN
use we the same collection and index used in examples/providers/mongodb/semantic-search.ipynb,
use we the same collection and index used in examples/providers/mongodb_atlas/semantic-search.ipynb,
these tests will make changes to the data, so you may wish to create another collection.
If you have run the example notebook, you can reuse with the following.

Expand Down