-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy #39379
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
Changes from 11 commits
0269f52
29ad391
cd4d8cf
a2f6a83
c4bc283
af99d7b
6d8fc9b
2f7112d
158880f
bb85dd3
a7185d7
f4c4012
72a4bcd
dfb3575
67f51cb
730f8c2
ad3ac89
940c6af
3eb77ea
44f4e07
460f681
5579dd1
54a2ce3
528a0eb
148cba5
df7e838
c8de52f
425b78f
55efb81
9a3b003
52917f9
72a7145
43f1d83
fd13d87
4055fe8
62931db
f7f7d08
bce71de
0a0a26a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.cosmos.models; | ||
|
|
||
| /** | ||
| * Distance Function for the embeddings in the Cosmos DB database service. | ||
| */ | ||
| public enum DistanceFunction { | ||
| /** | ||
| * Represents the euclidean distance function. | ||
| */ | ||
| EUCLIDEAN("euclidean"), | ||
|
|
||
| /** | ||
| * Represents the cosine distance function. | ||
| */ | ||
| COSINE("cosine"), | ||
|
|
||
| /** | ||
| * Represents the dot product distance function. | ||
| */ | ||
| DOT_PRODUCT("dotproduct"); | ||
|
|
||
| private final String overWireValue; | ||
|
|
||
| DistanceFunction(String overWireValue) { | ||
| this.overWireValue = overWireValue; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return this.overWireValue; | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @return value for the enum | ||
| */ | ||
| public String getValue() { | ||
aayush3011 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return this.overWireValue; | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @return if the value for the enum is empty or not. | ||
| */ | ||
| public boolean isEmpty() { | ||
aayush3011 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return this.overWireValue.isEmpty(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.cosmos.models; | ||
|
|
||
| import com.azure.cosmos.implementation.Constants; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| /** | ||
| * Embedding settings within {@link VectorEmbeddingPolicy} | ||
| */ | ||
| public final class Embedding { | ||
aayush3011 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| @JsonProperty(Constants.Properties.PATH) | ||
| private String path; | ||
| @JsonProperty(Constants.Properties.VECTOR_DATA_TYPE) | ||
| private String vectorDataType; | ||
| @JsonProperty(Constants.Properties.VECTOR_DIMENSIONS) | ||
| private Long dimensions; | ||
| @JsonProperty(Constants.Properties.DISTANCE_FUNCTION) | ||
| private String distanceFunction; | ||
|
|
||
aayush3011 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /** | ||
| * Gets the path for the embedding. | ||
| * | ||
| * @return path | ||
| */ | ||
| public String getPath() { | ||
|
||
| return path; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the path for the embedding. | ||
| * | ||
| * @param path the path for the embedding | ||
| * @return Embedding | ||
| */ | ||
| public Embedding setPath(String path) { | ||
| this.path = path; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the data type for the embedding. | ||
| * | ||
| * @return vectorDataType | ||
| */ | ||
| public String getVectorDataType() { | ||
| return vectorDataType; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the data type for the embedding. | ||
| * | ||
| * @param vectorDataType the data type for the embedding | ||
| * @return Embedding | ||
| */ | ||
| public Embedding setVectorDataType(String vectorDataType) { | ||
|
||
| this.vectorDataType = vectorDataType; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the dimensions for the embedding. | ||
| * | ||
| * @return dimensions | ||
| */ | ||
| public Long getDimensions() { | ||
| return dimensions; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the dimensions for the embedding. | ||
| * | ||
| * @param dimensions the dimensions for the embedding | ||
| * @return Embedding | ||
| */ | ||
| public Embedding setDimensions(Long dimensions) { | ||
| this.dimensions = dimensions; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the distanceFunction for the embedding. | ||
| * | ||
| * @return distanceFunction | ||
| */ | ||
| public String getDistanceFunction() { | ||
| return distanceFunction; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the distanceFunction for the embedding. | ||
| * | ||
| * @param distanceFunction the distanceFunction for the embedding | ||
| * @return Embedding | ||
| */ | ||
| public Embedding setDistanceFunction(String distanceFunction) { | ||
|
||
| this.distanceFunction = distanceFunction; | ||
| return this; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.