Looking at the ChunkDocumentRequest vs BatchConvertDocumentRequest vs ConvertDocumentRequest object hierarchies - they all have very similar structures. They all have
@JsonProperty("sources")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@lombok.Singular
private List<Source> sources;
/**
* Specification for the type of output target.
*
* @param target the output target specification, or null if not specified
* @return the output target specification, or null if not specified
*/
@JsonProperty("target")
@Nullable
private Target target;
There are places, like in LangChain4j's DoclingDocumentParser where I want to be able to call either the convert or the chunk endpoint depending on what the request looks like.
I'm thinking of introducing a layer called DocumentRequest, move the sources and target properties up to that, and then have ChunkDocumentRequest, BatchDocumentRequest, and ConvertDocumentRequest extends from it.
Thoughts @ThomasVitale ?
Looking at the
ChunkDocumentRequestvsBatchConvertDocumentRequestvsConvertDocumentRequestobject hierarchies - they all have very similar structures. They all haveThere are places, like in LangChain4j's
DoclingDocumentParserwhere I want to be able to call either the convert or the chunk endpoint depending on what the request looks like.I'm thinking of introducing a layer called
DocumentRequest, move thesourcesandtargetproperties up to that, and then haveChunkDocumentRequest,BatchDocumentRequest, andConvertDocumentRequestextends from it.Thoughts @ThomasVitale ?