Class Jackson3ToolSpecificationJsonCodec
java.lang.Object
dev.langchain4j.jackson3.Jackson3ToolSpecificationJsonCodec
- All Implemented Interfaces:
ToolSpecificationJsonCodec
public class Jackson3ToolSpecificationJsonCodec
extends Object
implements ToolSpecificationJsonCodec
Jackson 3 twin of the default tool specification codec.
It uses its own mapper, separate from the general-purpose codec, so that tool specification
serialization is not affected by customizations applied through JsonCodecFactory.
-
Constructor Summary
ConstructorsConstructorDescriptionJackson3ToolSpecificationJsonCodec(tools.jackson.databind.ObjectMapper objectMapper) -
Method Summary
-
Constructor Details
-
Jackson3ToolSpecificationJsonCodec
public Jackson3ToolSpecificationJsonCodec() -
Jackson3ToolSpecificationJsonCodec
public Jackson3ToolSpecificationJsonCodec(tools.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
toJson
Description copied from interface:ToolSpecificationJsonCodecSerializes an object to a JSON string.- Specified by:
toJsonin interfaceToolSpecificationJsonCodec- Parameters:
object- the object to serialize.- Returns:
- the JSON string.
-
fromJson
Description copied from interface:ToolSpecificationJsonCodecDeserializes a JSON string to an object of the given class.- Specified by:
fromJsonin interfaceToolSpecificationJsonCodec- Type Parameters:
T- the type of the object.- Parameters:
json- the JSON string to deserialize.type- the class of the object.- Returns:
- the deserialized object.
-