io.quarkiverse.langchain4j.runtime.jackson.ContextMixin Maven / Gradle / Ivy
package io.quarkiverse.langchain4j.runtime.jackson;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import dev.langchain4j.data.message.Content;
import dev.langchain4j.data.message.ContentType;
import dev.langchain4j.data.message.ImageContent;
import dev.langchain4j.data.message.TextContent;
import io.quarkus.jackson.JacksonMixin;
@JacksonMixin(Content.class)
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = TextContent.class, name = "TEXT"),
@JsonSubTypes.Type(value = ImageContent.class, name = "IMAGE"),
})
public abstract class ContextMixin {
@JsonProperty
public abstract ContentType type();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy