@RestController @Validated @RequestMapping(value="/completions") @ExposesResourceFor(value=CompletionProposalsResource.class) public class CompletionController extends Object
StreamCompletionProvider and
TaskCompletionProvider as a REST API.| Constructor and Description |
|---|
CompletionController(StreamCompletionProvider completionProvider,
TaskCompletionProvider taskCompletionProvider)
Create a controller for the provided
StreamCompletionProvider and
TaskCompletionProvider. |
| Modifier and Type | Method and Description |
|---|---|
CompletionProposalsResource |
completions(String start,
@Min(value=1L,message="The provided detail level must be greater than zero.") int detailLevel)
Return a list of possible completions given a prefix string that the user has
started typing.
|
CompletionProposalsResource |
taskCompletions(String start,
@Min(value=1L,message="The provided detail level must be greater than zero.") int detailLevel)
Return a list of possible completions given a prefix string that the user has
started typing.
|
public CompletionController(StreamCompletionProvider completionProvider, TaskCompletionProvider taskCompletionProvider)
StreamCompletionProvider and
TaskCompletionProvider.completionProvider - the stream completion providertaskCompletionProvider - the task completion provider@RequestMapping(value="/stream") public CompletionProposalsResource completions(@RequestParam(value="start") String start, @RequestParam(value="detailLevel",defaultValue="1") @Min(value=1L,message="The provided detail level must be greater than zero.") @Min(value=1L,message="The provided detail level must be greater than zero.") int detailLevel)
start - the amount of text written so fardetailLevel - the level of detail the user wants in completions, starting at
1. Higher values request more detail, with values typically in the range [1..5]@RequestMapping(value="/task") public CompletionProposalsResource taskCompletions(@RequestParam(value="start") String start, @RequestParam(value="detailLevel",defaultValue="1") @Min(value=1L,message="The provided detail level must be greater than zero.") @Min(value=1L,message="The provided detail level must be greater than zero.") int detailLevel)
start - the amount of text written so fardetailLevel - the level of detail the user wants in completions, starting at
1. Higher values request more detail, with values typically in the range [1..5]Copyright © 2020 Pivotal Software, Inc.. All rights reserved.