From 83172f3fd479190b8db6f008ac8f4080e2d846bc Mon Sep 17 00:00:00 2001 From: Eric Deandrea Date: Mon, 25 Nov 2024 08:23:10 -0500 Subject: [PATCH] Migrate to the JsonSchemaElement API Closes #1054 --- .../ToolParametersObjectSubstitution.java | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/tool/ToolParametersObjectSubstitution.java diff --git a/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/tool/ToolParametersObjectSubstitution.java b/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/tool/ToolParametersObjectSubstitution.java deleted file mode 100644 index 8c12cd3dd..000000000 --- a/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/tool/ToolParametersObjectSubstitution.java +++ /dev/null @@ -1,62 +0,0 @@ -package io.quarkiverse.langchain4j.runtime.tool; - -import java.util.List; -import java.util.Map; - -import dev.langchain4j.agent.tool.ToolParameters; -import io.quarkus.runtime.ObjectSubstitution; -import io.quarkus.runtime.annotations.RecordableConstructor; - -/** - * @deprecated - * @see JsonArraySchemaObjectSubstitution - * @see JsonBooleanSchemaObjectSubstitution - * @see JsonEnumSchemaObjectSubstitution - * @see JsonIntegerSchemaObjectSubstitution - * @see JsonNumberSchemaObjectSubstitution - * @see JsonObjectSchemaObjectSubstitution - * @see JsonReferenceSchemaObjectSubstitution - * @see JsonStringSchemaObjectSubstitution - */ -@Deprecated(forRemoval = true) -public class ToolParametersObjectSubstitution - implements ObjectSubstitution { - - @Override - public Serialized serialize(ToolParameters obj) { - return new Serialized(obj.type(), obj.properties(), obj.required()); - } - - @Override - public ToolParameters deserialize(Serialized obj) { - return ToolParameters.builder() - .type(obj.type) - .required(obj.required) - .properties(obj.properties).build(); - } - - public static class Serialized { - private final String type; - private final Map> properties; - private final List required; - - @RecordableConstructor - public Serialized(String type, Map> properties, List required) { - this.type = type; - this.properties = properties; - this.required = required; - } - - public String getType() { - return type; - } - - public Map> getProperties() { - return properties; - } - - public List getRequired() { - return required; - } - } -}