Interface TextGenerationService
-
- All Superinterfaces:
AIService,TextAIService
public interface TextGenerationService extends TextAIService
Interface for text completion services
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTextGenerationService.BuilderBuilder for a TextGenerationService
-
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 Abstract Methods Modifier and Type Method Description static TextGenerationService.Builderbuilder()Get the builder for the TextGenerationServicereactor.core.publisher.Flux<StreamingTextContent>getStreamingTextContentsAsync(String prompt, PromptExecutionSettings executionSettings, Kernel kernel)Get streaming results for the prompt using the specified execution settings.reactor.core.publisher.Mono<List<TextContent>>getTextContentsAsync(String prompt, PromptExecutionSettings executionSettings, Kernel kernel)Creates a completion for the prompt and settings.-
Methods inherited from interface com.microsoft.semantickernel.services.AIService
getModelId, getServiceId
-
-
-
-
Method Detail
-
builder
static TextGenerationService.Builder builder()
Get the builder for the TextGenerationService- Returns:
- The builder
-
getTextContentsAsync
reactor.core.publisher.Mono<List<TextContent>> getTextContentsAsync(String prompt, @Nullable PromptExecutionSettings executionSettings, @Nullable Kernel kernel)
Creates a completion for the prompt and settings.- Parameters:
prompt- The prompt to complete.executionSettings- Request settings for the completion APIkernel- TheKernelcontaining services, plugins, and other state for use throughout the operation.- Returns:
- Text generated by the remote model
-
getStreamingTextContentsAsync
reactor.core.publisher.Flux<StreamingTextContent> getStreamingTextContentsAsync(String prompt, @Nullable PromptExecutionSettings executionSettings, @Nullable Kernel kernel)
Get streaming results for the prompt using the specified execution settings. Each modality may support for different types of streaming contents.- Parameters:
prompt- The prompt to complete.executionSettings- The AI execution settings (optional).kernel- TheKernelcontaining services, plugins, and other state for use throughout the operation.- Returns:
- Streaming list of different completion streaming string updates generated by the remote model
-
-