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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user