-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
Description
Ideally a new annotation on the Hash field with connect it to the Vectorize annotation 'source' something like:
@Document
public class DocWithCustomModelOpenAIEmbedding {
@Id
private String id;
@Indexed
@NonNull
private String name;
@Indexed( //
schemaFieldType = SchemaFieldType.VECTOR, //
algorithm = VectorAlgorithm.HNSW, //
type = VectorType.FLOAT32, //
dimension = 3072, //
distanceMetric = DistanceMetric.COSINE, //
initialCapacity = 10
)
private float[] textEmbedding;
@Vectorize( //
destination = "textEmbedding", //
embeddingType = EmbeddingType.SENTENCE, //
provider = EmbeddingProvider.OPENAI, //
openAiEmbeddingModel = EmbeddingModel.TEXT_EMBEDDING_3_LARGE, //
trackChanges = true // <==== This will tell OM to hash the field into a private JSON or Hash field like `_text_hash` matching the name of the field below
)
@NonNull
private String text;
}