Package org.springframework.ai.chroma
Record Class ChromaApi.QueryRequest
java.lang.Object
java.lang.Record
org.springframework.ai.chroma.ChromaApi.QueryRequest
- Record Components:
queryEmbeddings
- The embeddings to get the closes neighbors of.nResults
- The number of neighbors to return for each query_embedding or query_texts.where
- Condition to filter results based on metadata values.include
- A list of what to include in the results. Can contain "embeddings", "metadatas", "documents", "distances". Ids are always included. Defaults to [metadatas, documents, distances].
- Enclosing class:
- ChromaApi
public static record ChromaApi.QueryRequest(List<float[]> queryEmbeddings, Integer nResults, Map<String,Object> where, List<ChromaApi.QueryRequest.Include> include)
extends Record
Request to get the nResults nearest neighbor embeddings for provided
queryEmbeddings.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionQueryRequest
(float[] queryEmbedding, Integer nResults) Convenience to query for a single embedding instead of a batch of embeddings.QueryRequest
(float[] queryEmbedding, Integer nResults, Map<String, Object> where) QueryRequest
(List<float[]> queryEmbeddings, Integer nResults, Map<String, Object> where, List<ChromaApi.QueryRequest.Include> include) Creates an instance of aQueryRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.include()
Returns the value of theinclude
record component.nResults()
Returns the value of thenResults
record component.List<float[]>
Returns the value of thequeryEmbeddings
record component.final String
toString()
Returns a string representation of this record class.where()
Returns the value of thewhere
record component.
-
Constructor Details
-
QueryRequest
Convenience to query for a single embedding instead of a batch of embeddings. -
QueryRequest
-
QueryRequest
public QueryRequest(List<float[]> queryEmbeddings, Integer nResults, Map<String, Object> where, List<ChromaApi.QueryRequest.Include> include) Creates an instance of aQueryRequest
record class.- Parameters:
queryEmbeddings
- the value for thequeryEmbeddings
record componentnResults
- the value for thenResults
record componentwhere
- the value for thewhere
record componentinclude
- the value for theinclude
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
queryEmbeddings
Returns the value of thequeryEmbeddings
record component.- Returns:
- the value of the
queryEmbeddings
record component
-
nResults
Returns the value of thenResults
record component.- Returns:
- the value of the
nResults
record component
-
where
Returns the value of thewhere
record component.- Returns:
- the value of the
where
record component
-
include
Returns the value of theinclude
record component.- Returns:
- the value of the
include
record component
-