Record Class OllamaApi.EmbeddingsRequest
java.lang.Object
java.lang.Record
org.springframework.ai.ollama.api.OllamaApi.EmbeddingsRequest
- Record Components:
model- The name of model to generate embeddings from.input- The text or list of text to generate embeddings for.keepAlive- Controls how long the model will stay loaded into memory following the request (default: 5m).options- Additional model parameters listed in the documentation for thetruncate- Truncates the end of each input to fit within context length. Returns error if false and context length is exceeded. Defaults to true.
- Enclosing class:
- OllamaApi
public static record OllamaApi.EmbeddingsRequest(String model, List<String> input, String keepAlive, Map<String,Object> options, Boolean truncate)
extends Record
Generate embeddings from a model.
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingsRequest(String model, String input) Shortcut constructor to create a EmbeddingRequest without options.EmbeddingsRequest(String model, List<String> input, String keepAlive, Map<String, Object> options, Boolean truncate) Creates an instance of aEmbeddingsRequestrecord 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.input()Returns the value of theinputrecord component.Returns the value of thekeepAliverecord component.model()Returns the value of themodelrecord component.options()Returns the value of theoptionsrecord component.final StringtoString()Returns a string representation of this record class.truncate()Returns the value of thetruncaterecord component.
-
Constructor Details
-
EmbeddingsRequest
Shortcut constructor to create a EmbeddingRequest without options.- Parameters:
model- The name of model to generate embeddings from.input- The text or list of text to generate embeddings for.
-
EmbeddingsRequest
public EmbeddingsRequest(String model, List<String> input, String keepAlive, Map<String, Object> options, Boolean truncate) Creates an instance of aEmbeddingsRequestrecord 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). -
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
keepAlive
Returns the value of thekeepAliverecord component.- Returns:
- the value of the
keepAliverecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
truncate
Returns the value of thetruncaterecord component.- Returns:
- the value of the
truncaterecord component
-