Package bg.codexio.ai.openai.api.payload
Interface Mergeable<T extends Mergeable<?>>
- Type Parameters:
T- Another streamable. Most probably object of the same type.
- All Known Implementing Classes:
AudioBinaryResponse,ChatChoiceResponse,ChatMessageResponse,ChatUsageResponse,FunctionResponse,ImageDataResponse,ImageResponse,SpeechTextResponse,ToolCallResponse
public interface Mergeable<T extends Mergeable<?>>
This interface mostly makes sense
in conjunction with Streamable.stream() == true.
So each streamed line, can be joined to the next one,
forming one big response at the end.
Most response objects actually implements this interface without the necessity of doing it, as the API they belong to will never support streaming, such as Images Creation API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Mergeable<U>>
UdoMerge(U source, U target) static <T,U> List <T> join(Collection<T> source, Collection<T> target, Predicate<T> filter, Function<? super T, U> grouping, Supplier<T> emptySupplier, BinaryOperator<T> merger, Predicate<T> shallPersist)
-
Method Details
-
doMerge
-
join
static <T,U> List<T> join(Collection<T> source, Collection<T> target, Predicate<T> filter, Function<? super T, U> grouping, Supplier<T> emptySupplier, BinaryOperator<T> merger, Predicate<T> shallPersist) -
merge
-