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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Cohere Embedding API input types.static enum
Specifies how the API handles inputs longer than the maximum token length. -
Constructor Summary
ConstructorDescriptionCohereEmbeddingRequest
(List<String> texts, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.InputType inputType, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.Truncate truncate) Creates an instance of aCohereEmbeddingRequest
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.Returns the value of theinputType
record component.texts()
Returns the value of thetexts
record component.final String
toString()
Returns a string representation of this record class.truncate()
Returns the value of thetruncate
record component.
-
Constructor Details
-
CohereEmbeddingRequest
public CohereEmbeddingRequest(List<String> texts, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.InputType inputType, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.Truncate truncate) Creates an instance of aCohereEmbeddingRequest
record class.
-
-
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)
. -
texts
Returns the value of thetexts
record component.- Returns:
- the value of the
texts
record component
-
inputType
Returns the value of theinputType
record component.- Returns:
- the value of the
inputType
record component
-
truncate
Returns the value of thetruncate
record component.- Returns:
- the value of the
truncate
record component
-