io.github.sashirestela.openai.support.JsonSchemaUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-openai Show documentation
Show all versions of simple-openai Show documentation
A Java library to use the OpenAI API in the simplest possible way.
package io.github.sashirestela.openai.support;
import com.fasterxml.jackson.databind.JsonNode;
import io.github.sashirestela.openai.common.function.SchemaConverter;
public class JsonSchemaUtil {
public static final SchemaConverter defaultConverter = new DefaultSchemaConverter();
public static final String JSON_EMPTY_CLASS = "{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}";
private JsonSchemaUtil() {
}
public static JsonNode classToJsonSchema(Class> clazz) {
return defaultConverter.convert(clazz);
}
}