Add the autoconfigure property for the CassandraVectorStore option to return embeddings in documents from similarity searches

ref: https://github.com/spring-projects/spring-ai/pull/673
This commit is contained in:
mck
2024-05-05 19:53:22 +02:00
committed by Christian Tzolov
parent 5beef21a4e
commit cae045d52b
2 changed files with 14 additions and 1 deletions

View File

@@ -57,6 +57,9 @@ public class CassandraVectorStoreAutoConfiguration {
if (properties.getDisallowSchemaCreation()) {
builder = builder.disallowSchemaChanges();
}
if (properties.getReturnEmbeddings()) {
builder = builder.returnEmbeddings();
}
return new CassandraVectorStore(builder.build(), embeddingClient);
}

View File

@@ -41,6 +41,8 @@ public class CassandraVectorStoreProperties {
private boolean disallowSchemaChanges = false;
private boolean returnEmbeddings = false;
private int fixedThreadPoolExecutorSize = CassandraVectorStoreConfig.DEFAULT_ADD_CONCURRENCY;
public String getKeyspace() {
@@ -83,7 +85,7 @@ public class CassandraVectorStoreProperties {
this.embeddingColumnName = embeddingColumnName;
}
public Boolean getDisallowSchemaCreation() {
public boolean getDisallowSchemaCreation() {
return this.disallowSchemaChanges;
}
@@ -91,6 +93,14 @@ public class CassandraVectorStoreProperties {
this.disallowSchemaChanges = disallowSchemaCreation;
}
public boolean getReturnEmbeddings() {
return this.returnEmbeddings;
}
public void setReturnEmbeddings(boolean returnEmbeddings) {
this.returnEmbeddings = returnEmbeddings;
}
public int getFixedThreadPoolExecutorSize() {
return this.fixedThreadPoolExecutorSize;
}