All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.langchain4j.runtime.tool.JsonIntegerSchemaObjectSubstitution Maven / Gradle / Ivy

There is a newer version: 0.21.0
Show newest version
package io.quarkiverse.langchain4j.runtime.tool;

import dev.langchain4j.model.chat.request.json.JsonIntegerSchema;
import io.quarkus.runtime.ObjectSubstitution;
import io.quarkus.runtime.annotations.RecordableConstructor;

public final class JsonIntegerSchemaObjectSubstitution
        implements ObjectSubstitution {
    @Override
    public Serialized serialize(JsonIntegerSchema obj) {
        return new Serialized(obj.description());
    }

    @Override
    public JsonIntegerSchema deserialize(Serialized obj) {
        return JsonIntegerSchema.builder()
                .description(obj.description)
                .build();
    }

    public record Serialized(String description) {
        @RecordableConstructor
        public Serialized {
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy