com.microsoft.semantickernel.aiservices.google.implementation.MonoConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of semantickernel-aiservices-google Show documentation
Show all versions of semantickernel-aiservices-google Show documentation
Google services for Semantic Kernel
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.aiservices.google.implementation;
import com.google.api.core.ApiFuture;
import reactor.core.publisher.Mono;
public class MonoConverter {
public static Mono fromApiFuture(ApiFuture apiFuture) {
return Mono.create(sink -> {
apiFuture.addListener(() -> {
try {
T result = apiFuture.get();
sink.success(result);
} catch (Exception e) {
sink.error(e);
}
}, runnable -> new Thread(runnable).start());
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy