Class AsyncPromise
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.vision.VisionConfigurationStage
-
- bg.codexio.ai.openai.api.sdk.vision.AsyncPromise
-
public class AsyncPromise extends VisionConfigurationStage
Async promise to choose between raw response or just a simple string answer.
-
-
Field Summary
-
Fields inherited from class bg.codexio.ai.openai.api.sdk.vision.VisionConfigurationStage
executor, requestContext
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEachLine(Consumer<String> onEachLine)Subscribe to each line (whether streamed or from the whole response)voidthen(Consumer<bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse> afterAll)Subscribe to the whole response when all lines are supplied.voidthen(Consumer<bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse> afterAll, Consumer<String> onEachLine)Subscribe both to each line (whether streamed or from the whole response) and to the whole response when all lines are supplied.
-
-
-
Method Detail
-
then
public void then(Consumer<bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse> afterAll, Consumer<String> onEachLine)
Subscribe both to each line (whether streamed or from the whole response) and to the whole response when all lines are supplied.- Parameters:
afterAll- callback that accepts theChatMessageResponseonEachLine- callback that accepts each response line as a string
-
onEachLine
public void onEachLine(Consumer<String> onEachLine)
Subscribe to each line (whether streamed or from the whole response)- Parameters:
onEachLine- callback that accepts each response line as a string
-
then
public void then(Consumer<bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse> afterAll)
Subscribe to the whole response when all lines are supplied.- Parameters:
afterAll- callback that accepts theChatMessageResponse
-
-