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 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.
- Since:
- 0.8.0
- Author:
- Christian Tzolov, Wei Jiang
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCohere Embedding API input types.static enumSpecifies how the API handles inputs longer than the maximum token length. -
Constructor Summary
ConstructorsConstructorDescriptionCohereEmbeddingRequest(List<String> texts, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.InputType inputType, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.Truncate truncate) Creates an instance of aCohereEmbeddingRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinputTyperecord component.texts()Returns the value of thetextsrecord component.final StringtoString()Returns a string representation of this record class.truncate()Returns the value of thetruncaterecord component.
-
Constructor Details
-
CohereEmbeddingRequest
public CohereEmbeddingRequest(List<String> texts, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.InputType inputType, CohereEmbeddingBedrockApi.CohereEmbeddingRequest.Truncate truncate) Creates an instance of aCohereEmbeddingRequestrecord class.
-
-
Method Details
-
toString
-
hashCode
-
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
-
inputType
-
truncate
-