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 Details

  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • embeddings

      public List<float[]> embeddings()
      Returns the value of the embeddings record component.
      Returns:
      the value of the embeddings record component
    • texts

      public List<String> texts()
      Returns the value of the texts record component.
      Returns:
      the value of the texts record component
    • responseType

      public String responseType()
      Returns the value of the responseType record component.
      Returns:
      the value of the responseType record component
    • amazonBedrockInvocationMetrics

      public AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics()
      Returns the value of the amazonBedrockInvocationMetrics record component.
      Returns:
      the value of the amazonBedrockInvocationMetrics record component