-
Notifications
You must be signed in to change notification settings - Fork 532
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
Conversation
- 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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
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'. ;) |
Resolves# #95, #96