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 aEmbeddingRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedimensions
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.input()
Returns the value of theinput
record component.model()
Returns the value of themodel
record component.final String
toString()
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 aEmbeddingRequest
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)
. -
input
Returns the value of theinput
record component.- Returns:
- the value of the
input
record component
-
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
record component
-
dimensions
Returns the value of thedimensions
record component.- Returns:
- the value of the
dimensions
record component
-