Class OpenAiEmbeddingDeserializer
java.lang.Object
tools.jackson.databind.ValueDeserializer<float[]>
org.springframework.ai.openai.api.OpenAiEmbeddingDeserializer
- All Implemented Interfaces:
tools.jackson.databind.deser.NullValueProvider
public class OpenAiEmbeddingDeserializer
extends tools.jackson.databind.ValueDeserializer<float[]>
Used to deserialize the `embedding` field returned by the model.
Supports two input formats:
float[]- returned directly as-is.- A Base64-encoded string representing a float array stored in little-endian format.
The string is first decoded into a byte array, then converted into a
float[].
- Author:
- Sun Yuhan
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer
tools.jackson.databind.ValueDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]deserialize(tools.jackson.core.JsonParser jsonParser, tools.jackson.databind.DeserializationContext deserializationContext) Methods inherited from class tools.jackson.databind.ValueDeserializer
createContextual, deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
OpenAiEmbeddingDeserializer
public OpenAiEmbeddingDeserializer()
-
-
Method Details
-
deserialize
public float[] deserialize(tools.jackson.core.JsonParser jsonParser, tools.jackson.databind.DeserializationContext deserializationContext) throws tools.jackson.core.JacksonException - Specified by:
deserializein classtools.jackson.databind.ValueDeserializer<float[]>- Throws:
tools.jackson.core.JacksonException
-