Record Class CohereEmbeddingBedrockApi.CohereEmbeddingRequest

java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.cohere.api.CohereEmbeddingBedrockApi.CohereEmbeddingRequest
Record Components:
texts - An array of strings for the model to embed. For optimal performance, we recommend reducing the length of each text to less than 512 tokens. 1 token is about 4 characters.
inputType - Prepends special tokens to differentiate each type from one another. You should not mix different types together, except when mixing types for for search and retrieval. In this case, embed your corpus with the search_document type and embedded queries with type search_query type.
truncate - Specifies how the API handles inputs longer than the maximum token length. If you specify LEFT or RIGHT, the model discards the input until the remaining input is exactly the maximum input token length for the model.
Enclosing class:
CohereEmbeddingBedrockApi

public static record CohereEmbeddingBedrockApi.CohereEmbeddingRequest(List<String> texts, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.InputType inputType, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.Truncate truncate) extends Record
The Cohere Embed model request.
  • 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.
    • texts

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

      Returns the value of the inputType record component.
      Returns:
      the value of the inputType record component
    • truncate

      Returns the value of the truncate record component.
      Returns:
      the value of the truncate record component