Skip to content

Commit

Permalink
Add the autoconfigure property for the CassandraVectorStore option to…
Browse files Browse the repository at this point in the history
… return embeddings in documents from similarity searches

 ref: #673
  • Loading branch information
michaelsembwever authored and tzolov committed May 10, 2024
1 parent 5beef21 commit cae045d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public CassandraVectorStore vectorStore(EmbeddingClient embeddingClient, Cassand
if (properties.getDisallowSchemaCreation()) {
builder = builder.disallowSchemaChanges();
}
if (properties.getReturnEmbeddings()) {
builder = builder.returnEmbeddings();
}

return new CassandraVectorStore(builder.build(), embeddingClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -83,14 +85,22 @@ public void setEmbeddingColumnName(String embeddingColumnName) {
this.embeddingColumnName = embeddingColumnName;
}

public Boolean getDisallowSchemaCreation() {
public boolean getDisallowSchemaCreation() {
return this.disallowSchemaChanges;
}

public void setDisallowSchemaCreation(boolean disallowSchemaCreation) {
this.disallowSchemaChanges = disallowSchemaCreation;
}

public boolean getReturnEmbeddings() {
return this.returnEmbeddings;
}

public void setReturnEmbeddings(boolean returnEmbeddings) {
this.returnEmbeddings = returnEmbeddings;
}

public int getFixedThreadPoolExecutorSize() {
return this.fixedThreadPoolExecutorSize;
}
Expand Down

0 comments on commit cae045d

Please sign in to comment.