Skip to content
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

PYTHON-4680 Make llama-index use local atlas #36

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion .evergreen/scaffold_atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def generate_collections(database: Database, collection_jsons: list[Path]) -> No


def generate_indexes(client: MongoClient, index_jsons: list[Path]) -> None:
"""_summary_
"""Generate Search or VectorSearch indexes based on the index_json provided
TODO: **Improve Documentation to include Local Atlas JSON configuration requirements*

Args:
client (MongoClient): MongoClient
Expand Down
16 changes: 16 additions & 0 deletions llama-index-python-vectorstore/indexes/fulltext_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"mappings": {
"dynamic": false,
"fields": {
"text": [
{
"type": "string"
}
]
}
},
"name": "fulltext_index",
"type": "search",
"database": "llama_index_test_db",
"collectionName": "llama_index_test_vectorstore"
}
4 changes: 4 additions & 0 deletions llama-index-python-vectorstore/indexes/vector_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"path": "embedding",
"similarity": "cosine",
"type": "vector"
},
{
"path": "metadata.text",
"type": "filter"
}
],
"name": "vector_index",
Expand Down
2 changes: 1 addition & 1 deletion llama-index-python-vectorstore/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ $PYTHON_BINARY -m poetry lock --no-update
$PYTHON_BINARY -m poetry install --with dev

# Run tests. Sensitive variables in Evergreen come from Evergreen project: ai-ml-pipeline-testing/
MONGODB_URI=$(fetch_local_atlas_uri) \
OPENAI_API_KEY=$openai_api_key \
MONGODB_URI=$llama_index_mongodb_uri \
MONGODB_DATABASE="llama_index_test_db" \
MONGODB_COLLECTION="llama_index_test_vectorstore" \
MONGODB_INDEX="vector_index" \
Expand Down