Skip to content

Commit 45387bd

Browse files
diberryCopilot
andcommitted
fix: review findings - auth scope, consistency, env vars
- Java: Fix TOKEN_RESOURCE from cosmos.azure.com to ossrdbms-aad.database.windows.net - TypeScript IVF: Remove inconsistent returnStoredSource field - .NET .env.example: Fix vector field name to contentVector, remove unused AZURE_TENANT_ID - Java .env.example: Remove unused AZURE_MANAGED_IDENTITY_PRINCIPAL_ID - Python .env.example: Fix API version to 2023-05-15 for consistency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 40bda58 commit 45387bd

5 files changed

Lines changed: 76 additions & 3 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Azure OpenAI Embedding Settings
2+
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-3-small
3+
AZURE_OPENAI_EMBEDDING_API_VERSION=2023-05-15
4+
AZURE_OPENAI_EMBEDDING_ENDPOINT=https://<RESOURCE-NAME>.openai.azure.com
5+
6+
# Data File Paths and Vector Configuration
7+
DATA_FILE_WITH_VECTORS=../../data/Hotels_Vector.json
8+
EMBEDDED_FIELD=contentVector
9+
EMBEDDING_DIMENSIONS=1536
10+
LOAD_SIZE_BATCH=100
11+
12+
# MongoDB/DocumentDB Connection Settings
13+
MONGO_CLUSTER_NAME=<CLUSTER-NAME>
14+
15+
# Algorithm Selection
16+
# ALGORITHM: all | diskann | hnsw | ivf
17+
ALGORITHM=all
18+
# SIMILARITY: all | COS | L2 | IP
19+
SIMILARITY=COS
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Azure DocumentDB cluster name (find in Azure Portal > DocumentDB > Overview)
2+
MONGO_CLUSTER_NAME=your-cluster-name
3+
4+
# Azure OpenAI embedding endpoint(find in Azure Portal > Azure OpenAI > Keys and Endpoint)
5+
AZURE_OPENAI_EMBEDDING_ENDPOINT=https://your-resource.openai.azure.com
6+
7+
# Azure OpenAI embedding model deployment name
8+
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-3-small
9+
10+
# Path to pre-computed vectors JSON file
11+
DATA_FILE_WITH_VECTORS=../data/Hotels_Vector.json
12+
13+
# Database name (default: Hotels)
14+
AZURE_DOCUMENTDB_DATABASENAME=Hotels
15+
16+
# Field name containing embeddings in the data file
17+
EMBEDDED_FIELD=contentVector
18+
19+
# Embedding dimensions (default: 1536)
20+
EMBEDDING_DIMENSIONS=1536
21+
22+
# Algorithm to test: all, diskann, hnsw, ivf (default: all)
23+
ALGORITHM=all
24+
25+
# Similarity to test: COS, L2, IP (default: COS)
26+
SIMILARITY=COS

ai/select-algorithm-java/src/main/java/com/azure/documentdb/selectalgorithm/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static MongoClient getMongoClient() {
5252
MongoCredential mongoCredential = MongoCredential.createOidcCredential(null)
5353
.withMechanism(MongoCredential.MONGODB_OIDC_MECHANISM)
5454
.withMechanismProperty("ENVIRONMENT", "azure")
55-
.withMechanismProperty("TOKEN_RESOURCE", "https://cosmos.azure.com");
55+
.withMechanismProperty("TOKEN_RESOURCE", "https://ossrdbms-aad.database.windows.net");
5656

5757
MongoClientSettings settings = MongoClientSettings.builder()
5858
.applyConnectionString(new ConnectionString(connectionUri))
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Azure DocumentDB cluster name (find in Azure Portal > DocumentDB > Overview)
2+
MONGO_CLUSTER_NAME=your-cluster-name
3+
4+
# Azure OpenAI embedding endpoint (find in Azure Portal > Azure OpenAI > Keys and Endpoint)
5+
AZURE_OPENAI_EMBEDDING_ENDPOINT=https://your-resource.openai.azure.com
6+
7+
# Azure OpenAI embedding model deployment name
8+
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-3-small
9+
10+
# Azure OpenAI API version (see: https://learn.microsoft.com/azure/ai-services/openai/api-version-deprecation)
11+
AZURE_OPENAI_EMBEDDING_API_VERSION=2023-05-15
12+
13+
# Database name (default: Hotels)
14+
AZURE_DOCUMENTDB_DATABASENAME=Hotels
15+
16+
# Path to pre-computed vectors JSON file (default: ../data/Hotels_Vector.json)
17+
DATA_FILE_WITH_VECTORS=../data/Hotels_Vector.json
18+
19+
# Field name containing embeddings in the data file
20+
EMBEDDED_FIELD=contentVector
21+
22+
# Embedding dimensions (default: 1536)
23+
EMBEDDING_DIMENSIONS=1536
24+
25+
# Algorithm to test: all, diskann, hnsw, ivf (default: all)
26+
ALGORITHM=all
27+
28+
# Similarity to test: COS, L2, IP (default: COS)
29+
SIMILARITY=COS

ai/select-algorithm-typescript/src/ivf.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ async function main() {
6969
vector: createEmbeddedForQueryResponse.data[0].embedding,
7070
path: config.embeddedField,
7171
k: 5
72-
},
73-
returnStoredSource: true
72+
}
7473
}
7574
},
7675
{

0 commit comments

Comments
 (0)