Package lumis.portal.ai.openai
Class OpenAiUtil
- java.lang.Object
-
- lumis.portal.ai.openai.OpenAiUtil
-
public class OpenAiUtil extends java.lang.Object
Class with utilities related to uses of OpenAi.- Since:
- 17.0.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description OpenAiUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.reactivex.Flowable<com.theokanning.openai.service.ChatMessageAccumulator>
createChatCompletionStreamToAccumulator(com.theokanning.openai.completion.chat.ChatCompletionRequest chatCompletionRequest)
CallsOpenAiApi.createChatCompletionStream(ChatCompletionRequest)
and maps the stream to aFlowable
ofChatMessageAccumulator
.static com.theokanning.openai.client.OpenAiApi
getOpenAiApi()
Returns the Open AI API.
-
-
-
Method Detail
-
getOpenAiApi
public static com.theokanning.openai.client.OpenAiApi getOpenAiApi()
Returns the Open AI API.- Returns:
- the Open AI API.
- Throws:
java.lang.IllegalStateException
- if theOpenAiApi
is not available to use.- Since:
- 17.0.0
-
createChatCompletionStreamToAccumulator
public static io.reactivex.Flowable<com.theokanning.openai.service.ChatMessageAccumulator> createChatCompletionStreamToAccumulator(com.theokanning.openai.completion.chat.ChatCompletionRequest chatCompletionRequest)
CallsOpenAiApi.createChatCompletionStream(ChatCompletionRequest)
and maps the stream to aFlowable
ofChatMessageAccumulator
.- Parameters:
chatCompletionRequest
- the chat completion request.- Returns:
- the flowable of chat message accumulator.
- Since:
- 17.0.0
-
-