-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is this your first time submitting a feature request?
- I have searched the existing issues, and I could not find an existing issue for this feature
- I am requesting a straightforward extension of existing functionality
Describe the feature
As of 1.0.0, it is easy to get this wrong, seeing as types like id/namespace are the same, and since this library is written in Java, I can't use named arguments in Kotlin land.
return index.query(
topK ?: DEFAULT_TOP_K,
denseVector,
filteredSparseVector?.indicesWithUnsigned32IntList,
filteredSparseVector?.valuesList,
null,
namespace,
filter?.let { PineconeStructUtils.fromMap(it) },
includeMetadata,
includeValues,
)
In the old way, the declarative approach towards specifying arguments was less error prone:
val queryRequest = QueryRequest.newBuilder()
.addAllVector(denseVector)
.setTopK(topK ?: DEFAULT_TOP_K)
.setIncludeMetadata(includeMetadata)
.setIncludeValues(includeValues)
.setNamespace(namespace)
.apply {
filter?.let { setFilter(PineconeStructUtils.fromMap(it)) }
sparseVector
?.takeIf { it.indicesCount in 1..MAX_SPARSE_SIZE }
?.let {
setSparseVector(it)
}
}
.build()
Two questions:
- Any reason for the transition away from a builder pattern?
- Are you planning on releasing a Kotlin shim?
Describe alternatives you've considered
No response
Who will this benefit?
Anyone who find it currently a bit tedious having to deal with 5+ parameters for a function call.
Are you interested in contributing this feature?
Sure, I can look into helping with this.
Anything else?
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request