Record Class ZhiPuAiApi.EmbeddingRequest<T>
java.lang.Object
java.lang.Record
org.springframework.ai.zhipuai.api.ZhiPuAiApi.EmbeddingRequest<T>
- Type Parameters:
T- Type of the input.- Record Components:
input- Input text to embed, encoded as a string or array of tokens.model- ID of the model to use.
- Enclosing class:
- ZhiPuAiApi
public static record ZhiPuAiApi.EmbeddingRequest<T>(T input, String model, Integer dimensions)
extends Record
Creates an embedding vector representing the input text.
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingRequest(T input) Create an embedding request with the given input.EmbeddingRequest(T input, String model) Create an embedding request with the given input and model.EmbeddingRequest(T input, String model, Integer dimensions) Creates an instance of aEmbeddingRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedimensionsrecord component.final 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.model()Returns the value of themodelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EmbeddingRequest
Create an embedding request with the given input. Encoding model is set to 'embedding-2'.- Parameters:
input- Input text to embed.
-
EmbeddingRequest
Create an embedding request with the given input and model.- Parameters:
input-model-
-
EmbeddingRequest
Creates an instance of aEmbeddingRequestrecord 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). -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
dimensions
Returns the value of thedimensionsrecord component.- Returns:
- the value of the
dimensionsrecord component
-