Record Class CohereEmbeddingBedrockApi.CohereEmbeddingResponse
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.cohere.api.CohereEmbeddingBedrockApi.CohereEmbeddingResponse
- Record Components:
id- An identifier for the response.embeddings- An array of embeddings, where each embedding is an array of floats with 1024 elements. The length of the embeddings array will be the same as the length of the original texts array.texts- An array containing the text entries for which embeddings were returned.responseType- The type of the response. The value is always embeddings.amazonBedrockInvocationMetrics- Bedrock invocation metrics. Currently bedrock doesn't return invocationMetrics for the cohere embedding model.
- Enclosing class:
- CohereEmbeddingBedrockApi
public static record CohereEmbeddingBedrockApi.CohereEmbeddingResponse(String id, List<float[]> embeddings, List<String> texts, String responseType, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics)
extends Record
Cohere Embedding response.
-
Constructor Summary
ConstructorsConstructorDescriptionCohereEmbeddingResponse(String id, List<float[]> embeddings, List<String> texts, String responseType, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aCohereEmbeddingResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamazonBedrockInvocationMetricsrecord component.List<float[]>Returns the value of theembeddingsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theresponseTyperecord component.texts()Returns the value of thetextsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CohereEmbeddingResponse
public CohereEmbeddingResponse(String id, List<float[]> embeddings, List<String> texts, String responseType, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aCohereEmbeddingResponserecord class.- Parameters:
id- the value for theidrecord componentembeddings- the value for theembeddingsrecord componenttexts- the value for thetextsrecord componentresponseType- the value for theresponseTyperecord componentamazonBedrockInvocationMetrics- the value for theamazonBedrockInvocationMetricsrecord 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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
embeddings
Returns the value of theembeddingsrecord component.- Returns:
- the value of the
embeddingsrecord component
-
texts
Returns the value of thetextsrecord component.- Returns:
- the value of the
textsrecord component
-
responseType
Returns the value of theresponseTyperecord component.- Returns:
- the value of the
responseTyperecord component
-
amazonBedrockInvocationMetrics
Returns the value of theamazonBedrockInvocationMetricsrecord component.- Returns:
- the value of the
amazonBedrockInvocationMetricsrecord component
-