Skip to content
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

Simplify VectorStore interface #95

Closed
wants to merge 3 commits into from

Conversation

tzolov
Copy link
Collaborator

@tzolov tzolov commented Nov 10, 2023

  • Collapses all VectorStore similaritySearch metdods into one with SearchRequest builder.
  • Fix all affected code and tests.
  • Bump the project version to 0.7.1.
  • Adds Boot Auto-Configuraitons for milvus, pinecone and pgvector stores.

Resolves# #95, #96

 - Collapses all VectorStore similiaritySearch methdos into one with SearchRequest builder.
 - Fix all affected code and tests.
 - Bump the project version to 0.7.1.

 Resolves# 94
 - Improve and unify the VectorStore ITs.
 - Make use of TrasformersEmbeddingClient for auto-configurations ITs.
*/
public class ResourceUtils {

public static String getText(String uri) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be a constructor to Document that takes a Resource and/or have the current String constructor try to parse the passed in text to see if it is a resource string and then take appropriate action. I guess that would mean you can't create a document with the test "classpath:..."

String filterExpression) {
var filterExpressionObject = Filter.parser().parse(filterExpression);
return similaritySearch(query, topK, similarityThreshold, filterExpressionObject);
default List<Document> similaritySearch(String query) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, but we may need another overloaded metho that returns the Lists but also some 'metadata' about the query. I see that pinecone has the class QueryResponse which brings along additional metadata. That could maybe go inside the document class itself under 'queryMetadata' or some other class that augments/wraps Document, DocumentWithQueryData ?


private int topK = DEFAULT_TOP_K;

private double similarityThreshold = SIMILARITY_THRESHOLD_ACCEPT_ALL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a good default?

/**
* Enables the keep-alive function for client channel.
*/
// private boolean keepAliveWithoutCalls = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

*/
public static final int DEFAULT_TOP_K = 4;

public String query;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this public access?

@markpollack
Copy link
Member

added javadocs to the vectorstore interface and moved the code for loading a resource as a string into the test projects. That makes for some small duplication but better than leaving it in the main code base as 'test cruft'. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants