Interface TextCompletion
-
- All Known Subinterfaces:
ChatCompletion<ChatHistoryType>
public interface TextCompletion extends AIService, Buildable
Interface for text completion services
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTextCompletion.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static TextCompletion.Builderbuilder()reactor.core.publisher.Mono<List<String>>completeAsync(String text, CompletionRequestSettings requestSettings)Creates a completion for the prompt and settings.reactor.core.publisher.Flux<String>completeStreamAsync(String text, CompletionRequestSettings requestSettings)Creates a completion for the prompt and settings.CompletionTypedefaultCompletionType()Returns the default completion type for this service.
-
-
-
Method Detail
-
completeAsync
reactor.core.publisher.Mono<List<String>> completeAsync(@Nonnull String text, @Nonnull CompletionRequestSettings requestSettings)
Creates a completion for the prompt and settings.- Parameters:
text- The prompt to complete.requestSettings- Request settings for the completion API- Returns:
- Text generated by the remote model
-
completeStreamAsync
reactor.core.publisher.Flux<String> completeStreamAsync(@Nonnull String text, @Nonnull CompletionRequestSettings requestSettings)
Creates a completion for the prompt and settings.- Parameters:
text- The prompt to complete.requestSettings- Request settings for the completion API- Returns:
- Text generated by the remote model
-
builder
static TextCompletion.Builder builder()
-
defaultCompletionType
CompletionType defaultCompletionType()
Returns the default completion type for this service. This will be the type of request used (streaming or non-streaming) when calls to this service are made. Defaults toCompletionType.STREAMING.- Returns:
- The default completion type for this service.
-
-