Class OpenAIChatCompletion
- java.lang.Object
-
- com.microsoft.semantickernel.aiservices.openai.OpenAiService<com.azure.ai.openai.OpenAIAsyncClient>
-
- com.microsoft.semantickernel.aiservices.openai.chatcompletion.OpenAIChatCompletion
-
- All Implemented Interfaces:
AIService,ChatCompletionService,TextAIService
public class OpenAIChatCompletion extends OpenAiService<com.azure.ai.openai.OpenAIAsyncClient> implements ChatCompletionService
OpenAI chat completion service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenAIChatCompletion.BuilderBuilder for creating a new instance ofOpenAIChatCompletion.
-
Field Summary
-
Fields inherited from interface com.microsoft.semantickernel.services.TextAIService
MAX_RESULTS_PER_PROMPT, MAXIMUM_INFLIGHT_AUTO_INVOKES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OpenAIChatCompletion.Builderbuilder()Create a new instance ofOpenAIChatCompletion.Builder.reactor.core.publisher.Mono<List<ChatMessageContent<?>>>getChatMessageContentsAsync(ChatHistory chatHistory, Kernel kernel, InvocationContext invocationContext)reactor.core.publisher.Mono<List<ChatMessageContent<?>>>getChatMessageContentsAsync(String prompt, Kernel kernel, InvocationContext invocationContext)reactor.core.publisher.Flux<StreamingChatContent<?>>getStreamingChatMessageContentsAsync(ChatHistory chatHistory, Kernel kernel, InvocationContext invocationContext)reactor.core.publisher.Flux<StreamingChatContent<?>>getStreamingChatMessageContentsAsync(String prompt, Kernel kernel, InvocationContext invocationContext)-
Methods inherited from class com.microsoft.semantickernel.aiservices.openai.OpenAiService
getDeploymentName, getModelId, getServiceId
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microsoft.semantickernel.services.AIService
getModelId, getServiceId
-
-
-
-
Method Detail
-
builder
public static OpenAIChatCompletion.Builder builder()
Create a new instance ofOpenAIChatCompletion.Builder.- Returns:
- a new instance of
OpenAIChatCompletion.Builder
-
getChatMessageContentsAsync
public reactor.core.publisher.Mono<List<ChatMessageContent<?>>> getChatMessageContentsAsync(ChatHistory chatHistory, @Nullable Kernel kernel, @Nullable InvocationContext invocationContext)
- Specified by:
getChatMessageContentsAsyncin interfaceChatCompletionService
-
getChatMessageContentsAsync
public reactor.core.publisher.Mono<List<ChatMessageContent<?>>> getChatMessageContentsAsync(String prompt, @Nullable Kernel kernel, @Nullable InvocationContext invocationContext)
- Specified by:
getChatMessageContentsAsyncin interfaceChatCompletionService
-
getStreamingChatMessageContentsAsync
public reactor.core.publisher.Flux<StreamingChatContent<?>> getStreamingChatMessageContentsAsync(ChatHistory chatHistory, @Nullable Kernel kernel, @Nullable InvocationContext invocationContext)
- Specified by:
getStreamingChatMessageContentsAsyncin interfaceChatCompletionService
-
getStreamingChatMessageContentsAsync
public reactor.core.publisher.Flux<StreamingChatContent<?>> getStreamingChatMessageContentsAsync(String prompt, @Nullable Kernel kernel, @Nullable InvocationContext invocationContext)
- Specified by:
getStreamingChatMessageContentsAsyncin interfaceChatCompletionService
-
-